Skip to content

Commit 4d61ba5

Browse files
chore(deps): bump dompurify from 3.2.4 to 3.2.6 (#10572)
1 parent 6206c44 commit 4d61ba5

File tree

4 files changed

+14
-12
lines changed

4 files changed

+14
-12
lines changed

package-lock.json

Lines changed: 4 additions & 2 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
@@ -80,7 +80,7 @@
8080
"classnames": "^2.5.1",
8181
"css.escape": "1.5.1",
8282
"deep-extend": "0.6.0",
83-
"dompurify": "=3.2.4",
83+
"dompurify": "=3.2.6",
8484
"ieee754": "^1.2.1",
8585
"immutable": "^3.x.x",
8686
"js-file-download": "^0.4.12",

test/unit/components/markdown.jsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ describe("Markdown component", function () {
99
const getConfigs = () => ({ useUnsafeMarkdown: true })
1010
const str = `<span class="method" style="border-width: 1px" data-attr="value">ONE</span>`
1111
const el = render(<Markdown source={str} getConfigs={getConfigs} />)
12-
expect(el.prop("outerHTML")).toEqual(`<div class="markdown"><p><span data-attr="value" style="border-width: 1px" class="method">ONE</span></p>\n</div>`)
12+
expect(el.prop("outerHTML")).toEqual(`<div class="markdown"><p><span class="method" style="border-width: 1px" data-attr="value">ONE</span></p>\n</div>`)
1313
})
1414

1515
it("strips class, style and data-* attribs from elements", function () {
@@ -28,13 +28,13 @@ describe("Markdown component", function () {
2828
it("allows image elements", function () {
2929
const str = `![Image alt text](http://image.source "Image title")`
3030
const el = render(<Markdown source={str} />)
31-
expect(el.prop("outerHTML")).toEqual(`<div class="markdown"><p><img title="Image title" alt="Image alt text" src="http://image.source"></p>\n</div>`)
31+
expect(el.prop("outerHTML")).toEqual(`<div class="markdown"><p><img src="http://image.source" alt="Image alt text" title="Image title"></p>\n</div>`)
3232
})
3333

3434
it("allows image elements with https scheme", function () {
3535
const str = `![Image alt text](https://image.source "Image title")`
3636
const el = render(<Markdown source={str} />)
37-
expect(el.prop("outerHTML")).toEqual(`<div class="markdown"><p><img title="Image title" alt="Image alt text" src="https://image.source"></p>\n</div>`)
37+
expect(el.prop("outerHTML")).toEqual(`<div class="markdown"><p><img src="https://image.source" alt="Image alt text" title="Image title"></p>\n</div>`)
3838
})
3939

4040
it("allows image elements with data scheme", function () {
@@ -58,7 +58,7 @@ describe("Markdown component", function () {
5858
it("allows links", function () {
5959
const str = `[Link](https://example.com/)`
6060
const el = render(<Markdown source={str} />)
61-
expect(el.prop("outerHTML")).toEqual(`<div class="markdown"><p><a rel="noopener noreferrer" target="_blank" href="https://example.com/">Link</a></p>\n</div>`)
61+
expect(el.prop("outerHTML")).toEqual(`<div class="markdown"><p><a href="https://example.com/" target="_blank" rel="noopener noreferrer">Link</a></p>\n</div>`)
6262
})
6363
})
6464

@@ -67,7 +67,7 @@ describe("Markdown component", function () {
6767
const getConfigs = () => ({ useUnsafeMarkdown: true })
6868
const str = `<span class="method" style="border-width: 1px" data-attr="value">ONE</span>`
6969
const el = render(<OAS3Markdown source={str} getConfigs={getConfigs} />)
70-
expect(el.prop("outerHTML")).toEqual(`<div class="renderedMarkdown"><p><span data-attr="value" style="border-width: 1px" class="method">ONE</span></p></div>`)
70+
expect(el.prop("outerHTML")).toEqual(`<div class="renderedMarkdown"><p><span class="method" style="border-width: 1px" data-attr="value">ONE</span></p></div>`)
7171
})
7272

7373
it("strips class, style and data-* attribs from elements", function () {
@@ -80,13 +80,13 @@ describe("Markdown component", function () {
8080
it("allows image elements", function () {
8181
const str = `![Image alt text](http://image.source "Image title")`
8282
const el = render(<OAS3Markdown source={str} />)
83-
expect(el.prop("outerHTML")).toEqual(`<div class="renderedMarkdown"><p><img title="Image title" alt="Image alt text" src="http://image.source"></p></div>`)
83+
expect(el.prop("outerHTML")).toEqual(`<div class="renderedMarkdown"><p><img src="http://image.source" alt="Image alt text" title="Image title"></p></div>`)
8484
})
8585

8686
it("allows image elements with https scheme", function () {
8787
const str = `![Image alt text](https://image.source "Image title")`
8888
const el = render(<OAS3Markdown source={str} />)
89-
expect(el.prop("outerHTML")).toEqual(`<div class="renderedMarkdown"><p><img title="Image title" alt="Image alt text" src="https://image.source"></p></div>`)
89+
expect(el.prop("outerHTML")).toEqual(`<div class="renderedMarkdown"><p><img src="https://image.source" alt="Image alt text" title="Image title"></p></div>`)
9090
})
9191

9292
it("allows image elements with data scheme", function () {

test/unit/xss/markdown-script-sanitization.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe("Markdown Script Sanitization", function() {
2020
it("sanitizes <form> elements", function() {
2121
const str = `"<form action='https://do.not.use.url/fake' method='post' action='java'><input type='email' id='email' placeholder='Email-address' name='email' value=''><button type='submit'>Login</button>"`
2222
const el = render(<Markdown source={str} />)
23-
expect(el.prop("outerHTML")).toEqual(`<div class="markdown"><p>"</p><input value="" name="email" placeholder="Email-address" id="email" type="email"><button type="submit">Login</button>"<p></p>\n</div>`)
23+
expect(el.prop("outerHTML")).toEqual(`<div class="markdown"><p>"</p><input type="email" id="email" placeholder="Email-address" name="email" value=""><button type="submit">Login</button>"<p></p>\n</div>`)
2424
})
2525
})
2626

@@ -40,7 +40,7 @@ describe("Markdown Script Sanitization", function() {
4040
it("sanitizes <form> elements", function () {
4141
const str = `"<form action='https://do.not.use.url/fake' method='post' action='java'><input type='email' id='email' placeholder='Email-address' name='email' value=''><button type='submit'>Login</button>"`
4242
const el = render(<OAS3Markdown source={str} />)
43-
expect(el.prop("outerHTML")).toEqual(`<div class="renderedMarkdown"><p>"</p><input value="" name="email" placeholder="Email-address" id="email" type="email"><button type="submit">Login</button>"<p></p></div>`)
43+
expect(el.prop("outerHTML")).toEqual(`<div class="renderedMarkdown"><p>"</p><input type="email" id="email" placeholder="Email-address" name="email" value=""><button type="submit">Login</button>"<p></p></div>`)
4444
})
4545
})
4646
})

0 commit comments

Comments
 (0)