fixing crazy <p>eeing
-
so far i’ve hacked my brain to no avail. my beautiful xhtml 1.0 validation had gone to hell with crazy contructions such as
s and even
s (???)
i’ve commented out the wautop (??) filter, to no avail, so i’ve come up with a hack and my blog is back to xhtml 1.0 heaven.
so if you’re also dealing with this, try this snipet on your hack file and it should pull the trick:
function hack_fix_para ($str){
$str = preg_replace ("#()<(table|thead|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|p|h[1-6])>(</?p>)?#msi", "<$2>", $str);
$str = preg_replace ("#(</?p>)?</(table|thead|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|p|h[1-6])>()#msi", "</$2>", $str);
return $str;
}
add_filter('the_content', 'hack_fix_para');
- The topic ‘fixing crazy <p>eeing’ is closed to new replies.