diff options
author | John MacFarlane <jgm@berkeley.edu> | 2014-11-23 06:54:53 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2014-11-23 06:54:53 -0800 |
commit | 8ba087276c6cae9e1efde656ae973b4f714c88be (patch) | |
tree | bf90502882077bb8c7ea8bc041843c88c92a6526 /src/node.c | |
parent | d929a2983db96be22277c2052ea61cd8ec7ac6f1 (diff) |
Revert "Revert "Remove distinction btw atx and setext header in AST.""
This reverts commit 4570eb2bff2e1b71fa5b6408abbc69c98ff5ff24.
Diffstat (limited to 'src/node.c')
-rw-r--r-- | src/node.c | 15 |
1 files changed, 5 insertions, 10 deletions
@@ -13,8 +13,7 @@ cmark_node_new(cmark_node_type type) { node->type = type; switch (node->type) { - case CMARK_NODE_ATX_HEADER: - case CMARK_NODE_SETEXT_HEADER: + case CMARK_NODE_HEADER: node->as.header.level = 1; break; @@ -58,8 +57,7 @@ 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_ATX_HEADER: return "ATX_HEADER"; - case CMARK_NODE_SETEXT_HEADER: return "SETEXT_HEADER"; + case CMARK_NODE_HEADER: return "HEADER"; case CMARK_NODE_HRULE: return "HRULE"; case CMARK_NODE_REFERENCE_DEF: return "REFERENCE_DEF"; case CMARK_NODE_STRING: return "STRING"; @@ -159,8 +157,7 @@ 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_ATX_HEADER: - case CMARK_NODE_SETEXT_HEADER: + case CMARK_NODE_HEADER: return node->as.header.level; default: @@ -177,8 +174,7 @@ cmark_node_set_header_level(cmark_node *node, int level) { } switch (node->type) { - case CMARK_NODE_ATX_HEADER: - case CMARK_NODE_SETEXT_HEADER: + case CMARK_NODE_HEADER: node->as.header.level = level; return 1; @@ -393,8 +389,7 @@ S_can_contain(cmark_node *node, cmark_node *child) return child->type == CMARK_NODE_LIST_ITEM; case CMARK_NODE_PARAGRAPH: - case CMARK_NODE_ATX_HEADER: - case CMARK_NODE_SETEXT_HEADER: + case CMARK_NODE_HEADER: case CMARK_NODE_EMPH: case CMARK_NODE_STRONG: case CMARK_NODE_LINK: |