md4c

C Markdown parser. Fast. SAX-like interface. Compliant to CommonMark specification.
git clone https://noulin.net/git/md4c.git
Log | Files | Refs | README | LICENSE

commit fa112a283547e9688c7b4e20e0de155555bd17b8
parent 269fed70765f8b69993fc3ee438a3cafa5e86d75
Author: Martin Mitas <mity@morous.org>
Date:   Sat,  8 Oct 2016 22:11:03 +0200

Fix: Do not right trim lines in code block.

Diffstat:
Mmd4c/md4c.c | 6++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git 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'))