i’m using pyramid to display a multiline text. such as:
txt="""
abc
def
"""
html render(such as jinja2) does not have paragraph tag
so i add paragraph tag to txt, but finally, it render with escape
<p> abc </p> ...
so how to correctly display the multiline?
It’s ambiguous whether you have autoescaping set to true or not, but if that is the case, then when rendering, make sure you add ” | safe”.
ie: {{post.render | safe }}
More information on escaping can be found here: http://jinja.pocoo.org/docs/templates/#html-escaping