mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
fix error in type answer when field has \g etc
This commit is contained in:
parent
dceb13c720
commit
ca2f9acce2
1 changed files with 7 additions and 3 deletions
|
@ -386,9 +386,13 @@ Please run Tools>Maintenance>Empty Cards""")
|
|||
res += u"<span id=rightanswer><br> {0} <br> {1} </span>".format(
|
||||
_(u"Correct answer was:"), cor)
|
||||
# and update the type answer area
|
||||
return re.sub(self.typeAnsPat, """
|
||||
<span style="font-family: '%s'; font-size: %spx">%s</span>""" %
|
||||
(self.typeFont, self.typeSize, res), buf)
|
||||
def repl(match):
|
||||
# can't pass a string in directly, and can't use re.escape as it
|
||||
# escapes too much
|
||||
return """
|
||||
<span style="font-family: '%s'; font-size: %spx">%s</span>""" % (
|
||||
self.typeFont, self.typeSize, res)
|
||||
return re.sub(self.typeAnsPat, repl, buf)
|
||||
|
||||
def _contentForCloze(self, txt, idx):
|
||||
matches = re.findall("\{\{c%s::(.+?)\}\}"%idx, txt)
|
||||
|
|
Loading…
Reference in a new issue