From fb1a255358f13db94fb7f168d23825ff8ec71709 Mon Sep 17 00:00:00 2001 From: Julien Baley Date: Wed, 19 Feb 2014 07:32:04 +0000 Subject: [PATCH] Chained modifiers are processed from innermost to outermost (i.e. rtl). Except cloze/type. --- anki/template/template.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/anki/template/template.py b/anki/template/template.py index 7a091d91d..828c042ca 100644 --- a/anki/template/template.py +++ b/anki/template/template.py @@ -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: