Skip to content

Add support for cloning node trees - #3

Merged
samuel-williams-shopify merged 1 commit into
mainfrom
add-node-cloning
Sep 9, 2026
Merged

Add support for cloning node trees#3
samuel-williams-shopify merged 1 commit into
mainfrom
add-node-cloning

Conversation

@samuel-williams-shopify

@samuel-williams-shopify samuel-williams-shopify commented Sep 9, 2026

Copy link
Copy Markdown

Summary

Add cmark_node_clone to create an independent structural copy of a node tree without serializing and reparsing Markdown. The clone preserves node metadata, source positions, inline code language information, and internal footnote relationships while deliberately excluding user data.

Add an extension hook for copying opaque node state, with support for table metadata. Make HTML rendering safe for cloned standalone paragraph nodes, which no longer have a parent document.

Testing

  • make test
  • Clone and render complete documents, detached child nodes, and extension-backed tables

Assisted-By: devx/7ef83274-928f-499d-b668-48449b1ff60e
@samuel-williams-shopify
samuel-williams-shopify merged commit 4fa8814 into main Sep 9, 2026
10 checks passed
@samuel-williams-shopify
samuel-williams-shopify deleted the add-node-cloning branch September 9, 2026 04:57
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