summaryrefslogtreecommitdiff
path: root/src/blocks.c
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2016-04-09 12:56:27 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2016-04-09 12:57:06 -0700
commit1b765f4902a34383368878874cbc2d8134fbba34 (patch)
tree5a9560f7420315124635347e6b4af2c774068349 /src/blocks.c
parent75f231503d2b5854f1ff517402d2751811295bf7 (diff)
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 (limited to 'src/blocks.c')
-rw-r--r--src/blocks.c4
1 files changed, 3 insertions, 1 deletions
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;