mirror of
https://github.com/ankitects/anki.git
synced 2025-09-23 08:22:24 -04:00
fix new-style template replacement; support cond rendering
This commit is contained in:
parent
cdcde2f2d3
commit
149fbee33e
1 changed files with 6 additions and 3 deletions
|
@ -1815,9 +1815,12 @@ update facts set modified = :t where modelId = :mid"""
|
||||||
for cm in model.cardModels:
|
for cm in model.cardModels:
|
||||||
types = ("%%(%s)s",
|
types = ("%%(%s)s",
|
||||||
"%%(text:%s)s",
|
"%%(text:%s)s",
|
||||||
# new style
|
# new styles
|
||||||
"<<%s>>",
|
"{{%s}}",
|
||||||
"<<text:%s>>")
|
"{{text:%s}}",
|
||||||
|
"{{# %s}}",
|
||||||
|
"{{^ %s}}",
|
||||||
|
"{{/ %s}}")
|
||||||
for t in types:
|
for t in types:
|
||||||
for fmt in ('qformat', 'aformat'):
|
for fmt in ('qformat', 'aformat'):
|
||||||
setattr(cm, fmt, getattr(cm, fmt).replace(t%field.name,
|
setattr(cm, fmt, getattr(cm, fmt).replace(t%field.name,
|
||||||
|
|
Loading…
Reference in a new issue