Closed Lukas-Stuehrk closed 4 years ago
Cmark has a very misleading naming of its arguments for inserting nodes: The cmark_node_insert_after function takes a node and a sibling. https://github.com/SwiftDocOrg/swift-cmark/blob/master/src/node.c#L719
cmark_node_insert_after
node
sibling
Unlike what you would expect, sibling is the node that is actually inserted. Unfortunately CommonMark uses the wrong order of arguments for all calls to cmark_node_insert_after, e.g. at https://github.com/SwiftDocOrg/CommonMark/blob/master/Sources/CommonMark/Supporting%20Types/Children.swift#L111
Cmark has a very misleading naming of its arguments for inserting nodes: The
cmark_node_insert_after
function takes anode
and asibling
. https://github.com/SwiftDocOrg/swift-cmark/blob/master/src/node.c#L719Unlike what you would expect,
sibling
is the node that is actually inserted. Unfortunately CommonMark uses the wrong order of arguments for all calls tocmark_node_insert_after
, e.g. at https://github.com/SwiftDocOrg/CommonMark/blob/master/Sources/CommonMark/Supporting%20Types/Children.swift#L111