Skip to content

Commit

Permalink
Don't trim HTML block lines (MD_LINE_HTML) (#206)
Browse files Browse the repository at this point in the history
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 commonmark/cmark@9393560.
  • Loading branch information
step- authored Jan 8, 2024
1 parent 4d2f8a2 commit f554bf1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/md4c.c
Original file line number Diff line number Diff line change
Expand Up @@ -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--;
}
Expand Down

0 comments on commit f554bf1

Please sign in to comment.