summaryrefslogtreecommitdiff
path: root/src/blocks.c
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-07-27 23:11:31 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2015-07-27 23:11:31 -0700
commitd9f5a3fe2555ecf9d64e392d8febf551c60ddbe5 (patch)
tree893a2c045a0bc126681710fb994032a0908c8fb8 /src/blocks.c
parent521c43cbdc0709b2b0fe4081c2349e4a3b86c984 (diff)
Disallow list item starting with multiple blank lines.
See jgm/CommonMark#332
Diffstat (limited to 'src/blocks.c')
-rw-r--r--src/blocks.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/blocks.c b/src/blocks.c
index c466fc2..9a8a9a6 100644
--- a/src/blocks.c
+++ b/src/blocks.c
@@ -635,7 +635,10 @@ static void S_process_line(cmark_parser *parser, const unsigned char *buffer,
S_advance_offset(parser, &input, container->as.list.marker_offset +
container->as.list.padding,
true);
- } else if (parser->blank) {
+ } else if (parser->blank && container->first_child != NULL) {
+ // if container->first_child is NULL, then the opening line
+ // of the list item was blank after the list marker; in this
+ // case, we are done with the list item.
S_advance_offset(parser, &input,
parser->first_nonspace - parser->offset, false);
} else {