diff --git a/anki/template/template.py b/anki/template/template.py index d2f055c61..33bfd6ea8 100644 --- a/anki/template/template.py +++ b/anki/template/template.py @@ -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: diff --git a/aqt/editor.py b/aqt/editor.py index ce76ebe3f..755bfbd7e 100644 --- a/aqt/editor.py +++ b/aqt/editor.py @@ -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."))