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 c2eca50a1c844d6fa6b940b5ab917dcfe5bcce39
parent f06fe013e2e51b0fb49826fde0010d22989174af
Author: Martin Mitas <mity@morous.org>
Date:   Wed,  5 Oct 2016 11:33:25 +0200

'\\' at the end of block does not cause hard break.

Diffstat:
Mmd4c/md4c.c | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/md4c/md4c.c b/md4c/md4c.c @@ -379,7 +379,9 @@ md_analyze_inlines(MD_CTX* ctx, const MD_LINE* lines, int n_lines) * Note it can go beyond line->end as it may involve * escaped new line to form a hard break. */ if(ch == _T('\\') && off+1 < ctx->size && (ISPUNCT(off+1) || ISNEWLINE(off+1))) { - PUSH(ch, off, off+2, MD_MARK_ACTIVE); + /* Hard-break cannot be on the last line of the block. */ + if(!ISNEWLINE(off+1) || i+1 < n_lines) + PUSH(ch, off, off+2, MD_MARK_ACTIVE); off += 2; continue; }