开发者

tinymce wysiwyg editor is giving extra line in html

开发者 https://www.devze.com 2023-03-24 00:29 出处:网络
I am using tinymce wysiwyg editor in my Application. I save my tinymce o/p in my database, but when i retrieve it in my html page it is adding blank extra line that i don\'t want.

I am using tinymce wysiwyg editor in my Application. I save my tinymce o/p in my database, but when i retrieve it in my html page it is adding blank extra line that i don't want.

For Ex:- when i am giving following i/p in my editor

Hi,
This is a test message.

Thanks,
Salil

Is looking like following in my html page

Hi,
                      ########This is blank extra line that i don't want
This is a test message.

                      ########This is blank extra line that i don't want
Thanks,
                      ########This is blank extra line that i don't want
Salil

and It is generating following html in my database

<p>Hi, &nbsp;</p>
<p>This is marketing mail.</p>
<p>&nbsp;</p>
<p>Thanks,</p>
<p>Salil</p>
开发者_如何学JAVA

Any help is appreciated.

Note :- I tried (add/remove both) p {margin:0; padding: 0;} but it is not working for me.


Issue is fixed after adding following lines in tinyMCE.init({ });

 force_p_newlines : false,
 force_br_newlines : false,
 forced_root_block : false,
 convert_newlines_to_brs: false,
 // Not to add br elements.
 remove_linebreaks : true, 
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号