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 4bb7cf8a4b4288c09ca4d5935a51091bd57b980d
parent 159c2ee3f541a4501b92033f804d0badbc3a8034
Author: Martin Mitas <mity@morous.org>
Date:   Sat, 26 Nov 2016 23:02:44 +0100

Fix handling a backslash inside an autolink.

This fixes this:

    <http://example.com/\[\>

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

diff --git a/md4c/md4c.c b/md4c/md4c.c @@ -2219,9 +2219,10 @@ md_collect_marks(MD_CTX* ctx, const MD_LINE* lines, int n_lines) if(!ISNEWLINE(off+1) || i+1 < n_lines) PUSH_MARK(ch, off, off+2, MD_MARK_RESOLVED); - /* If '`' follows, we need both marks as the backslash may be - * inside a code span. */ - if(CH(off+1) == _T('`')) + /* If '`' or '>' follows, we need both marks as the backslash + * may be inside a code span or an autolink where escaping is + * disabled. */ + if(CH(off+1) == _T('`') || CH(off+1) == _T('>')) off++; else off += 2;