Skip to content

FIX: Update parent references when replacing SyntaxTreeNode children - #496

Closed
adityajai119 wants to merge 1 commit into
executablebooks:masterfrom
adityajai119:fix-tree-children-parent
Closed

adityajai119 wants to merge 1 commit into
executablebooks:masterfrom
adityajai119:fix-tree-children-parent

Conversation

@adityajai119

Copy link
Copy Markdown

Assigning to \SyntaxTreeNode.children\ replaced the child list but left each child's \parent\ pointing at its previous node. That made \parent, \siblings,
ext_sibling\ and \previous_sibling\ return stale or wrong values after a tree edit.

The setter now sets \parent\ on every assigned child.

Checks: focused test fails before the fix and passes after; \pytest tests/test_tree.py\ (19 passed, 2 environment errors from the missing \ ile_regression\ fixture),
uff check markdown_it/tree.py tests/test_tree.py\ (passed).

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant