Skip to content

fix: set parents for all variadic inserted nodes - #343

Open
feritcemkahraman wants to merge 1 commit into
postcss:mainfrom
feritcemkahraman:fix/variadic-node-parents
Open

feritcemkahraman wants to merge 1 commit into
postcss:mainfrom
feritcemkahraman:fix/variadic-node-parents

Conversation

@feritcemkahraman

Copy link
Copy Markdown

When insertBefore or insertAfter receives multiple new nodes, only the first node gets a parent. Later nodes are serialized but their remove() call does nothing, and sibling navigation cannot resolve the container.

Assign the parent to each additional node. Add regressions for both insertion methods that verify the parent and subsequent removal.

Validation: both new tests fail before the fix; all 798 tests pass after it. Build, TypeScript checks, and lint pass (lint reports two existing warnings in exceptions.mjs).

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