From 8ba087276c6cae9e1efde656ae973b4f714c88be Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 23 Nov 2014 06:54:53 -0800 Subject: Revert "Revert "Remove distinction btw atx and setext header in AST."" This reverts commit 4570eb2bff2e1b71fa5b6408abbc69c98ff5ff24. --- src/node.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'src/node.c') diff --git a/src/node.c b/src/node.c index 35e19d2..3e51fec 100644 --- a/src/node.c +++ b/src/node.c @@ -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: -- cgit v1.2.3