mirror of
https://github.com/ankitects/anki.git
synced 2025-11-25 22:17:12 -05:00
move filter reversal into pystache
This commit is contained in:
parent
b014822253
commit
031c4e814f
2 changed files with 2 additions and 3 deletions
|
|
@ -141,6 +141,8 @@ class Template:
|
||||||
if txt is None:
|
if txt is None:
|
||||||
return "{unknown field %s}" % tag_name
|
return "{unknown field %s}" % tag_name
|
||||||
|
|
||||||
|
# the filter closest to the field name is applied first
|
||||||
|
mods.reverse()
|
||||||
return apply_field_filters(tag, txt, context, mods)
|
return apply_field_filters(tag, txt, context, mods)
|
||||||
|
|
||||||
@modifier("=")
|
@modifier("=")
|
||||||
|
|
|
||||||
|
|
@ -80,9 +80,6 @@ def apply_field_filters(
|
||||||
|
|
||||||
def _sort_filters(filters: List[str]):
|
def _sort_filters(filters: List[str]):
|
||||||
"Mutate the list of filters into the correct order."
|
"Mutate the list of filters into the correct order."
|
||||||
|
|
||||||
# the filter closest to the field name is applied first
|
|
||||||
filters.reverse()
|
|
||||||
# Since 'text:' and other mods can affect html on which Anki relies to
|
# Since 'text:' and other mods can affect html on which Anki relies to
|
||||||
# process clozes, we need to make sure clozes are always
|
# process clozes, we need to make sure clozes 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
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue