I'm looking for a Django template filter that turns a multi-line construction into one big line. Has anyone implemented it? The reason is - I have a form, {{form.as_p}} creates a multi-line html fragment, I want to create a javascript variable which is an html fragment, but when I do like this:
var new_div_text = '{{form.as_p}}';
it doesn't work. The reason is obvious, in javascript constructions like
var hello = 'Hello
world';
are invalid!