Page 1 of 1

Get rid of <p>

PostPosted: Sun Jul 25, 2010 6:51 am
by averagejoe25
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>



Re: Get rid of <p>

PostPosted: Mon Jul 26, 2010 7:59 pm
by mr_lundis
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! ;)

Re: Get rid of <p>

PostPosted: Wed Aug 11, 2010 4:38 pm
by tilzinger
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.