Salil
Salil

Reputation: 47482

tinymce wysiwyg editor is giving extra line in html

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>

Any help is appreciated.

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

Upvotes: 4

Views: 1507

Answers (1)

Salil
Salil

Reputation: 47482

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, 

Upvotes: 3

Related Questions