Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/79.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 如何使用Jinja2避免自动转义HTML标记_Python_Html_Jinja2 - Fatal编程技术网

Python 如何使用Jinja2避免自动转义HTML标记

Python 如何使用Jinja2避免自动转义HTML标记,python,html,jinja2,Python,Html,Jinja2,我有烧瓶、金杯2和蟒蛇。 因此,我试图显示存储为标记的文本。 我这样做 class Article(db.Entity): ... def html(self): return markdown(self.text) # from markdown import markdown 在我看来,接下来我会这样做 html_text = article_.html() return render_template('article.html', article=ar

我有烧瓶、金杯2和蟒蛇。
因此,我试图显示存储为标记的文本。
我这样做

class Article(db.Entity):
...

    def html(self):
        return markdown(self.text) # from markdown import markdown
在我看来,接下来我会这样做

html_text = article_.html()    
return render_template('article.html', article=article_, comments=comments, user=user, text=html_text)
在article.html中,我只有这一行

{{text}}
因此,由于数据库中存储的数据为
*im busy*
,我的浏览器中有
im busy


我尝试使用
.replace(“”,)
,但它没有改变任何东西
你知道安全过滤器吗

{{text|safe}}

它的可能复制品不止这一个:@metatoaster是的。谢谢。@metatoaster你能替换“这个问题可能已经…”作为你的链接吗?这样我就可以在正确的链接上按“解决了我的问题”?