Skip to content

Commit 6698927

Browse files
committed
Remove deprecated fallback allowDangerousHTML
1 parent 3cc3cb6 commit 6698927

File tree

2 files changed

+1
-19
lines changed

2 files changed

+1
-19
lines changed

lib/index.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ export function toHtml(node, options = {}) {
4141
tightLists: options.tightCommaSeparatedLists,
4242
tightClose: options.tightSelfClosing,
4343
collapseEmpty: options.collapseEmptyAttributes,
44-
// @ts-ignore `allowDangerousHTML` is deprecated.
45-
dangerous: options.allowDangerousHtml || options.allowDangerousHTML,
44+
dangerous: options.allowDangerousHtml,
4645
voids: options.voids || htmlVoidElements.concat(),
4746
entities: options.entities || {},
4847
close: options.closeSelfClosing,

test/raw.js

-17
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,5 @@ test('`element`', function (t) {
1919
'should not encode `raw`s in `allowDangerousHtml` mode'
2020
)
2121

22-
t.deepEqual(
23-
// @ts-ignore nonstandard.
24-
toHtml(u('raw', '<script>alert("XSS!")</script>'), {
25-
allowDangerousHTML: true
26-
}),
27-
'<script>alert("XSS!")</script>',
28-
'should support the legacy `allowDangerousHTML` (#1)'
29-
)
30-
t.deepEqual(
31-
// @ts-ignore nonstandard.
32-
toHtml(u('raw', '<script>alert("XSS!")</script>'), {
33-
allowDangerousHTML: true
34-
}),
35-
'<script>alert("XSS!")</script>',
36-
'should support the legacy `allowDangerousHTML` (#2)'
37-
)
38-
3922
t.end()
4023
})

0 commit comments

Comments
 (0)