mirror of
https://github.com/ankitects/anki.git
synced 2025-09-23 00:12:25 -04:00
ignore html in conditional tags
This commit is contained in:
parent
073f129ab8
commit
1203775aef
1 changed files with 3 additions and 1 deletions
|
@ -1,5 +1,5 @@
|
||||||
import re
|
import re
|
||||||
from anki.utils import stripHTML
|
from anki.utils import stripHTML, stripHTMLMedia
|
||||||
from anki.hooks import runFilter
|
from anki.hooks import runFilter
|
||||||
from anki.template import furigana; furigana.install()
|
from anki.template import furigana; furigana.install()
|
||||||
from anki.template import hint; hint.install()
|
from anki.template import hint; hint.install()
|
||||||
|
@ -99,6 +99,8 @@ class Template(object):
|
||||||
replacer = ''
|
replacer = ''
|
||||||
# if it and isinstance(it, collections.Callable):
|
# if it and isinstance(it, collections.Callable):
|
||||||
# replacer = it(inner)
|
# replacer = it(inner)
|
||||||
|
if isinstance(it, basestring):
|
||||||
|
it = stripHTMLMedia(it).strip()
|
||||||
if it and not hasattr(it, '__iter__'):
|
if it and not hasattr(it, '__iter__'):
|
||||||
if section[2] != '^':
|
if section[2] != '^':
|
||||||
replacer = inner
|
replacer = inner
|
||||||
|
|
Loading…
Reference in a new issue