@register.filter
def nl2br(string):
    if not string:
        return ''
    return jinja2.Markup('<br>'.join(jinja2.escape(string).splitlines()))
Turn newlines into <br>.
dataset/ETHPy150Open jbalogh/jingo/jingo/helpers.py/nl2br