Commit 4e416f1be1fa51e94051ffa5f191f76fcc8ff495

Martin Mitas 2016-12-01T22:09:38

md_analyze_line: Fix blank lines inside a fenced code block when nested in a container.

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 9e1538a..07e415d 100644
--- a/md4c/md4c.c
+++ b/md4c/md4c.c
@@ -4802,6 +4802,15 @@ redo:
             }
         }
 
+        if(off >= ctx->size  ||  ISNEWLINE(off)) {
+            /* Blank line does not need any real indentation to be nested inside
+             * a list. */
+            if(n_brothers + n_children == 0) {
+                while(n_parents < ctx->n_containers  &&  ctx->containers[n_parents].ch != _T('>'))
+                    n_parents++;
+            }
+        }
+
         /* Change indentation accordingly to the initial code fence. */
         if(n_parents == ctx->n_containers) {
             if(line->indent > pivot_line->indent)