Intended blockquote tag behavior?
-
I’m importing 100’s of blog posts to a new site, and many start the content with a lead-in using
<blockquote>...</blockquote>
tags.I’m experiencing an issue which I’ve reduced to this as the simplest Post content case:
<blockquote>This is inside the blockquote</blockquote> And this should be outside!
The expected html output using a template that only outputs clean
the_content()
would be something like:<div id="post-3061"> <h2>Test Blockquote</h2> <div><p><blockquote>This is inside the blockquote</blockquote><p> And this should be outside! </p></p> </div></div>
i.e. displaying only the first text section wrapped in blockquote tags. But the actual output is:
<div id="post-3061"> <h2>Test Blockquote</h2> <div><blockquote>This is inside the blockquote<p> And this should be outside! </p></blockquote> </div> </div>
i.e. the complete content gets output before the closing blockquote is output.
It appears this can be fixed by adding this filter:
function gwc_fix_blockquote( $content ){ $needle = '<blockquote>'; if ( substr($content, 0, strlen($needle)) === $needle ){ return '<p></p>' . $content; } return $content; } add_filter( 'the_content', 'gwc_fix_blockquote' );
-prepending an empty <p> tag to the actual post content.
Note that wpautop is disabled in this install.
I have a suspicion this is related to code in wp-includes/formatting.php, but I have not dug too deeply, since I have a workaround.Am I missing something? Or is this intended behavior?
Thanks
- The topic ‘Intended blockquote tag behavior?’ is closed to new replies.