[wp-hackers] p inside blockquote

Scot Hacker shacker at birdhouse.org
Thu Mar 1 04:37:53 GMT 2007

If you use a <blockquote ... /> in a post,  autop in 2.1.1 will nest  
the quoted content inside a <p> tag within the blockquote. I think  
this is happening in wp-include/formatting.php:

$pee = preg_replace('|<p><blockquote([^>]*)>|i', "<blockquote$1><p>",  
$pee = str_replace('</blockquote></p>', '</p></blockquote>', $pee);

There is no XHTML rule that says this should happen. Create a test  
document with a blockquote, without the inner p, and validate it.  
It's fine. Both p and blockquote are block-level HTML elements. Why  
nest one inside the other? This behavior is breaking CSS designs that  
put a vertical rule to the left of a blockquote - suddenly the  
vertical rule is extending above and below the quoted text.

It seems like someone must have added this behavior intentionally,   
but why? I think lines 70&71 in formatting.php should be canned. Or  
is there something I'm not understanding here?


More information about the wp-hackers mailing list