Skip to content

Conversation

@paviad
Copy link

@paviad paviad commented Jul 11, 2023

Contains two fixes:

  1. Change the default value of the parseImgDimensions option to true (also in documentation)
  2. Properly reject image dimensions when the option is set to false

Closes #984

Copy link

@joshiayush joshiayush left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just add options.parseImgDimensions down in the if clause:

    if (options.parseImgDimensions && width && height) {
      width  = (width === '*') ? 'auto' : width;
      height = (height === '*') ? 'auto' : height;
      result += ' width="' + width + '"';
      result += ' height="' + height + '"';
    }

Look, the desired behaviour should be this.

@qlty-cloud-legacy
Copy link

Code Climate has analyzed commit 456a6f7 and detected 0 issues on this pull request.

View more on Code Climate.

@paviad
Copy link
Author

paviad commented Jul 18, 2023

Resolved all issues, new behavior will not reject dimensions, but will simply ignore them.

Copy link

@joshiayush joshiayush left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR fixes #984 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Option parseImgDimensions is actually true by default despite doc, and also, when false still behaves as if true

2 participants