Skip to content

Instantly share code, notes, and snippets.

@Maasik
Forked from simshaun/gist:7592631
Created April 27, 2017 08:29
Show Gist options
  • Save Maasik/d3f6ff74f1ef93914460579099f02c7a to your computer and use it in GitHub Desktop.
Save Maasik/d3f6ff74f1ef93914460579099f02c7a to your computer and use it in GitHub Desktop.
TinyMCE 4.0.11 - Automatically remove width and height attributes from img elements inserted via the img plugin
setup: function (editor) {
editor.on('init', function(args) {
editor = args.target;
editor.on('NodeChange', function(e) {
if (e && e.element.nodeName.toLowerCase() == 'img') {
tinyMCE.DOM.setAttribs(e.element, {'width': null, 'height': null});
}
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment