summaryrefslogtreecommitdiff
path: root/src/cmark.c
diff options
context:
space:
mode:
authorNick Wellnhofer <wellnhofer@aevum.de>2014-11-17 20:13:20 +0100
committerJohn MacFarlane <jgm@berkeley.edu>2014-11-17 21:43:46 -0800
commit24643bde1d2c79cc512242379868efadf653c1da (patch)
treeba859dea0838032ff5c1f7b6377f47fa74969e2e /src/cmark.c
parentb66573cb303f9174a6b86138a7c8782eeb03b3ad (diff)
Switch cmark_node_block over to cmark_node
Diffstat (limited to 'src/cmark.c')
-rw-r--r--src/cmark.c23
1 files changed, 6 insertions, 17 deletions
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 <stdlib.h>
#include <assert.h>
#include <stdio.h>
+#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);