can't assign tuple to bs attrs without breaking later code
This commit is contained in:
parent
6eada1e7c4
commit
b1ae088042
@ -301,7 +301,7 @@ def _filterHTML(html):
|
|||||||
preserve += item + ";"
|
preserve += item + ";"
|
||||||
if preserve:
|
if preserve:
|
||||||
# preserve colour attribute, delete implicit class
|
# preserve colour attribute, delete implicit class
|
||||||
tag.attrs = ((u"style", preserve),)
|
tag['style'] = preserve
|
||||||
del tag['class']
|
del tag['class']
|
||||||
else:
|
else:
|
||||||
# strip completely
|
# strip completely
|
||||||
@ -309,7 +309,9 @@ def _filterHTML(html):
|
|||||||
for tag in doc("font", "Apple-style-span"):
|
for tag in doc("font", "Apple-style-span"):
|
||||||
# strip all but colour attr from implicit font tags
|
# strip all but colour attr from implicit font tags
|
||||||
if 'color' in dict(tag.attrs):
|
if 'color' in dict(tag.attrs):
|
||||||
tag.attrs = ((u"color", tag['color']),)
|
for attr in tag.attrs:
|
||||||
|
if attr != "color":
|
||||||
|
del tag[attr]
|
||||||
# and apple class
|
# and apple class
|
||||||
del tag['class']
|
del tag['class']
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user