Commit f554bf1108c4103ea8714c04f938685c1d7a7d13

step 2024-01-08T20:55:54

Don't trim HTML block lines (MD_LINE_HTML) (#206) Markdown 0.30 doesn't mandate right-trimming the contents of HTML lines. Doing so is more work and breaks output compatibility with cmark, tested with https://github.com/commonmark/cmark/commit/9393560.

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/md4c.c b/src/md4c.c
index 3dbf929..a36fa93 100644
--- a/src/md4c.c
+++ b/src/md4c.c
@@ -6186,7 +6186,7 @@ md_analyze_line(MD_CTX* ctx, OFF beg, OFF* p_end,
     }
 
     /* Trim trailing spaces. */
-    if(line->type != MD_LINE_INDENTEDCODE  &&  line->type != MD_LINE_FENCEDCODE) {
+    if(line->type != MD_LINE_INDENTEDCODE  &&  line->type != MD_LINE_FENCEDCODE  && line->type != MD_LINE_HTML) {
         while(line->end > line->beg && CH(line->end-1) == _T(' '))
             line->end--;
     }