2/26/2005

WordPress 1.5 bug?

Filed under: @ 8:19 pm

I think I’ve inadvertently flushed out a bug in the new version of WordPress - one that had me going bonkers for a while. When I was writing the previous post, WP insisted on inserting a trailing slash within the “img src” tag. That is, no matter how many times I tried writing, rewriting, or fixing it, the tag would always come out:

<img src=path/to/image.jpg align=right/>

The only way I managed to fix it was to go directly into the MySQL database via phpMyAdmin and manually delete the slash. I’ve already posted to the WP forums, but has anybody else run into this?

5 Responses to “WordPress 1.5 bug?”

  1. I’ve never used WP, but I imagine the trailing slash is appearing because it’s trying to adhere to the rules of XHTML. Looking at your source, you’ve set a DTD of XHTML 1.0 Transitional. I don’t know how WP works exactly, but I wonder if this has something to do with it. In valid XHTML, all opening tags must have a corresponding closing tag (just like the rules of XML). In the case of a standalone tag, like an or , in XHTML, they must be denoted as and . Does that answer your question?

    Comment by Sean — 2/27/2005 @ 8:18 am


  2. Whoops! In the penultimate sentence of my comment, I forgot to write up the tags so that they would display properly. What I meant to say was:

    In the case of a standalone tag, like <img> and <br>, in XHTML, they must be denoted as <img /> <br />.

    Comment by Sean — 2/27/2005 @ 8:21 am


  3. OK, I’m an idiot - while “align” has been deprecated (and I’ll need to study up further on that), the problem looks like I wasn’t putting the positioning attribute in quotes, as it now works as intended.

    Thanks for the XHTML lesson Sean. :-)

    Comment by Brian — 2/27/2005 @ 9:50 am


  4. Yeah, the align attribute is used in CSS, rather than in the HTML itself. It works either way. But the XHTML way is to put it in the CSS. And yeah, quotes are required with XHTML — just like opening and closing each tag, and just like having all attributes and values in lowercase.

    Comment by Sean — 2/27/2005 @ 10:20 am


  5. yup, wordpress is xhtml-compliant and all the code it generates is xhtml, not html. i’m not sure there’s even a setting to change that, though i’m not sure you’d want to. all in the interest of moving forward, etc.

    Comment by basil — 2/27/2005 @ 5:07 pm


Leave a Reply

Recent Comments
  • Jim: Well, you know my opinion of it. Haven't gotten around to 83-96 yet myself. I'd love to have a better sounding copy of...
  • Brian: Hey Chris! It's no fiddlehead, but yeah - it looks like it would give lettuce a good run for its money.
  • Chris: But is it better than lettuce?
  • Brian: Yeah, I still need to make the first BMW purchase - they're sweet cars, but I just don't know when it's going to...
  • Jim: Nice! There was a time, so many many moons ago, that I would have sworn you'd never own anything but a BMW. Volkswagen...

Curious since 1974. Chronicling it here since 2004.

spacer