Commit fa112a283547e9688c7b4e20e0de155555bd17b8

Martin Mitas 2016-10-08T22:11:03

Fix: Do not right trim lines in code block.

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 5286f36..8691b0e 100644
--- a/md4c/md4c.c
+++ b/md4c/md4c.c
@@ -1636,8 +1636,10 @@ done:
     }
 
     /* Trim tailing spaces. */
-    while(line->end > line->beg && CH(line->end-1) == _T(' '))
-        line->end--;
+    if(line->type != MD_LINE_INDENTEDCODE  &&  line->type != MD_LINE_FENCEDCODE) {
+        while(line->end > line->beg && CH(line->end-1) == _T(' '))
+            line->end--;
+    }
 
     /* Eat also the new line. */
     if(off < ctx->size && CH(off) == _T('\r'))