Conversation
- node.ts now accepts `string | Document` — pass a Document from linkedom, happy-dom, or any DOM implementation directly - JSDOM is dynamically imported when a string is passed, with a helpful error if not installed - Move jsdom from peerDependencies to optionalDependencies - Fix `isConnected` → `parentNode` in standardize.ts (linkedom's cloneNode doesn't set isConnected) - Add `normalize()` after cloning to merge fragmented text nodes from DOM implementations that split HTML entities - Add linkedom test suite verifying output matches expected fixtures
Switch CLI, tests, and all DOM parsing to linkedom. This removes JSDOM as a dependency entirely, halving test runtime and simplifying the dependency tree.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
defuddle/nodeto accept any DOMDocument(linkedom, JSDOM, happy-dom, etc.) instead of requiring JSDOM. Callers choose their own DOM implementation.isConnectedchecks withparentNode(linkedom doesn't supportisConnectedon cloned documents), and addednormalize()to merge fragmented text nodes from HTML entity parsing.npm test(linkedom) andnpm run test:jsdom.Backward compatibility
Passing an HTML string or JSDOM instance to
Defuddle()still works but is deprecated. Pass aDocumentinstead: