md_analyze_line: Handle better indentation after list item mark.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
diff --git a/md4c/md4c.c b/md4c/md4c.c
index e64f547..156007e 100644
--- a/md4c/md4c.c
+++ b/md4c/md4c.c
@@ -4754,8 +4754,6 @@ md_analyze_line(MD_CTX* ctx, OFF beg, OFF* p_end,
/* Block quote mark. */
off++;
total_indent++;
- //if(off < ctx->size && CH(off) == _T(' '))
- //off++;
line->indent = md_line_indentation(ctx, total_indent, off, &off);
total_indent += line->indent;
@@ -4896,19 +4894,19 @@ redo:
if(md_is_container_mark(ctx, line->indent, off, &off, &container)) {
total_indent += container.contents_indent - container.mark_indent;
- /* One following space (if present) is part of the mark.
- * (Note '\t' stands for spaces up to the next tab stop.) */
- if(off < ctx->size && ISBLANK(off)) {
- container.contents_indent++;
- total_indent++;
- if(CH(off) != _T('\t') || (total_indent & 3) == 3)
- off++;
- }
-
line->indent = md_line_indentation(ctx, total_indent, off, &off);
total_indent += line->indent;
line->beg = off;
+ /* Some of the following whitespace actually still belongs to the mark. */
+ if(line->indent <= 4) {
+ container.contents_indent += line->indent;
+ line->indent = 0;
+ } else {
+ container.contents_indent += 1;
+ line->indent--;
+ }
+
if(n_brothers + n_children == 0) {
pivot_line = &md_dummy_blank_line;