summaryrefslogtreecommitdiff
path: root/src/node.c
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-11-22 22:39:26 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2014-11-22 22:39:26 -0800
commit4570eb2bff2e1b71fa5b6408abbc69c98ff5ff24 (patch)
tree16bab9f8f34dd6fc22a1b7f27b02b7f92b2939d6 /src/node.c
parenta71423f6ee1b77d9f79d42599ea00b4ca99f5da0 (diff)
Revert "Remove distinction btw atx and setext header in AST."
This reverts commit a71423f6ee1b77d9f79d42599ea00b4ca99f5da0. Not quite sure about this change, so reverting for now. Note that we still have a distinction between fenced and indented code blocks in the AST. These two distinctions seem to stand or fall together.
Diffstat (limited to 'src/node.c')
-rw-r--r--src/node.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/node.c b/src/node.c
index 3e51fec..35e19d2 100644
--- a/src/node.c
+++ b/src/node.c
@@ -13,7 +13,8 @@ cmark_node_new(cmark_node_type type) {
node->type = type;
switch (node->type) {
- case CMARK_NODE_HEADER:
+ case CMARK_NODE_ATX_HEADER:
+ case CMARK_NODE_SETEXT_HEADER:
node->as.header.level = 1;
break;
@@ -57,7 +58,8 @@ S_type_string(cmark_node *node)
case CMARK_NODE_INDENTED_CODE: return "INDENTED_CODE";
case CMARK_NODE_HTML: return "HTML";
case CMARK_NODE_PARAGRAPH: return "PARAGRAPH";
- case CMARK_NODE_HEADER: return "HEADER";
+ case CMARK_NODE_ATX_HEADER: return "ATX_HEADER";
+ case CMARK_NODE_SETEXT_HEADER: return "SETEXT_HEADER";
case CMARK_NODE_HRULE: return "HRULE";
case CMARK_NODE_REFERENCE_DEF: return "REFERENCE_DEF";
case CMARK_NODE_STRING: return "STRING";
@@ -157,7 +159,8 @@ cmark_node_set_string_content(cmark_node *node, const char *content) {
int
cmark_node_get_header_level(cmark_node *node) {
switch (node->type) {
- case CMARK_NODE_HEADER:
+ case CMARK_NODE_ATX_HEADER:
+ case CMARK_NODE_SETEXT_HEADER:
return node->as.header.level;
default:
@@ -174,7 +177,8 @@ cmark_node_set_header_level(cmark_node *node, int level) {
}
switch (node->type) {
- case CMARK_NODE_HEADER:
+ case CMARK_NODE_ATX_HEADER:
+ case CMARK_NODE_SETEXT_HEADER:
node->as.header.level = level;
return 1;
@@ -389,7 +393,8 @@ S_can_contain(cmark_node *node, cmark_node *child)
return child->type == CMARK_NODE_LIST_ITEM;
case CMARK_NODE_PARAGRAPH:
- case CMARK_NODE_HEADER:
+ case CMARK_NODE_ATX_HEADER:
+ case CMARK_NODE_SETEXT_HEADER:
case CMARK_NODE_EMPH:
case CMARK_NODE_STRONG:
case CMARK_NODE_LINK: