Skip to content

Commit 0b1e8cb

Browse files
build: bump dompurify (#681)
# Motivation Stay up-to-date with the latest sanitizer improvements. # Changes - Bump lib - Change order of the expected attributes in tests (I did not checked why as the change seems trivial)
1 parent ba1bda0 commit 0b1e8cb

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
},
7575
"dependencies": {
7676
"decimal.js": "^10.6.0",
77-
"dompurify": "^3.2.4",
77+
"dompurify": "^3.2.6",
7878
"html5-qrcode": "^2.3.8",
7979
"marked": "^9.1.0",
8080
"qr-creator": "^1.0.0"

src/tests/lib/utils/html.utils.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ describe("html-utils", () => {
2525
it("should preserve the target attribute", () => {
2626
expect(
2727
sanitize(`<a target="_blank" rel="noreferrer" href="/">link</a>`),
28-
).toEqual(`<a href="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/" rel="noreferrer" target="_blank">link</a>`);
28+
).toEqual(`<a rel="noreferrer" href="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/" target="_blank">link</a>`);
2929
expect(
3030
sanitize(`<a target="_blank" rel=" noreferrer " href="/">link</a>`),
31-
).toEqual(`<a href="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/" rel="noreferrer" target="_blank">link</a>`);
31+
).toEqual(`<a rel="noreferrer" href="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/" target="_blank">link</a>`);
3232
});
3333

3434
it('should add "noopener" if rel not set', () => {
@@ -40,12 +40,12 @@ describe("html-utils", () => {
4040
it('should replace unknown|insecure rel value with "noopener"', () => {
4141
expect(
4242
sanitize(`<a target="_blank" rel="nocloser" href="/">link</a>`),
43-
).toEqual(`<a href="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/" rel="noopener" target="_blank">link</a>`);
43+
).toEqual(`<a rel="noopener" href="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/" target="_blank">link</a>`);
4444
expect(
4545
sanitize(
4646
`<a target="_blank" rel="noopenernoreferrer" href="/">link</a>`,
4747
),
48-
).toEqual(`<a href="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/" rel="noopener" target="_blank">link</a>`);
48+
).toEqual(`<a rel="noopener" href="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/" target="_blank">link</a>`);
4949
});
5050
});
5151
});

0 commit comments

Comments
 (0)