Skip to content

Add Elements.before(Node) and after/prepend/append(Node) #953 - #2567

Merged
jhy merged 3 commits into
jhy:masterfrom
AzazelSensei:feat/elements-node-insert-953
Aug 20, 2026
Merged

Add Elements.before(Node) and after/prepend/append(Node) #953#2567
jhy merged 3 commits into
jhy:masterfrom
AzazelSensei:feat/elements-node-insert-953

Conversation

@AzazelSensei

Copy link
Copy Markdown
Contributor

#953 asked for Elements.before(Node). You said to do the same for after, prepend, and append so they match the string methods.

Each call clones the node. That way inserting into a list does not move one instance between targets, and I am not serializing through HTML.

Tests are in ElementsTest next to the existing string cases.

These were missing next to the string methods. Clone the
node for each target so one instance is not moved around
the tree.

Fixes jhy#953
@jhy jhy linked an issue Aug 20, 2026 that may be closed by this pull request
@jhy
jhy merged commit 25abf40 into jhy:master Aug 20, 2026
12 checks passed
@jhy

jhy commented Aug 20, 2026

Copy link
Copy Markdown
Owner

Thanks, merged

@jhy jhy added the improvement An improvement / new feature idea label Aug 20, 2026
@jhy jhy added this to the 1.23.2 milestone Aug 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement An improvement / new feature idea

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add method Elements.before(Node node)

2 participants