cmark

Unnamed repository; edit this file 'description' to name the repository.

commit 1b765f4902a34383368878874cbc2d8134fbba34
parent 75f231503d2b5854f1ff517402d2751811295bf7
Author: John MacFarlane <jgm@berkeley.edu>
Date:   Sat,  9 Apr 2016 12:56:27 -0700

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.

Diffstat:
Msrc/blocks.c | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git 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;