Changing way of determining an element's sublingPosition.#159
Merged
leonelsanchesdasilva merged 1 commit intomainfrom Feb 2, 2026
Merged
Changing way of determining an element's sublingPosition.#159leonelsanchesdasilva merged 1 commit intomainfrom
sublingPosition.#159leonelsanchesdasilva merged 1 commit intomainfrom
Conversation
Coverage report
Show files with reduced coverage 🔻
Test suite run success567 tests passing in 59 suites. Report generated by 🧪jest coverage report action from 83f0630 |
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request fixes Issue #158, which relates to incorrect ordering of text nodes relative to block elements during XSLT transformation. The fix simplifies the logic for determining an element's siblingPosition property by always using the parent's current child count rather than attempting to copy the position from input nodes.
Changes:
- Added comprehensive test suite for text node ordering scenarios
- Simplified
siblingPositionassignment logic to always use parent'schildNodes.length, making it consistent with the rest of the codebase
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tests/text-node-ordering.test.tsx | New test file with three test cases verifying text nodes maintain correct order before, within, and interspersed with block elements |
| src/xslt/xslt.ts | Removed incorrect conditional logic that tried to copy siblingPosition from input nodes; now consistently uses output parent's child count |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Resolves #158