mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
Chained modifiers are processed from innermost to outermost (i.e. rtl). Except cloze/type.
This commit is contained in:
parent
37753b1ffd
commit
fb1a255358
1 changed files with 2 additions and 1 deletions
|
@ -167,10 +167,11 @@ class Template(object):
|
||||||
|
|
||||||
txt = get_or_attr(context, tag)
|
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
|
#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
|
#treated after all the other mods, regardless of how they're specified
|
||||||
#in the template, so that {{cloze:text: == {{text:cloze:
|
#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")
|
mods.sort(key=lambda s: s.startswith("cq-") or s.startswith("ca-") or s=="type")
|
||||||
|
|
||||||
for mod in mods:
|
for mod in mods:
|
||||||
|
|
Loading…
Reference in a new issue