Search code examples
tinymceumbracoumbraco7

Rich text editor (tinymce) images - how to disable auto height and width?


We're using Umbraco v7.2.1 to serve what is supposed to be responsive content.

When you add an image from the media library to the tinymce editor, this is the html that is inserted by tinymce:

    <img style="width: 500px; height:500px;" 
src="/media/1007/jobs-block.jpg?width=500&amp;height=500" alt="undefined" rel="1097" />

I really don't want ANY w x h in the tag or image src.

I have found a couple of posts regarding the tinyMce.config file and the validElements node - i removed the height and width things from the img thing in there but that had no effect.


Solution

  • If you open the Data Type for the Richtext editor in question there is a setting called "Maximum size for inserted images". This is by default set to 500 pixels.

    If you set it to 0 it will disable any resizing.