@register.filter()
def oneline(value):
 return value.replace('\n', ' ')

@ register . filter ( ) def oneline ( value ) : return value . replace ( '\n' , ' ' )
replace each line break with a single space .