[英]django remove line break from textarea python
我有一個文本區域,tha是tinymce應用程序 ,它分解了在html中引入的文本。 所以如果我介紹這個:我,這是一個例子。 我會說<p> I, this is an example.</p>
在我看來,我刪除了html標簽,並且如果標簽為“ p
”,則替換為\\n
。 結果: I, this is an example.\\n
但是如果我介紹這個:
一世,
這是一個例子。
這個回報:
<p> I,</p>
<p>this is an example.</p>
結果:
I,\n
this is an example.\n
我想刪除換行符,所以結果是:I,\\ n這是一個示例。\\ n
我建議在客戶端修復<p>
標記問題,因為您可以配置tinymce根本不使用<p>
標記:
tinyMCE.init({
...
forced_root_block : false
});
http://www.tinymce.com/wiki.php/Configuration:forced_root_block
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.