From 66534db987323e35aebd52552e998d488b697860 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Wed, 7 Mar 2012 03:27:04 +0900 Subject: [PATCH] make the cloze hint a prefix --- anki/template/template.py | 2 +- tests/test_models.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/anki/template/template.py b/anki/template/template.py index b3efc6042..0486d15fb 100644 --- a/anki/template/template.py +++ b/anki/template/template.py @@ -200,7 +200,7 @@ class Template(object): # replace chosen cloze with type if type == "q": if m.group(2): - txt = re.sub(reg%ord, "[...\\3]", txt) + txt = re.sub(reg%ord, "[\\3...]", txt) else: txt = re.sub(reg%ord, "[...]", txt) elif type == "a": diff --git a/tests/test_models.py b/tests/test_models.py index 24a756bcf..7269afc10 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -132,7 +132,7 @@ def test_cloze(): f = d.newNote() f['Text'] = "hello {{c1::world::typical}}" assert d.addNote(f) == 1 - assert "[...typical]" in f.cards()[0].q() + assert "[typical...]" in f.cards()[0].q() assert "world" in f.cards()[0].a() # and with 2 clozes f = d.newNote()