Skip to content

Commit 1e2294c

Browse files
test: added test for postcss map
1 parent c376501 commit 1e2294c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/test.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1659,5 +1659,13 @@ describe('sanitizeHtml', function() {
16591659
}
16601660
}), '<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>');
16611661
});
1662+
it('should not process style sourceMappingURL with postCSS', () => {
1663+
assert.equal(sanitizeHtml('<a style=\'background-image: url("/*# sourceMappingURL=../index.js */");\'></a>', {
1664+
allowedAttributes: {
1665+
...sanitizeHtml.defaults.allowedAttributes,
1666+
a: [ 'style' ]
1667+
}
1668+
}), '<a style="background-image:url(&quot;/*# sourceMappingURL=../index.js */&quot;)"></a>');
1669+
});
16621670

16631671
});

0 commit comments

Comments
 (0)