summaryrefslogtreecommitdiff
path: root/src/iterator.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/iterator.c')
-rw-r--r--src/iterator.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/iterator.c b/src/iterator.c
index cd7db8e..63cbf9e 100644
--- a/src/iterator.c
+++ b/src/iterator.c
@@ -16,7 +16,7 @@ cmark_iter *cmark_iter_new(cmark_node *root) {
if (root == NULL) {
return NULL;
}
- cmark_mem *mem = root->content.mem;
+ cmark_mem *mem = root->mem;
cmark_iter *iter = (cmark_iter *)mem->calloc(1, sizeof(cmark_iter));
iter->mem = mem;
iter->root = root;
@@ -101,19 +101,19 @@ void cmark_consolidate_text_nodes(cmark_node *root) {
if (ev_type == CMARK_EVENT_ENTER && cur->type == CMARK_NODE_TEXT &&
cur->next && cur->next->type == CMARK_NODE_TEXT) {
cmark_strbuf_clear(&buf);
- cmark_strbuf_put(&buf, cur->as.literal.data, cur->as.literal.len);
+ cmark_strbuf_put(&buf, cur->data, cur->len);
tmp = cur->next;
while (tmp && tmp->type == CMARK_NODE_TEXT) {
cmark_iter_next(iter); // advance pointer
- cmark_strbuf_put(&buf, tmp->as.literal.data, tmp->as.literal.len);
+ cmark_strbuf_put(&buf, tmp->data, tmp->len);
cur->end_column = tmp->end_column;
next = tmp->next;
cmark_node_free(tmp);
tmp = next;
}
- iter->mem->free(cur->as.literal.data);
- cur->as.literal.len = buf.size;
- cur->as.literal.data = cmark_strbuf_detach(&buf);
+ iter->mem->free(cur->data);
+ cur->len = buf.size;
+ cur->data = cmark_strbuf_detach(&buf);
}
}