Use the hotlinked image filename as the alt tag

My forum gets a lot of posts with “oneboxed” hotlinked image urls and it’s great that they get auto-converted to uploads, but I was disappointed to see the original context is lost. The only way to know the original url/source is to look at the post revision history.

There are a few ways this could be handled, but I thought a good start is to set the alt attribute to the filename to match how a normal image upload works. This means it will also appear in the lightbox instead of a blank title.

This is also arguably better for accessibility because a blank/empty alt tag basically means “you can ignore this image”, but in our case the image is often the subject of the post.

2 Likes

PR here:

2 Likes