cmark

My personal build of CMark ✏️

Commit
1b765f4902a34383368878874cbc2d8134fbba34
Parent
75f231503d2b5854f1ff517402d2751811295bf7
Author
John MacFarlane <jgm@berkeley.edu>
Date

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

1 file changed, 3 insertions, 1 deletion

Status File Name N° Changes Insertions Deletions
Modified src/blocks.c 4 3 1
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;