Allowing
tags with Google App Engine and Jinja2

后端 未结 8 1752
粉色の甜心
粉色の甜心 2021-01-04 22:11

In my web app, the user can make blog posts. When I display the blog post, newlines aren\'t shown because I didn\'t replace the new lines with
tags.

8条回答
  •  忘掉有多难
    2021-01-04 22:33

    The easiest way to do this is to escape the field yourself, then add line breaks. When you pass it in in jinja, mark it as safe so it's not autoescaped.

提交回复
热议问题