cmark
My personal build of CMark ✏️
git clone: git://git.pablopie.xyz/cmark
Commit
831bf6de49ae58bd3630f40bdb6f8bc5371a33dd
Parent
3d0110a36054a9af1532d52f2671360fa1c802a3
Author
John MacFarlane <jgm@berkeley.edu >
Date
Fri, 12 Dec 2014 23:49:52 -0800
Revert "Removed CMARK_NODE_REFERENCE_DEF from API."
This reverts commit b598b52a4acdc2332be3d34e30237d1b93b7dd03.
The change led to some problems, because some of the callers
of 'finalize' expected the node to exist after the call.
This could all be rewritten, but for now let's just revert.
Diffstat
7 files changed, 19 insertions, 5 deletions
diff --git a/api_test/main.c b/api_test/main.c
@@ -23,6 +23,7 @@ static const cmark_node_type node_types[] = {
CMARK_NODE_PARAGRAPH,
CMARK_NODE_HEADER,
CMARK_NODE_HRULE,
+ CMARK_NODE_REFERENCE_DEF,
CMARK_NODE_TEXT,
CMARK_NODE_SOFTBREAK,
CMARK_NODE_LINEBREAK,
@@ -424,7 +425,8 @@ hierarchy(test_batch_runner *runner)
(1 << CMARK_NODE_HTML) |
(1 << CMARK_NODE_PARAGRAPH) |
(1 << CMARK_NODE_HEADER) |
- (1 << CMARK_NODE_HRULE);
+ (1 << CMARK_NODE_HRULE) |
+ (1 << CMARK_NODE_REFERENCE_DEF);
int all_inlines =
(1 << CMARK_NODE_TEXT) |
(1 << CMARK_NODE_SOFTBREAK) |
@@ -445,6 +447,7 @@ hierarchy(test_batch_runner *runner)
test_content(runner, CMARK_NODE_PARAGRAPH, all_inlines);
test_content(runner, CMARK_NODE_HEADER, all_inlines);
test_content(runner, CMARK_NODE_HRULE, 0);
+ test_content(runner, CMARK_NODE_REFERENCE_DEF, 0);
test_content(runner, CMARK_NODE_TEXT, 0);
test_content(runner, CMARK_NODE_SOFTBREAK, 0);
test_content(runner, CMARK_NODE_LINEBREAK, 0);
diff --git a/man/man3/cmark.3 b/man/man3/cmark.3
@@ -43,9 +43,10 @@ typedef enum {
CMARK_NODE_PARAGRAPH,
CMARK_NODE_HEADER,
CMARK_NODE_HRULE,
+ CMARK_NODE_REFERENCE_DEF,
CMARK_NODE_FIRST_BLOCK = CMARK_NODE_DOCUMENT,
- CMARK_NODE_LAST_BLOCK = CMARK_NODE_HRULE,
+ CMARK_NODE_LAST_BLOCK = CMARK_NODE_REFERENCE_DEF,
/* Inline */
CMARK_NODE_TEXT,
diff --git a/src/cmark.h b/src/cmark.h
@@ -47,9 +47,10 @@ typedef enum {
CMARK_NODE_PARAGRAPH,
CMARK_NODE_HEADER,
CMARK_NODE_HRULE,
+ CMARK_NODE_REFERENCE_DEF,
CMARK_NODE_FIRST_BLOCK = CMARK_NODE_DOCUMENT,
- CMARK_NODE_LAST_BLOCK = CMARK_NODE_HRULE,
+ CMARK_NODE_LAST_BLOCK = CMARK_NODE_REFERENCE_DEF,
/* Inline */
CMARK_NODE_TEXT,
@@ -336,6 +337,7 @@ int cmark_walk(cmark_node *root, cmark_node_handler handler, void *state);
#define NODE_PARAGRAPH CMARK_NODE_PARAGRAPH
#define NODE_HEADER CMARK_NODE_HEADER
#define NODE_HRULE CMARK_NODE_HRULE
+ #define NODE_REFERENCE_DEF CMARK_NODE_REFERENCE_DEF
#define NODE_TEXT CMARK_NODE_TEXT
#define NODE_SOFTBREAK CMARK_NODE_SOFTBREAK
#define NODE_LINEBREAK CMARK_NODE_LINEBREAK
diff --git a/src/print.c b/src/print.c
@@ -88,6 +88,10 @@ static void render_nodes(strbuf* buffer, cmark_node* node, int indent)
print_str(buffer, node->string_content.ptr, -1);
strbuf_putc(buffer, '\n');
break;
+ case NODE_REFERENCE_DEF:
+ // skip
+ // strbuf_printf(buffer, "reference_def\n");
+ break;
case NODE_TEXT:
strbuf_printf(buffer, "text ");
print_str(buffer, node->as.literal.data, node->as.literal.len);