fix issues with clozes and <% %>
This commit is contained in:
parent
df43ef26d0
commit
0447cb4f41
@ -498,9 +498,13 @@ where c.nid = n.id and c.id in %s group by nid""" % ids2str(cids)):
|
|||||||
if type == "q":
|
if type == "q":
|
||||||
format = format.replace("{{cloze:", "{{cq:%d:" % (
|
format = format.replace("{{cloze:", "{{cq:%d:" % (
|
||||||
data[4]+1))
|
data[4]+1))
|
||||||
|
format = format.replace("<%cloze:", "<%%cq:%d:" % (
|
||||||
|
data[4]+1))
|
||||||
else:
|
else:
|
||||||
format = format.replace("{{cloze:", "{{ca:%d:" % (
|
format = format.replace("{{cloze:", "{{ca:%d:" % (
|
||||||
data[4]+1))
|
data[4]+1))
|
||||||
|
format = format.replace("<%cloze:", "<%%ca:%d:" % (
|
||||||
|
data[4]+1))
|
||||||
fields['FrontSide'] = stripSounds(d['q'])
|
fields['FrontSide'] = stripSounds(d['q'])
|
||||||
fields = runFilter("mungeFields", fields, model, data, self)
|
fields = runFilter("mungeFields", fields, model, data, self)
|
||||||
html = anki.template.render(format, fields)
|
html = anki.template.render(format, fields)
|
||||||
|
@ -549,7 +549,9 @@ select id from notes where mid = ?)""" % " ".join(map),
|
|||||||
sflds = splitFields(flds)
|
sflds = splitFields(flds)
|
||||||
map = self.fieldMap(m)
|
map = self.fieldMap(m)
|
||||||
ords = set()
|
ords = set()
|
||||||
for fname in re.findall("{{cloze:(.+?)}}", m['tmpls'][0]['qfmt']):
|
matches = re.findall("{{cloze:(.+?)}}", m['tmpls'][0]['qfmt'])
|
||||||
|
matches += re.findall("<%cloze:(.+?)%>", m['tmpls'][0]['qfmt'])
|
||||||
|
for fname in matches:
|
||||||
if fname not in map:
|
if fname not in map:
|
||||||
continue
|
continue
|
||||||
ord = map[fname][0]
|
ord = map[fname][0]
|
||||||
|
@ -28,7 +28,7 @@ Matthew Duggan, Matthew Holtz, Meelis Vasser, Michael Keppler, Michael
|
|||||||
Montague, Michael Penkov, Michal Čadil, Nathanael Law, Nick Cook, Niklas
|
Montague, Michael Penkov, Michal Čadil, Nathanael Law, Nick Cook, Niklas
|
||||||
Laxström, Nguyễn Hào Khôi, Norbert Nagold, Ole Guldberg,
|
Laxström, Nguyễn Hào Khôi, Norbert Nagold, Ole Guldberg,
|
||||||
Pcsl88, Petr Michalec, Piotr Kubowicz, Richard Colley, Roland Sieker,
|
Pcsl88, Petr Michalec, Piotr Kubowicz, Richard Colley, Roland Sieker,
|
||||||
Samson Melamed, Stefaan De Pooter, Susanna Björverud, Sylvain Durand,
|
Samson Melamed, Stefaan De Pooter, Silja Ijas, Susanna Björverud, Sylvain Durand,
|
||||||
Tacutu, Timm Preetz, Timo Paulssen, Ursus, Victor Suba, %s
|
Tacutu, Timm Preetz, Timo Paulssen, Ursus, Victor Suba, %s
|
||||||
Xtru."""% _("<!--about diag--> and")}
|
Xtru."""% _("<!--about diag--> and")}
|
||||||
abouttext += '<p>' + _("""\
|
abouttext += '<p>' + _("""\
|
||||||
|
Loading…
Reference in New Issue
Block a user