From acac9428faa1c3193fb44b3fb0e2dd3cbdaa4ac9 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 22 Nov 2014 21:22:26 -0800 Subject: Renamed NODE_BQUOTE -> NODE_BLOCK_QUOTE. --- api_test/main.c | 12 ++++++------ src/blocks.c | 8 ++++---- src/cmark.h | 4 ++-- src/html/html.c | 6 +++--- src/node.c | 4 ++-- src/print.c | 2 +- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/api_test/main.c b/api_test/main.c index b3b5b5a..4ee3546 100644 --- a/api_test/main.c +++ b/api_test/main.c @@ -10,7 +10,7 @@ static const cmark_node_type node_types[] = { CMARK_NODE_DOCUMENT, - CMARK_NODE_BQUOTE, + CMARK_NODE_BLOCK_QUOTE, CMARK_NODE_LIST, CMARK_NODE_LIST_ITEM, CMARK_NODE_FENCED_CODE, @@ -353,9 +353,9 @@ create_tree(test_batch_runner *runner) void hierarchy(test_batch_runner *runner) { - cmark_node *bquote1 = cmark_node_new(CMARK_NODE_BQUOTE); - cmark_node *bquote2 = cmark_node_new(CMARK_NODE_BQUOTE); - cmark_node *bquote3 = cmark_node_new(CMARK_NODE_BQUOTE); + cmark_node *bquote1 = cmark_node_new(CMARK_NODE_BLOCK_QUOTE); + cmark_node *bquote2 = cmark_node_new(CMARK_NODE_BLOCK_QUOTE); + cmark_node *bquote3 = cmark_node_new(CMARK_NODE_BLOCK_QUOTE); OK(runner, cmark_node_append_child(bquote1, bquote2), "append bquote2"); @@ -374,7 +374,7 @@ hierarchy(test_batch_runner *runner) int list_item_flag = 1 << CMARK_NODE_LIST_ITEM; int top_level_blocks = - (1 << CMARK_NODE_BQUOTE) | + (1 << CMARK_NODE_BLOCK_QUOTE) | (1 << CMARK_NODE_LIST) | (1 << CMARK_NODE_FENCED_CODE) | (1 << CMARK_NODE_INDENTED_CODE) | @@ -396,7 +396,7 @@ hierarchy(test_batch_runner *runner) (1 << CMARK_NODE_IMAGE); test_content(runner, CMARK_NODE_DOCUMENT, top_level_blocks); - test_content(runner, CMARK_NODE_BQUOTE, top_level_blocks); + test_content(runner, CMARK_NODE_BLOCK_QUOTE, top_level_blocks); test_content(runner, CMARK_NODE_LIST, list_item_flag); test_content(runner, CMARK_NODE_LIST_ITEM, top_level_blocks); test_content(runner, CMARK_NODE_FENCED_CODE, 0); diff --git a/src/blocks.c b/src/blocks.c index 7def4c8..2a6cdd8 100644 --- a/src/blocks.c +++ b/src/blocks.c @@ -89,7 +89,7 @@ static bool is_blank(strbuf *s, int offset) static inline bool can_contain(cmark_node_type parent_type, cmark_node_type child_type) { return ( parent_type == NODE_DOCUMENT || - parent_type == NODE_BQUOTE || + parent_type == NODE_BLOCK_QUOTE || parent_type == NODE_LIST_ITEM || (parent_type == NODE_LIST && child_type == NODE_LIST_ITEM) ); } @@ -516,7 +516,7 @@ void cmark_process_line(cmark_doc_parser *parser, const char *buffer, indent = first_nonspace - offset; blank = peek_at(&input, first_nonspace) == '\n'; - if (container->type == NODE_BQUOTE) { + if (container->type == NODE_BLOCK_QUOTE) { matched = indent <= 3 && peek_at(&input, first_nonspace) == '>'; if (matched) { offset = first_nonspace + 1; @@ -620,7 +620,7 @@ void cmark_process_line(cmark_doc_parser *parser, const char *buffer, // optional following character if (peek_at(&input, offset) == ' ') offset++; - container = add_child(parser, container, NODE_BQUOTE, parser->line_number, offset + 1); + container = add_child(parser, container, NODE_BLOCK_QUOTE, parser->line_number, offset + 1); } else if ((matched = scan_atx_header_start(&input, first_nonspace))) { @@ -731,7 +731,7 @@ void cmark_process_line(cmark_doc_parser *parser, const char *buffer, // lists or breaking out of lists. we also don't set last_line_blank // on an empty list item. container->last_line_blank = (blank && - container->type != NODE_BQUOTE && + container->type != NODE_BLOCK_QUOTE && container->type != NODE_SETEXT_HEADER && container->type != NODE_FENCED_CODE && !(container->type == NODE_LIST_ITEM && diff --git a/src/cmark.h b/src/cmark.h index 6131024..3c185b6 100644 --- a/src/cmark.h +++ b/src/cmark.h @@ -13,7 +13,7 @@ extern "C" { typedef enum { // Block CMARK_NODE_DOCUMENT, - CMARK_NODE_BQUOTE, + CMARK_NODE_BLOCK_QUOTE, CMARK_NODE_LIST, CMARK_NODE_LIST_ITEM, CMARK_NODE_FENCED_CODE, @@ -197,7 +197,7 @@ char *cmark_markdown_to_html(const char *text, int len); #ifndef CMARK_NO_SHORT_NAMES #define NODE_DOCUMENT CMARK_NODE_DOCUMENT - #define NODE_BQUOTE CMARK_NODE_BQUOTE + #define NODE_BLOCK_QUOTE CMARK_NODE_BLOCK_QUOTE #define NODE_LIST CMARK_NODE_LIST #define NODE_LIST_ITEM CMARK_NODE_LIST_ITEM #define NODE_FENCED_CODE CMARK_NODE_FENCED_CODE diff --git a/src/html/html.c b/src/html/html.c index 889941c..0ce4443 100644 --- a/src/html/html.c +++ b/src/html/html.c @@ -109,10 +109,10 @@ static void node_to_html(strbuf *html, cmark_node *node) } break; - case NODE_BQUOTE: + case NODE_BLOCK_QUOTE: cr(html); strbuf_puts(html, "
\n"); - // BQUOTE doesn't use any of the 'as' structs, + // BLOCK_QUOTE doesn't use any of the 'as' structs, // so the 'list' member can be used to store the // current value of 'tight'. cur->as.list.tight = tight; @@ -290,7 +290,7 @@ finish_node(strbuf *html, cmark_node *node, bool tight) } break; - case NODE_BQUOTE: { + case NODE_BLOCK_QUOTE: { cmark_list *list = &node->as.list; strbuf_puts(html, "
\n"); // Restore old 'tight' value. diff --git a/src/node.c b/src/node.c index a79dd82..35e19d2 100644 --- a/src/node.c +++ b/src/node.c @@ -51,7 +51,7 @@ S_type_string(cmark_node *node) { switch (node->type) { case CMARK_NODE_DOCUMENT: return "DOCUMENT"; - case CMARK_NODE_BQUOTE: return "BQUOTE"; + case CMARK_NODE_BLOCK_QUOTE: return "BLOCK_QUOTE"; case CMARK_NODE_LIST: return "LIST"; case CMARK_NODE_LIST_ITEM: return "LIST_ITEM"; case CMARK_NODE_FENCED_CODE: return "FENCED_CODE"; @@ -384,7 +384,7 @@ S_can_contain(cmark_node *node, cmark_node *child) switch (node->type) { case CMARK_NODE_DOCUMENT: - case CMARK_NODE_BQUOTE: + case CMARK_NODE_BLOCK_QUOTE: case CMARK_NODE_LIST_ITEM: return S_is_block(child) && child->type != CMARK_NODE_LIST_ITEM; diff --git a/src/print.c b/src/print.c index c8bf5f5..b1bab4b 100644 --- a/src/print.c +++ b/src/print.c @@ -110,7 +110,7 @@ static void print_blocks(cmark_node* b, int indent) printf("document\n"); print_blocks(b->first_child, indent + 2); break; - case NODE_BQUOTE: + case NODE_BLOCK_QUOTE: printf("block_quote\n"); print_blocks(b->first_child, indent + 2); break; -- cgit v1.2.3