For some reason, when exporting commented text with background colors, angle brackets for html spans are sometimes returned as entities by soup.
def update(obj, kwargs):
"""
Update obj attributes with values from kwargs
"""
for k,v in kwargs.items():
if hasattr(obj,k):
setattr(obj,k,v)