[wp-hackers] wpautop should first check if p tags, and if so, don't autop

Sam Bauers sam at viveka.net.au
Sat Aug 25 04:23:39 GMT 2007


I've just finished writing a routine with similar functionality to  
wpautop(). It deals with this specific problem quite elegantly. e.g.

<p class="something">
One

Two

Three
</p>

Becomes:

<p class="something">
One
</p>

<p class="something">
Two
</p>

<p class="something">
Three
</p>

I was considering wrapping it up into a little proof of concept  
plugin for WordPress so it could be assessed as a potential  
replacement. But the final formatting is slightly different (dare I  
say cleaner), so the functions that reverse the process would also  
have to be adapted. Plus, from memory WordPress has a Javascript  
version of wpautop() as well, and I'm not sure how I would replicate  
that functionality.

Sam

On 25/08/2007, at 12:12 PM, Rob Miller wrote:

> Stephen Rider wrote:
>> This would be very bad for me.  I quite often have certain  
>> paragraphs to which I want to apply a class, so I wrap it in <p>  
>> tags with the class.  The rest of the text I want autoformatted.
>>
>>
> Same here, and I should imagine the same is true of many users.

--------------------------------------------------------------
  Sam Bauers

  sam at viveka.net.au
--------------------------------------------------------------





More information about the wp-hackers mailing list