Merge branch 'master' of github.com:dae/anki

This commit is contained in:
Damien Elmes 2014-03-20 08:00:48 +09:00
commit c4c031d680
2 changed files with 2 additions and 1 deletions

View file

@ -191,6 +191,7 @@ class Template(object):
txt = self.clozeText(txt, extra, mod[1]) if txt and extra else ""
else:
# hook-based field modifier
mod, extra = re.search("^(.*?)(?:\((.*)\))?$", mod).groups()
txt = runFilter('fmod_' + mod, txt or '', extra, context,
tag, tag_name);
if txt is None:

View file

@ -690,7 +690,7 @@ class Editor(object):
def onCloze(self):
# check that the model is set up for cloze deletion
if '{{cloze:' not in self.note.model()['tmpls'][0]['qfmt']:
if not re.search('{{(.*:)*cloze:',self.note.model()['tmpls'][0]['qfmt']):
if self.addMode:
tooltip(_("Warning, cloze deletions will not work until "
"you switch the type at the top to Cloze."))