summaryrefslogtreecommitdiff
path: root/src/iterator.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/iterator.c')
-rw-r--r--src/iterator.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/iterator.c b/src/iterator.c
index c6faf99..f18e3bf 100644
--- a/src/iterator.c
+++ b/src/iterator.c
@@ -129,18 +129,20 @@ void cmark_consolidate_text_nodes(cmark_node *root)
cur->next &&
cur->next->type == CMARK_NODE_TEXT) {
cmark_strbuf_clear(&buf);
- cmark_strbuf_puts(&buf, cmark_node_get_literal(cur));
+ cmark_strbuf_put(&buf, cur->as.literal.data, cur->as.literal.len);
tmp = cur->next;
while (tmp && tmp->type == CMARK_NODE_TEXT) {
cmark_iter_next(iter); // advance pointer
- cmark_strbuf_puts(&buf, cmark_node_get_literal(tmp));
+ cmark_strbuf_put(&buf, tmp->as.literal.data, tmp->as.literal.len);
next = tmp->next;
cmark_node_free(tmp);
tmp = next;
}
- cmark_node_set_literal(cur, (char *)cmark_strbuf_detach(&buf));
+ cmark_chunk_free(&cur->as.literal);
+ cur->as.literal = cmark_chunk_buf_detach(&buf);
}
}
+ cmark_strbuf_free(&buf);
cmark_iter_free(iter);
}