[uf-discuss] "alt" attributes; redux

Andy Mabbett andy at pigsonthewing.org.uk
Sun Feb 17 02:47:20 PST 2008


On Twitter, the markup:

        <A
           title="microformats"
           rel="contact"
           class="url"
           href="http://twitter.com/microformats"
        >

                <IMG
                     width="24"
                     height="24"
                     src=".../microformats-logo_mini.png"
                     id="profile-image"
                     class="photo fn"
                     alt="microformats"
                />

        </A>

is rendered by Operator as an XFN with:

        "undefined (contact)"

because the "alt" attribute is not parsed. I've no doubt that other
parsers do something similar (rel-lint seems to barf on them).


Where several such graphic links exist, this results in a list of
contacts:

        "undefined (contact)"
        "undefined (contact)"
        "undefined (contact)"
        "undefined (contact)"

each of which refers to someone or something different; they are thus of
little use to human or machine consumers.


As I have pointed out previously, this is contrary to the intentions of
the writers of the HTML specification:

        alt = text [CS]

        For user agents that cannot display images, forms, or applets,
        this attribute specifies alternate text [...]

        Several non-textual elements [...] let authors specify alternate
        text to serve as content when the element cannot be rendered
        normally.

        <http://www.w3.org/TR/html401/struct/objects.html#h-13.8>


The alt attribute should be parsed, and the above example rendered as:

        "microformats (contact)"

This applies to all microformat properties, where the content is
expected to be text.

-- 
Andy Mabbett


More information about the microformats-discuss mailing list