make the cloze hint a prefix

This commit is contained in:
Damien Elmes 2012-03-07 03:27:04 +09:00
parent d60a3f8e25
commit 66534db987
2 changed files with 2 additions and 2 deletions

View file

@ -200,7 +200,7 @@ class Template(object):
# replace chosen cloze with type
if type == "q":
if m.group(2):
txt = re.sub(reg%ord, "<span class=cloze>[...\\3]</span>", txt)
txt = re.sub(reg%ord, "<span class=cloze>[\\3...]</span>", txt)
else:
txt = re.sub(reg%ord, "<span class=cloze>[...]</span>", txt)
elif type == "a":

View file

@ -132,7 +132,7 @@ def test_cloze():
f = d.newNote()
f['Text'] = "hello {{c1::world::typical}}"
assert d.addNote(f) == 1
assert "<span class=cloze>[...typical]</span>" in f.cards()[0].q()
assert "<span class=cloze>[typical...]</span>" in f.cards()[0].q()
assert "<span class=cloze>world</span>" in f.cards()[0].a()
# and with 2 clozes
f = d.newNote()