Skip to content

Instantly share code, notes, and snippets.

@RodrigoTomeES
Created July 1, 2025 09:22
Show Gist options
  • Save RodrigoTomeES/f01da6107c59070994bb8443116a0530 to your computer and use it in GitHub Desktop.
Save RodrigoTomeES/f01da6107c59070994bb8443116a0530 to your computer and use it in GitHub Desktop.
Patch dom-parser issue #34
diff --git a/node_modules/dom-parser/dist/lib/Dom.js b/node_modules/dom-parser/dist/lib/Dom.js
index e94dd0d..4f29243 100644
--- a/node_modules/dom-parser/dist/lib/Dom.js
+++ b/node_modules/dom-parser/dist/lib/Dom.js
@@ -71,7 +71,7 @@ function* domGenerator(html) {
}
}
function isElementComposed(element, tag) {
- if (!tag) {
+ if (!tag || !element) {
return false;
}
const isCloseTag = closeTagExp.test(tag);
@RodrigoTomeES
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment