cloze is blank if no match

This commit is contained in:
Damien Elmes 2012-07-05 19:49:40 +09:00
parent 57a9668350
commit 35a498b858

View file

@ -196,6 +196,8 @@ class Template(object):
def clozeText(self, txt, ord, type): def clozeText(self, txt, ord, type):
reg = clozeReg reg = clozeReg
if not re.search(reg%ord, txt):
return ""
def repl(m): def repl(m):
# replace chosen cloze with type # replace chosen cloze with type
if type == "q": if type == "q":