mirror of
https://github.com/ankitects/anki.git
synced 2025-09-21 15:32:23 -04:00
if context is off, don't lose outer field styling
This commit is contained in:
parent
0fdb966766
commit
f0909ebed2
1 changed files with 3 additions and 1 deletions
|
@ -186,7 +186,9 @@ class Template(object):
|
|||
# just the answers
|
||||
ans = re.findall(reg%ord, txt)
|
||||
ans = ["<span class=cloze>"+a[0]+"</span>" for a in ans]
|
||||
return ", ".join(ans)
|
||||
ans = ", ".join(ans)
|
||||
# but we want to preserve the outer field styling
|
||||
return re.sub("(^<span.+?>)(.*)</span>", "\\1"+ans+"</span>", txt)
|
||||
# and display other clozes normally
|
||||
return re.sub(reg%".*?", "\\1", txt)
|
||||
|
||||
|
|
Loading…
Reference in a new issue