From 37554bbb7901b7116e1a5006f331968444141b76 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 14 Dec 2014 13:49:53 -0800 Subject: Use as.literal instead of string_content for HTML and code blocks. This is for consistency with the other types of nodes that have literal strings as contents. --- src/blocks.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/blocks.c') diff --git a/src/blocks.c b/src/blocks.c index 7648c96..18a6536 100644 --- a/src/blocks.c +++ b/src/blocks.c @@ -215,7 +215,6 @@ finalize(cmark_parser *parser, cmark_node* b, int line_number) if (!b->as.code.fenced) { // indented code remove_trailing_blank_lines(&b->string_content); strbuf_putc(&b->string_content, '\n'); - break; } else { // first line of contents becomes info @@ -231,8 +230,13 @@ finalize(cmark_parser *parser, cmark_node* b, int line_number) strbuf_trim(&b->as.code.info); strbuf_unescape(&b->as.code.info); - break; } + b->as.literal = chunk_buf_detach(&b->string_content); + break; + + case NODE_HTML: + b->as.literal = chunk_buf_detach(&b->string_content); + break; case NODE_LIST: // determine tight/loose status b->as.list.tight = true; // tight by default -- cgit v1.2.3