Open Cheng007 opened 7 months ago
There is an error TypeError: Cannot read properties of null (reading 'isSelfCloseTag') while parsing from the following html string:
TypeError: Cannot read properties of null (reading 'isSelfCloseTag')
const htmlString = `<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Webpack App</title> <meta name="viewport" content="width=device-width, initial-scale=1"><script defer src="main.bundle.js"></script></head> <body> </body> </html>`;
It directly caused by the following unhandled null input element
null
function isElementComposed(element, tag) { if (!tag) { return false; } const isCloseTag = closeTagExp.test(tag); const [, nodeName] = tag.match(nodeNameExp) || []; const isElementClosedByTag = isCloseTag && element.nodeName === nodeName; return isElementClosedByTag || element.isSelfCloseTag || element.nodeType === Node_1.NodeType.text; }
I submitted a PR and hope this will help
Please review the PR #35, folks! I'm having the same issue.
Same here
same here
me too! please solve this!! thanks!
Me too!
Same here ;)
There is an error
TypeError: Cannot read properties of null (reading 'isSelfCloseTag')
while parsing from the following html string:It directly caused by the following unhandled
null
input element