mirror of
https://github.com/ankitects/anki.git
synced 2025-09-23 00:12:25 -04:00
don't strip all html on cloze, just the misaligned style
This commit is contained in:
parent
20f0d49e42
commit
42a4c21d9c
1 changed files with 2 additions and 4 deletions
|
@ -290,7 +290,6 @@ class FactEditor(object):
|
||||||
self.cloze.connect(self.clozeSC, SIGNAL("activated()"),
|
self.cloze.connect(self.clozeSC, SIGNAL("activated()"),
|
||||||
self.onCloze)
|
self.onCloze)
|
||||||
self.cloze.setToolTip(_("Cloze (F9)"))
|
self.cloze.setToolTip(_("Cloze (F9)"))
|
||||||
#self.cloze.setIcon(QIcon(":/icons/document-cloze.png"))
|
|
||||||
self.cloze.setFixedWidth(30)
|
self.cloze.setFixedWidth(30)
|
||||||
self.cloze.setFixedHeight(26)
|
self.cloze.setFixedHeight(26)
|
||||||
self.cloze.setText("[...]")
|
self.cloze.setText("[...]")
|
||||||
|
@ -746,8 +745,8 @@ class FactEditor(object):
|
||||||
src = self.focusedEdit()
|
src = self.focusedEdit()
|
||||||
if not src:
|
if not src:
|
||||||
return
|
return
|
||||||
re1 = "\[.+?(:(.+?))?\]"
|
re1 = "\[(?:<.+?>)?.+?(:(.+?))?\](?:</.+?>)?"
|
||||||
re2 = "\[(.+?)(:.+?)?\]"
|
re2 = "\[(?:<.+?>)?(.+?)(:.+?)?\](?:</.+?>)?"
|
||||||
# add brackets because selected?
|
# add brackets because selected?
|
||||||
cursor = src.textCursor()
|
cursor = src.textCursor()
|
||||||
oldSrc = None
|
oldSrc = None
|
||||||
|
@ -798,7 +797,6 @@ class FactEditor(object):
|
||||||
return
|
return
|
||||||
# create
|
# create
|
||||||
s = unicode(src.toHtml())
|
s = unicode(src.toHtml())
|
||||||
s = stripHTML(s)
|
|
||||||
def repl(match):
|
def repl(match):
|
||||||
exp = ""
|
exp = ""
|
||||||
if match.group(2):
|
if match.group(2):
|
||||||
|
|
Loading…
Reference in a new issue