From 24643bde1d2c79cc512242379868efadf653c1da Mon Sep 17 00:00:00 2001 From: Nick Wellnhofer Date: Mon, 17 Nov 2014 20:13:20 +0100 Subject: Switch cmark_node_block over to cmark_node --- src/cmark.c | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) (limited to 'src/cmark.c') diff --git a/src/cmark.c b/src/cmark.c index 106abbf..328be9d 100644 --- a/src/cmark.c +++ b/src/cmark.c @@ -1,6 +1,7 @@ #include #include #include +#include "node.h" #include "references.h" #include "html/houdini.h" #include "cmark.h" @@ -29,18 +30,6 @@ cmark_node_block *cmark_block_children(cmark_node_block *current) return current->children; } -void cmark_block_delete(cmark_node_block *current) -{ - if (current->prev) { - current->prev->next = current->next; - } - if (current->next) { - current->next->prev = current->prev; - } - current->next = NULL; - cmark_free_blocks(current); -} - void cmark_block_insert_before(cmark_node_block *new, cmark_node_block *current) { // Find last node in new: @@ -75,7 +64,7 @@ void cmark_block_insert_after(cmark_node_block *current, cmark_node_block *new) unsigned char *cmark_markdown_to_html(unsigned char *text, int len) { - node_block *blocks; + cmark_node *blocks; unsigned char *result; blocks = cmark_parse_document(text, len); @@ -156,19 +145,19 @@ unsigned char *cmark_clean_autolink(chunk *url, int is_email) } // Free a node_block list and any children. -void cmark_free_blocks(cmark_node_block *e) +void cmark_free_blocks(cmark_node *e) { - cmark_node_block * next; + cmark_node *next; while (e != NULL) { cmark_free_inlines(e->inline_content); strbuf_free(&e->string_content); - if (e->tag == CMARK_BLOCK_FENCED_CODE) { + if (e->type == NODE_FENCED_CODE) { strbuf_free(&e->as.code.info); } if (e->last_child) { // Splice children into list e->last_child->next = e->next; - e->next = e->children; + e->next = e->first_child; } next = e->next; free(e); -- cgit v1.2.3