Jump to content

'Skip width attributes on image tags' not working?


prestoav
 Share

Recommended Posts

Hi all,

PW: 3.0.42

I'm trying to have responsive images in the body field. First I need to stop the image tag generated by CKEditor adding the width attribute to the image tag on insertion. I found the 'Skip width attributes on image tags?' in the settings of ProcessPageEditImage and that suggests it does exactly what I'm after.

Sadly, even when this checkbox is checked and a new image is inserted the width attribute is still added.

Am I missing something?

TIA.

Screenshot 2017-09-25 14.35.04.png

Link to comment
Share on other sites

Hmm. I am having the same issue. 

I did some debugging. It looks like the module is working as intended, and sending response to frontend with 'data-nosize' attribute set correctly. But in pwimage plugin for CKEditor, nosize setting isn't used at all.

// pwimage/plugin.js
function insertImage(src) {
    var $i = $iframe.contents();
    var $img = jQuery("#selected_image", $i);
    // ...
    var $insertHTML = jQuery("<img />").attr('src', src).attr('alt', alt);
    // ...
    if (width > 0) $insertHTML.attr('width', width);

    // ...
    editor.insertHtml(html);
    // ...
}

 

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...