[wp-testers] Several XHTML formatting bugs in 2.1

Sujal Shah codesujal at gmail.com
Thu Jan 25 04:36:21 GMT 2007


I wanted to send these to the list before I submitted a ticket.  I
checked trac but didn't see anything reported that matched (#3647 is
close).

First, wpautop seems to change <p><div></div></p> to <div><p></div>
(note the lack of a closing </p> in the second).  This broke XHTML
compliance in some text appended by a custom plugin of mine, but I'm
guessing it would affect any div's I put in via the edit page.

I've attached the patch, but the short version of the fix is adding
this line below after line 66 in wp-includes/formatting.php.

$pee = preg_replace( '|(</div[^>]*>\s*)</p>|', "</p>$1", $pee );

Also, a similar issue has plagued all versions of WP since 1.5.  I'm
not sure if this is a bug per se, but it breaks included JS in my
posts that are escaped with a CDATA section.  I've basically commented
out the following line in the_content() every time I upgrade:

//$content = str_replace(']]>', ']]&gt;', $content);

Why does the_content do this without negating the opening of the CDATA?

If there's no explanation, I'll submit a ticket for this.

Thanks,

Sujal

-- 
---- sujal shah ---- codesujal at gmail.com ----

           http://www.fatmixx.com


More information about the wp-testers mailing list