Forum closed. New forum available at

Get rid of <p>

Support forum for WYMeditor.

Get rid of <p>

Postby averagejoe25 on Sun Jul 25, 2010 6:51 am

I want to pull my hair out. I've scoured every line and can't find where <p> and </p> are being added to the text when being inserted into the database. Can someone please tell me how to only have the text it's self inserted rather than <p>text</p>


Posts: 1
Joined: Sun Jul 25, 2010 6:48 am

Re: Get rid of <p>

Postby mr_lundis on Mon Jul 26, 2010 7:59 pm

Hi Casey!
The editor wraps "orphaned" text nodes in paragraphs on keyUp. The whole editor is more or less centred around the idea of "forcing good markup" -- your mileage may vary if you break this behaviour. So, do you need to change it? If you really need to, you can always filter out the p-tags with some regular expressions, search and replace, xslt, or whatever you prefer. I'd recommend post-processing over modifying the editor itself, as you could easily run in to all kinds of crazy bugs.

Cheers! ;)
Jonatan Lundin - designer, developer and forum moderator. You should follow me on Twitter!
Posts: 335
Joined: Sun Dec 02, 2007 10:59 am
Location: Sweden

Re: Get rid of <p>

Postby tilzinger on Wed Aug 11, 2010 4:38 pm

Attached is a plugin I wrote that takes images out of <p> tags so they float on their own. There is some other stuff in there not necessary for your needs, but it gives you an idea on how to do it.
(5.27 KiB) Downloaded 524 times
Posts: 10
Joined: Fri Mar 26, 2010 7:36 pm

Return to Support

Who is online

Users browsing this forum: No registered users and 1 guest