From 1203775aef0d3de0d50d62fe21f5415fb9fcaa10 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Tue, 29 Jan 2013 09:14:28 +0900 Subject: [PATCH] ignore html in conditional tags --- anki/template/template.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/anki/template/template.py b/anki/template/template.py index 75558f2e2..68a8e3f60 100644 --- a/anki/template/template.py +++ b/anki/template/template.py @@ -1,5 +1,5 @@ import re -from anki.utils import stripHTML +from anki.utils import stripHTML, stripHTMLMedia from anki.hooks import runFilter from anki.template import furigana; furigana.install() from anki.template import hint; hint.install() @@ -99,6 +99,8 @@ class Template(object): replacer = '' # if it and isinstance(it, collections.Callable): # replacer = it(inner) + if isinstance(it, basestring): + it = stripHTMLMedia(it).strip() if it and not hasattr(it, '__iter__'): if section[2] != '^': replacer = inner