mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 08:46:37 -04:00
fix detection of media refs in cloze
https://anki.tenderapp.com/discussions/beta-testing/796-another-check-media-issue
This commit is contained in:
parent
a6391bbe8c
commit
e3885fd924
1 changed files with 4 additions and 4 deletions
|
@ -189,15 +189,15 @@ create table meta (dirMod int, lastUsn int); insert into meta values (0, 0);
|
|||
strings = []
|
||||
from anki.template.template import clozeReg
|
||||
def qrepl(m):
|
||||
if m.group(3):
|
||||
return "[%s]" % m.group(3)
|
||||
if m.group(4):
|
||||
return "[%s]" % m.group(4)
|
||||
else:
|
||||
return "[...]"
|
||||
def arepl(m):
|
||||
return m.group(1)
|
||||
return m.group(2)
|
||||
for ord in ords:
|
||||
s = re.sub(clozeReg%ord, qrepl, string)
|
||||
s = re.sub(clozeReg%".+?", "\\2", s)
|
||||
s = re.sub(clozeReg%".+?", "\\4", s)
|
||||
strings.append(s)
|
||||
strings.append(re.sub(clozeReg%".+?", arepl, string))
|
||||
return strings
|
||||
|
|
Loading…
Reference in a new issue