Commit 9b693331976957aa856a8c5a510b4d3e3ae3bfb3

Martin Mitas 2016-10-08T22:59:12

Fix: Fence code block indetation base is defined by indentation of opening code fence.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/md4c/md4c.c b/md4c/md4c.c
index 2f3d394..7a0a13c 100644
--- a/md4c/md4c.c
+++ b/md4c/md4c.c
@@ -1530,6 +1530,12 @@ redo_indentation_after_blockquote_mark:
             }
         }
 
+        /* Change indentation accordingly to the initial code fence. */
+        if(line->indent > pivot_line->indent)
+            line->indent -= pivot_line->indent;
+        else
+            line->indent = 0;
+
         line->type = MD_LINE_FENCEDCODE;
         goto done;
     }