How to replace a string with linebreaks in Jinja2 [duplicate] How to replace a string with linebreaks in Jinja2 [duplicate] flask flask

How to replace a string with linebreaks in Jinja2 [duplicate]


This has to do with autoescaping. Solution that worked for me was:

{% autoescape false %}  {{ 'item1|item2|item3' | replace("|", "<br/>") }}{% endautoescape %}