mirror of
https://github.com/ankitects/anki.git
synced 2025-09-25 17:26:36 -04:00
handle invalid field mod regex
This commit is contained in:
parent
b06b2f26f0
commit
21108650fc
1 changed files with 4 additions and 1 deletions
|
@ -184,7 +184,10 @@ class Template:
|
||||||
txt = self.clozeText(txt, extra, mod[1]) if txt and extra else ""
|
txt = self.clozeText(txt, extra, mod[1]) if txt and extra else ""
|
||||||
else:
|
else:
|
||||||
# hook-based field modifier
|
# hook-based field modifier
|
||||||
mod, extra = re.search(r"^(.*?)(?:\((.*)\))?$", mod).groups()
|
m = re.search(r"^(.*?)(?:\((.*)\))?$", mod)
|
||||||
|
if not m:
|
||||||
|
return 'invalid field modifier ' + mod
|
||||||
|
mod, extra = m.groups()
|
||||||
txt = runFilter('fmod_' + mod, txt or '', extra or '', context,
|
txt = runFilter('fmod_' + mod, txt or '', extra or '', context,
|
||||||
tag, tag_name)
|
tag, tag_name)
|
||||||
if txt is None:
|
if txt is None:
|
||||||
|
|
Loading…
Reference in a new issue