Skip to content

Commit

Permalink
Fix undefined Parser in nodejs environment
Browse files Browse the repository at this point in the history
  • Loading branch information
harentius authored Jan 31, 2025
1 parent cc73387 commit 95cb0b2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/html-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function canParseHTMLNatively () {
// Firefox/Opera/IE throw errors on unsupported types
try {
// WebKit returns null on unsupported types
if (new Parser().parseFromString('', 'text/html')) {
if (Parser && new Parser().parseFromString('', 'text/html')) {
canParse = true
}
} catch (e) {}
Expand Down

0 comments on commit 95cb0b2

Please sign in to comment.