Getting TinyMCE to respect empty alt attributes

This one took a little futzing around and digging through the TinyMCE forum to figure out, but it’s been nagging at me for a while. By default (or at least in the default configuration provided under the LG TinyMCE extension for ExpressionEngine), TinyMCE will remove the alt attribute if it is empty. Obviously, for accessibility and validation reasons, this is highly undesirable and needs correcting. Thankfully, the fix is pretty simple: add the following to your TinyMCE configuration options:

Unicorn! · GitHub

This page is taking too long to load.

Sorry about that. Please try refreshing and contact us if the problem persists.

I choose to add these options right after declaring my cleanup/output options but before the remainder of the configuration. If you choose to tack these options on at the end, just remember to remove the trailing comma.

Like it? Share it

Share on LinkedIn

Share on Google Plus

Comments

  1. Actually i don’t like using TinyMCE, because it’s often just corrupts the page layout.

  2. Oh, wow!  Thanks for posting this!  Such an easy fix.

  3. I used to write for The Fritz (about a million years ago at this point?) and was wondering how you were doing and if the magazine was in archives online anywhere. Drop me a line if you get a chance; I hope you’re doing well. Thanks for setting up my first interview ever (with Gen).

    • Whitney
    • | #
  4. right, the fix is pretty simple, still I want to thank you, cause it could have caused me much trouble (not much aware of TinyMCE and all this stuff). you don’t always meet people who take care and time to inform users about such trifles. but it means much;)