Skip to content

Commit

Permalink
test: added test for postcss map
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanarmstrong committed Feb 21, 2024
1 parent c376501 commit 1e2294c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1659,5 +1659,13 @@ describe('sanitizeHtml', function() {
}
}), '<svg viewBox="0 0 10 10" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><linearGradient id="myGradient" gradientTransform="rotate(90)"><stop offset="5%" stop-color="gold"></stop><stop offset="95%" stop-color="red"></stop></linearGradient></defs><circle cx="5" cy="5" r="4" fill="url(\'#myGradient\')"></circle></svg>');
});
it('should not process style sourceMappingURL with postCSS', () => {
assert.equal(sanitizeHtml('<a style=\'background-image: url("/*# sourceMappingURL=../index.js */");\'></a>', {
allowedAttributes: {
...sanitizeHtml.defaults.allowedAttributes,
a: [ 'style' ]
}
}), '<a style="background-image:url(&quot;/*# sourceMappingURL=../index.js */&quot;)"></a>');
});

});

0 comments on commit 1e2294c

Please sign in to comment.