I would like to make alt-texts mandatory for images in the editor (EPiServer CMS 5).
My approach is to add a check when a page is saved/published. The check-function will parse the text entered in the editor field (bread text). It will look for img-tags and ensure that all img-tags have alt-texts specified. If alt-text is missing for one or more img-tags some message will be displayed and the page won't be saved/published.
Is there a better way?
Another approach could be the voluntary way. I know alt-texts are important, but slapping a "you cannot publish this page because..." is bad for moral. On EPiCode there is a module that extends the icons in the EPiServer page structure based on your own rules. Check out https://www.coderesort.com/p/epicode/wiki/PageTreeIcons and have a look at the Screencast.