From 1b765f4902a34383368878874cbc2d8134fbba34 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 9 Apr 2016 12:56:27 -0700 Subject: Correctly handle list marker followed only by spaces. This change allows us to pass the new test introduced in 75f231503d2b5854f1ff517402d2751811295bf7. Previously when a list marker was followed only by spaces, cmark expected the following content to be indented by the same number of spaces. But in this case we should treat the line just like a blank line and set list padding accordingly. --- src/blocks.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/blocks.c') diff --git a/src/blocks.c b/src/blocks.c index f49ad4e..a22594e 100644 --- a/src/blocks.c +++ b/src/blocks.c @@ -945,7 +945,9 @@ static void open_new_blocks(cmark_parser *parser, } i = parser->column - save_column; - if (i >= 5 || i < 1) { + if (i >= 5 || i < 1 || + // only spaces after list marker: + S_is_line_end_char(peek_at(input, parser->offset)) ) { data->padding = matched + 1; parser->offset = save_offset; parser->column = save_column; -- cgit v1.2.3