Skip to content

Commit b9336a9

Browse files
authored
Update parseHTML to use Document.parseHTMLUnsafe where supported (#3185)
Fixes #2682
1 parent 83a1449 commit b9336a9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/htmx.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,9 @@ var htmx = (function() {
525525
* @returns {Document}
526526
*/
527527
function parseHTML(resp) {
528+
if ('parseHTMLUnsafe' in Document) {
529+
return Document.parseHTMLUnsafe(resp)
530+
}
528531
const parser = new DOMParser()
529532
return parser.parseFromString(resp, 'text/html')
530533
}

0 commit comments

Comments
 (0)