From b1ae088042221103dc934358ea9ab6461ea542e1 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Thu, 23 May 2013 11:37:14 +0900 Subject: [PATCH] can't assign tuple to bs attrs without breaking later code --- aqt/editor.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aqt/editor.py b/aqt/editor.py index 94c6811c9..47f7078ae 100644 --- a/aqt/editor.py +++ b/aqt/editor.py @@ -301,7 +301,7 @@ def _filterHTML(html): preserve += item + ";" if preserve: # preserve colour attribute, delete implicit class - tag.attrs = ((u"style", preserve),) + tag['style'] = preserve del tag['class'] else: # strip completely @@ -309,7 +309,9 @@ def _filterHTML(html): for tag in doc("font", "Apple-style-span"): # strip all but colour attr from implicit font tags 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 del tag['class'] else: