From f554bf1108c4103ea8714c04f938685c1d7a7d13 Mon Sep 17 00:00:00 2001 From: step Date: Mon, 8 Jan 2024 20:55:54 +0100 Subject: [PATCH] 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. --- src/md4c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/md4c.c b/src/md4c.c index 3dbf9297..a36fa93d 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--; }