I've been trying to programmatically remove the height and width attributes from the images via TinyMce
I've tried added a few things to to my initialization, but not of them seem to work.
It should be something simple like this:
But that doesn't seem to remove the height and width attributes.
invalid_elements only works on elements, not attributes.
image_dimensions removes the dimentions settings in the editor but not the code
I never tried this but have you tried adding following setting in the initialization module or tiny init method
It's strange, it seems like image_dimensions should work.
You could try something like this: https://gist.github.com/simshaun/7592631 (there may be a better example somewhere, this was just the first I found).
To use it you'd need to do something like:
Where that path is, of course, the path to your JS file.
Documentation is here: https://world.episerver.com/documentation/developer-guides/CMS/add-ons/customizing-the-tinymce-editor-v2/plug-ins/
Logically it seems that image_dimensions: false would work.
But according to the documentation, and from what I've experenced, "This options allows you disable the image dimensions input field in the image dialog." It doesn't remove the attributes from the image tag in the code. Also, it looks like this issue has been going on for a while now.
You can clear the dimentions in the input fields, but seeing that I managed hundreds of web authors having them all to remember to do this is an issue which can't be solved without a couple of bottles of whatever poison you prefer.
So clearing it out in the code is the best thing I can come up with and the plugin option may be the best. I'll play around with that and see if I can find something that works.
I also need to add limits as to the images they can upload, and your blog posts have given me some pretty good advice and how to impliment that.