Jacinto
Jacinto

Reputation: 180

django remove line break from textarea python

i have a text area tha is tinymce application that devolve the text introduce in html. so if i introduce this: I, this is an example. that i recive,<p> I, this is an example.</p> in my view i remove the html tags, and if the tag are "p" than replace for an\n. result:I, this is an example.\n but if i introduce this:

I,

this is an example.

this return:

<p> I,</p>
<p>this is an example.</p>

result:

I,\n
this is an example.\n

I want to remove the line break, so the result are:I,\n this is an example.\n

Upvotes: 0

Views: 809

Answers (1)

Hoff
Hoff

Reputation: 39866

I would recommend fixing the <p> tag issue on the client side, as you can configure tinymce not to use <p> tags at all:

tinyMCE.init({
        ...
        forced_root_block : false
});

http://www.tinymce.com/wiki.php/Configuration:forced_root_block

Upvotes: 1

Related Questions