Skip to content

Commit

Permalink
migrates srcset update
Browse files Browse the repository at this point in the history
  • Loading branch information
abea committed Sep 23, 2020
1 parent 6f79315 commit 432e994
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const escapeStringRegexp = require('escape-string-regexp');
const { klona } = require('klona');
const { isPlainObject } = require('is-plain-object');
const deepmerge = require('deepmerge');
const srcset = require('srcset');
const parseSrcset = require('parse-srcset');
const { parse: postcssParse } = require('postcss');
const url = require('url');
// Tags that can conceivably represent stand-alone media.
Expand Down Expand Up @@ -345,7 +345,7 @@ function sanitizeHtml(html, options, _recursing) {
}
if (a === 'srcset') {
try {
parsed = srcset.parse(value);
parsed = parseSrcset(value);
parsed.forEach(function(value) {
if (naughtyHref('srcset', value.url)) {
value.evil = true;
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"htmlparser2": "^4.1.0",
"is-plain-object": "^5.0.0",
"klona": "^2.0.3",
"postcss": "^8.0.2",
"srcset": "^3.0.0"
"parse-srcset": "^1.0.2",
"postcss": "^8.0.2"
},
"devDependencies": {
"eslint": "^7.3.1",
Expand All @@ -41,4 +41,4 @@
"mocha": "^5.2.0",
"sinon": "^9.0.2"
}
}
}

0 comments on commit 432e994

Please sign in to comment.