【发布时间】:2017-07-31 10:00:25
【问题描述】:
我有烧瓶、jinja2 和 python。
所以,我正在尝试显示存储为降价的文本。
我这样做
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* 我的浏览器中有<p><em>im busy</em></p>。
我尝试使用.replace('&lt;', '<').replace('&gt;', '>'),但它没有任何改变。
【问题讨论】:
-
@metatoaster 是的。谢谢。
-
@metatoaster 你能把“这个问题可能已经……”替换为你的链接,这样我就可以在正确的链接上按“解决了我的问题”吗?