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 <br> tags. The problem is that I’ve turned autoescaping on in Jinja, so <br> tags are escaped. I don’t want to temporarily disable autoescaping, I want to specifically allow <br> tags. How would I do this?
In my web app, the user can make blog posts. When I display the
Share
I have another answer that I think is the best. Initially I was just displaying my variable
post.contentas-is, and the newlines weren’t being preserved. None of the solutions here worked (well), and my pre solution was just a quick fix and had major issues. This is the real solution: