[wp-trac] [WordPress Trac] #3669: Missing close </p> tag in wpautop

WordPress Trac wp-trac at lists.automattic.com
Thu Jan 25 05:48:54 GMT 2007


#3669: Missing close </p> tag in wpautop
----------------------+-----------------------------------------------------
 Reporter:  scenic    |       Owner:  anonymous    
     Type:  defect    |      Status:  new          
 Priority:  low       |   Milestone:  2.1.1        
Component:  Template  |     Version:               
 Severity:  normal    |    Keywords:  wpautop xhtml
----------------------+-----------------------------------------------------
 wpautop seems to change <p><div></div></p> to <div><p></div>
 (note the lack of a closing </p> in the second).  This broke XHTML
 compliance in some text appended by a custom plugin of mine, but I'm
 guessing it would affect any div's I put in via the edit page.

 I've attached the patch, but the short version of the fix is adding
 this line below after line 66 in wp-includes/formatting.php.

 $pee = preg_replace( '|(</div[^>]*>\s*)</p>|', "</p>$1", $pee );

-- 
Ticket URL: <http://trac.wordpress.org/ticket/3669>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list