Commit b0ac9ef4d3f441c5eb8421facf3e7d1dc2469b18

Martin Mitas 2016-12-01T18:18:10

md_analyze_line: Ordered list can interrupt paragraph only if start index is 1.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff --git a/md4c/md4c.c b/md4c/md4c.c
index 1261064..3232d37 100644
--- a/md4c/md4c.c
+++ b/md4c/md4c.c
@@ -4913,8 +4913,14 @@ redo:
         line->indent = md_line_indentation(ctx, total_indent, off, &off);
         total_indent += line->indent;
 
-        if((off >= ctx->size || ISNEWLINE(off))  &&  pivot_line->type == MD_LINE_TEXT  &&  n_parents == ctx->n_containers) {
+        if(pivot_line->type == MD_LINE_TEXT  &&  n_parents == ctx->n_containers  &&
+                    (off >= ctx->size || ISNEWLINE(off)))
+        {
             /* Noop. List mark followed by a blank line cannot interrupt a paragraph. */
+        } else if(pivot_line->type == MD_LINE_TEXT  &&  n_parents == ctx->n_containers  &&
+                    (container.ch == _T('.') || container.ch == _T(')'))  &&  container.start != 1)
+        {
+            /* Noop. Ordered list cannot interrupt a paragraph unless the start index is 1. */
         } else {
             line->beg = off;