mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
{{{text}}} is returned without field formatting but html intact
This commit is contained in:
parent
da1cfa52b1
commit
dfb21a0f71
1 changed files with 1 additions and 2 deletions
|
@ -120,13 +120,12 @@ class Template(object):
|
||||||
return template
|
return template
|
||||||
|
|
||||||
@modifier('{')
|
@modifier('{')
|
||||||
@modifier('&')
|
|
||||||
def render_tag(self, tag_name, context):
|
def render_tag(self, tag_name, context):
|
||||||
"""Given a tag name and context, finds, escapes, and renders the tag."""
|
"""Given a tag name and context, finds, escapes, and renders the tag."""
|
||||||
raw = get_or_attr(context, tag_name, '')
|
raw = get_or_attr(context, tag_name, '')
|
||||||
if not raw and raw is not 0:
|
if not raw and raw is not 0:
|
||||||
return ''
|
return ''
|
||||||
return cgi.escape(unicode(raw))
|
return re.sub("^<span.+?>(.*)</span>", "\\1", raw)
|
||||||
|
|
||||||
@modifier('!')
|
@modifier('!')
|
||||||
def render_comment(self, tag_name=None, context=None):
|
def render_comment(self, tag_name=None, context=None):
|
||||||
|
|
Loading…
Reference in a new issue