def nl2br(eval_ctx, value):
    result = '\n\n'.join('<p>%s</p>' % p.replace('\n', '<br>\n') for p in
        _paragraph_re.split(escape(value)))
How to apply django/jinja2 template filters 'escape' and 'linebreaks' correctly?