use the first hint occurrence for any subsequent clozes

This commit is contained in:
Damien Elmes 2012-03-22 15:51:36 +09:00
parent 47a61abebb
commit 933bee43a0

View file

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