[wp-trac] Re: [WordPress Trac] #7988: wpautop p (paragraph) bug with div

WordPress Trac wp-trac at lists.automattic.com
Tue Oct 28 19:26:00 GMT 2008


#7988: wpautop p (paragraph) bug with div
--------------------------------------------+-------------------------------
 Reporter:  filosofo                        |        Owner:  anonymous
     Type:  defect                          |       Status:  new      
 Priority:  normal                          |    Milestone:  2.7      
Component:  General                         |      Version:  2.7      
 Severity:  normal                          |   Resolution:           
 Keywords:  wpautop p formatting has-patch  |  
--------------------------------------------+-------------------------------
Comment (by azaozz):

 I think there are more borderline problems with the original regexp. What
 it says is if there is a <p> followed by anything but less-than bracket
 (which may or may not be the opening bracket of a HTML tag), followed by
 zero or more space chars (not needed since the `([^<]+)` will match all
 space chars), followed by </div>, </address> or </form>, the <p> is
 considered orphaned.

 What is should say is: if a <p> tag is followed by at least one non-space
 char, followed by </div>, </address> or </form> and doesn't have </p>
 before the </div>, </address> or </form> (ignoring spaces/line breaks),
 the <p> is orphaned.

 It probably should look for </div>, </address> or </form>, then look
 behind if the last tag before them was <p> and if yes, close the <p>.

 Also, not sure what the next line in autop is for:

 {{{
 $pee = preg_replace( '|<p>|', "$1<p>", $pee );
 }}}

 Doesn't seem to do anything.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/7988#comment:4>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list