Chained modifiers are processed from innermost to outermost (i.e. rtl). Except cloze/type.

This commit is contained in:
Julien Baley 2014-02-19 07:32:04 +00:00
parent 37753b1ffd
commit fb1a255358

View file

@ -167,10 +167,11 @@ class Template(object):
txt = get_or_attr(context, tag)
#Since 'text:' and oths mods can affect html on which Anki relies to
#Since 'text:' and other mods can affect html on which Anki relies to
#process Clozes and Types, we need to make sure cloze/type are always
#treated after all the other mods, regardless of how they're specified
#in the template, so that {{cloze:text: == {{text:cloze:
mods.reverse()
mods.sort(key=lambda s: s.startswith("cq-") or s.startswith("ca-") or s=="type")
for mod in mods: