0

i am using tiny_mce as a text editor for my CMS.
buy now the problem is it add <p> tag with data

so while retrieving the data for front end i get an extra space. so there is any why that i can remove <p> </p> from first paragraph.

i tried using strip_tags()... but it strip all the others tag like <br> etc etc..

2
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by shahzad429
0

I think rather than remove the tags manually, you should either tell tinymce not to put them there:

tinyMCE.init({
   forced_root_block : false,
   force_br_newlines : true,
   force_p_newlines : false
});

Or set the paragraph margins and padding to 0:

p {margin:0; padding: 0;}

Check out what they have to say about it.

0

But if you really want to strip those tags, you could try:

str_replace("</p>","<br />",str_replace("<p>", "", "YourString"));

Might be a better way but that should work.

0

Thanks Mate....

I think rather than remove the tags manually, you should either tell tinymce not to put them there:

tinyMCE.init({
   forced_root_block : false,
   force_br_newlines : true,
   force_p_newlines : false
});

Or set the paragraph margins and padding to 0:

p {margin:0; padding: 0;}

Check out what they have to say about it.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.