Strange Errors in Markup Validation

  • Hi, i wanted to see if my blog was valid markup und submitted its url to http://validator.w3.org.
    This is one of many errors i got about ampersands in image urls. The problem is, that they are in the sites source, but they are not visible in the editor:

    # Warning Line 109, Column 91: cannot generate system identifier for general entity “h”.

    …press.com/2008/03/08031601.jpg?w=400&h=300″ alt=”08031601.jpg” border=”0″ wid

    An entity reference was found in the document, but there is no reference by that name defined. Often this is caused by misspelling the reference name, unencoded ampersands, or by leaving off the trailing semicolon (;). The most common cause of this error is unencoded ampersands in URLs as described by the WDG in “Ampersands in URLs”.

    Entity references start with an ampersand (&) and end with a semicolon (;). If you want to use a literal ampersand in your document you must encode it as “&” (even inside URLs!). Be careful to end entity references with a semicolon or your entity reference may get interpreted in connection with the following text. Also keep in mind that named entity references are case-sensitive; &Aelig; and æ are different characters.

    If this error appears in some markup generated by PHP’s session handling code, this article has explanations and solutions to your problem.

    Note that in most documents, errors related to entity references will trigger up to 5 separate messages from the Validator. Usually these will all disappear when the original problem is fixed.

    i posted the article through Marsedit. But also in Marsedit those ampersands are not there. I dont know who inserted this part:

    ?w=400&h=300

    any ideas?

  • Yep, it’s inserted by the WP system when the user calls the blog page to their screen, exactly what the validator does. It’s crunching the image on the fly and saving valuable 1kb per image space on the server by not creating a thumbnail.

    Unfortunately, there’s not much we can do about it.

  • Thank you.
    So there must be some WordPress.Com Plugin doing this?
    At least they could encode the Ampersand the right way.

  • So, i found out, that – ?w=400&h=300 – is added after the image filename if you add – width=”” height=”” – in the imagetag.

  • So, i found out, that – ?w=400&h=300 – is added after the image filename if you add – width=”” height=”” – in the imagetag.

    Precisely, and the problem goes away if you remove width and height, which of course shouldn’t be done.

    I don’t think WP goes a good job even if it is to save a precious byte or two.

    The problem is you don’t even have to add width and height, WP adds it for you. So you need to check your link in the HTML tab.
    Rather annoying.

    As a matter of fact I think the new WP image feature is rather terrible. Soory to be so blunt.

  • The topic ‘Strange Errors in Markup Validation’ is closed to new replies.