We've recently run into an issue with a few of our CMS sites where the Alt text isn't populating when the image is dragged into the TinyMCE editor. If you click Insert -> Image and select an image, you can insert alt text. However, we like to keep our alt text with the image itself. TinyMCE does not give us an way to insert this.
We had initially tried getting alt text on as an on page publish event, but then the alt text could be changed on the image, and each page needed to be republished. Our current solution is to create an Xhtmlstring display template with MVC, and add an extension method, parse for image tags, get the content from UrlResolver, load the image, get the alt text, rewrite the Xhtmlstring, and return the result. This doesn't feel like a good practice.
Does anyone have a good way to keep an Xhtmlstring property updated with alt text from an image file?