I love wpautop. It deals with post formatting very well 99% of the time. For me, the 1% time it’s not working properly is when it’s handling HTML comments.
In case you’re wondering why the hell do I need to put HTML comments in posts; well it’s for things such as embedding AdSense Deluxe content. It may also be useful for Section Targeting, but I don’t use it.
The problem is that wpautop wrap comments in a paragraph tag (<p>). Why it does that is beyond me. Anyway, my fix is to add the following lines in the wpautop function codes in formatting.php just before the line that says return $pee;;
$pee = str_replace("<p><!--", "<!--", $pee);
$pee = str_replace("--></p>", "-->", $pee);
formatting.php is inside the wp-includes directory of your WP installation in case you’re wondering
Anybody know why this isn’t already in wpautop?










April 18th, 2007 at 1:57 pm
wow… maybe my blog need this. sure deep one esp. for me
April 8th, 2008 at 3:46 am
xD