diff options
Diffstat (limited to 'src/node.c')
-rw-r--r-- | src/node.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -730,6 +730,15 @@ int cmark_node_insert_after(cmark_node *node, cmark_node *sibling) { return 1; } +int cmark_node_replace(cmark_node *oldnode, cmark_node *newnode) { + if (!cmark_node_insert_before(oldnode, newnode)) { + return 0; + } + cmark_node_unlink(oldnode); + cmark_node_free(oldnode); + return 1; +} + int cmark_node_prepend_child(cmark_node *node, cmark_node *child) { if (!S_can_contain(node, child)) { return 0; |