From 05a68488e7cc27c330d81a9768f37eb19294616f Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Tue, 15 Jan 2013 08:28:39 +0900 Subject: [PATCH] add automatic
back to field references {{Front}} {{Back}} will now automatically add a
to the first field reference, like previous Anki versions did. The
is too complicated for users who just want a plain template without any HTML. --- anki/collection.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/anki/collection.py b/anki/collection.py index e0c1497e4..69860744e 100644 --- a/anki/collection.py +++ b/anki/collection.py @@ -492,8 +492,8 @@ where c.nid = n.id and c.id in %s group by nid""" % ids2str(cids)): fields['c%d' % (data[4]+1)] = "1" # render q & a d = dict(id=data[0]) - qfmt = qfmt or template['qfmt'] - afmt = afmt or template['afmt'] + qfmt = (qfmt or template['qfmt']).replace("}}\n", "}}
") + afmt = (afmt or template['afmt']).replace("}}\n", "}}
") for (type, format) in (("q", qfmt), ("a", afmt)): if type == "q": format = format.replace("{{cloze:", "{{cq:%d:" % (