tags:

views:

20

answers:

1

When i editing some content using tinymce editor an unwanted empty <p> </p> is saving at beginning and ending of the content. How i can remove this thanks in advance

A: 

One way would be to change the code that returns HTML to first check the DOM of the editable area and if there is a wrapping P with no style or id or other attribute, then move all content of the P tag to the root and remove the P tag.

I have not tested this but I am investigating this for another editor we use for the exact same problem.

David Mårtensson
is their any other way
THOmas
Well, you have to make sure that the start P and end P in the HTML block are the same. Because you could have <p>jshdjshd</p><p>jhsdjshd</p> and in that case you do not want to remove the first and last P. Doing it from the htmlsource makes this much more difficult to parse.
David Mårtensson