WordPress is dumb

For some reason WordPress replaces " with \" between pre tags. I haven’t yet worked out why (or how to stop it).

Watch it in action:

"

The above is literally <pre>"</pre>. See? It’s very exciting.

It is the reason my homepage doesn’t validate (it kills attributes inside pres). This sort of thing is why I disagree with generating XML without an XML parser: it’s very difficult to stop it becoming ill-formed at the drop of a hat. It doesn’t matter with XHTML served as text/html, but I don’t agree with that either.

Update: It was fixed a few weeks ago. See Ticket #1793 double quotes escaped inside pre tags.

One Response to “WordPress is dumb”

  1. Niall Fleming Says:

    it does it because php requires that you escape quotes and other special characters using a backslash.

    I would guess that the php function stripslashes wasn’t being applied to the pre for some reason

Leave a Reply

You must be logged in to post a comment.