Title attribute stripped on Timeline

While the machine-readable alt attribute is preserved on <image> tags, I’m unsure why the human-readable title attribute is stripped on <image> tags in the micro∙blog Timeline.

For anyone unaware, any text in the title attribute appears on desktop OSes while hovering with the mouse pointer over the webpage element (e.g. an image), and on mobile OSes after long-pressing on the element as a popup menu. In modern webbrowsers this is different from text in alt attributes, which remain invisible, since it’s meant for screen readers and such, not for the human viewing a webpage.

So not including the title attribute in posts on the Timeline, is this a feature or a bug?

When handing other peoples’ markup, like on the Micro.blog timeline, one wants to be very restrictive with what kind of elements and attributes to allow. Partly not to mess with layout, but also for safety reasons. The approach most take is to strip away all HTML and then carefully add some elements and attributes back using an allowlist.

So I’m guessing it’s not a bug nor a feature, it’s just a consequence of the fact that @manton is pretty restrictive with what HTML is allowed on the timeline. title hasn’t made it to the allowlist for images (but it is allowed for links).

The title attribute’s main use case is to describe iframe elements. It should “contain text representing advisory information related to the element it belongs to”. It’s allowed to use title attributes on images, but it often doesn’t make much sense. What kind of advisory information is needed for the image?

If you want to have a caption for the image, it should go in a paragraph close to the image or, if you want to be real fancy, use the figcaption element.

The title attribute comes with accessibility concerns, so if you can find other solutions to what you want to accomplish, more netizens out there will be able to access what you share.

Great description. I think we should probably allow title for images too, although I agree a separate paragraph for captions is generally better.

Thanks for that explanation.

I guess one could argue the same for the alt tag, if it were not for screen readers. For the title tag the reasoning is hiding for entertainment value, as is the case with XKCD. But if it is too much of a risk (read: possible source for abuse), I can agree it has no place on a Timeline.

I’m sure there are other ways to hide information in plain sight for entertainment value. I just have to be more inventive.