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 3ec2a19596cdd1131046193509ca26ccc4f05d9a
parent f9b4cb8f6e33d04b9940cb6e77ea6987e1888b88
Author: Martin Mitas <mity@morous.org>
Date:   Thu, 15 Dec 2016 23:57:58 +0100

md_analyze_backtick: Ensire that code span opener and closer do not overlap.

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

diff --git a/md4c/md4c.c b/md4c/md4c.c @@ -2685,8 +2685,10 @@ md_analyze_backtick(MD_CTX* ctx, int mark_index) * itself to swallow it. */ while(CH(opener->end) == _T(' ') || ISNEWLINE(opener->end)) opener->end++; - while(CH(mark->beg-1) == _T(' ') || ISNEWLINE(mark->beg-1)) - mark->beg--; + if(mark->beg > opener->end) { + while(CH(mark->beg-1) == _T(' ') || ISNEWLINE(mark->beg-1)) + mark->beg--; + } /* Done. */ return;