@jingo.register.filter
def nl2br_xhtml(string):
 if (not string):
  return ''
 return jinja2.Markup('<br/>'.join(jinja2.escape(string).splitlines()))

@ jingo . register . filter def nl2br_xhtml ( string ) : if ( not string ) : return '' return jinja2 . Markup ( '<br/>' . join ( jinja2 . escape ( string ) . splitlines ( ) ) )
turn newlines into <br/> .