summaryrefslogtreecommitdiff
path: root/src/blocks.c
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-12-14 13:49:53 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2014-12-14 14:03:57 -0800
commit37554bbb7901b7116e1a5006f331968444141b76 (patch)
tree9307d76a0c83f2e36158269d15f72fd565dd7c56 /src/blocks.c
parent1014764a109e7f8f47d466080962f5f344287277 (diff)
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.
Diffstat (limited to 'src/blocks.c')
-rw-r--r--src/blocks.c8
1 files changed, 6 insertions, 2 deletions
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