Repository navigation
[lexical-utils] Bug Fix: don't include parent's siblings when starting $dfs at last child - #7275
Merged
Merged
Conversation
…g $dfs at last child
james-atticus
requested review from
Fetz,
Sahejkm,
acywatson,
fantactuka,
ivailop7,
potatowagon and
zurfyx
as code owners
March 3, 2025 06:03
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
etrepum
approved these changes
Mar 3, 2025
etrepum
left a comment
Collaborator
There was a problem hiding this comment.
I added the code here to fix this implicit endNode calculation and confirmed that this also passes with v0.24.0 prior to the refactoring
Merged
This branch was successfully deployed
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.
Take #2 of #7274
The introduction of Carets changed
$dfsto include siblings of the start node's parent, if the start node is the last child of its parent.I've added a test case and confirmed that the test passes on 0.24.0, i.e. before the caret changes were introduced. I haven't got myself familiarised with the caret API yet though, and couldn't easily see what needed to change to fix this behaviour. On main, test fails with:
I also came across #7174 which adds a test case for
$dfsincluding the siblings of the startNode itself, if the start node is not an element node. It's not obvious why you'd want to DFS a leaf node, but in any case this was also a change from 0.24.0, so I've updated that test as well. Fails on main with: