From 42a4c21d9c6ecc1aaa9555783aff517663ed0792 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Fri, 12 Jun 2009 20:11:36 +0900 Subject: [PATCH] don't strip all html on cloze, just the misaligned style --- ankiqt/ui/facteditor.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ankiqt/ui/facteditor.py b/ankiqt/ui/facteditor.py index dc0aba83f..12e8aa4fc 100644 --- a/ankiqt/ui/facteditor.py +++ b/ankiqt/ui/facteditor.py @@ -290,7 +290,6 @@ class FactEditor(object): self.cloze.connect(self.clozeSC, SIGNAL("activated()"), self.onCloze) self.cloze.setToolTip(_("Cloze (F9)")) - #self.cloze.setIcon(QIcon(":/icons/document-cloze.png")) self.cloze.setFixedWidth(30) self.cloze.setFixedHeight(26) self.cloze.setText("[...]") @@ -746,8 +745,8 @@ class FactEditor(object): src = self.focusedEdit() if not src: return - re1 = "\[.+?(:(.+?))?\]" - re2 = "\[(.+?)(:.+?)?\]" + re1 = "\[(?:<.+?>)?.+?(:(.+?))?\](?:)?" + re2 = "\[(?:<.+?>)?(.+?)(:.+?)?\](?:)?" # add brackets because selected? cursor = src.textCursor() oldSrc = None @@ -798,7 +797,6 @@ class FactEditor(object): return # create s = unicode(src.toHtml()) - s = stripHTML(s) def repl(match): exp = "" if match.group(2):