From 243c2b11ed1ad020970b72fcde47dbda02b8df69 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Sat, 22 Dec 2012 07:18:33 +0900 Subject: [PATCH] preserve font-style/font-weight fixes https://anki.lighthouseapp.com/projects/100923-ankidesktop/tickets/333-html-being-changed-after-the-card-is-created --- aqt/editor.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aqt/editor.py b/aqt/editor.py index 65ca39e98..d3cfaf114 100644 --- a/aqt/editor.py +++ b/aqt/editor.py @@ -275,6 +275,8 @@ def _filterHTML(html): continue if k.strip() == "color" and not v.strip() == "rgb(0, 0, 0)": preserve += "color:%s;" % v + if k.strip() in ("font-weight", "font-style"): + preserve += item + ";" if preserve: # preserve colour attribute, delete implicit class tag.attrs = ((u"style", preserve),)