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 950b4d736cd934ef9934f596565c8014fb6ed57b
parent 4f65b45bd6e1a979beefd43cd124e08b83a258ed
Author: Martin Mitas <mity@morous.org>
Date:   Sat,  8 Oct 2016 20:46:33 +0200

Fix handlint of '\t' in some situations.

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

diff --git a/md4c/md4c.c b/md4c/md4c.c @@ -1173,7 +1173,7 @@ md_is_hr_line(MD_CTX* ctx, OFF beg, OFF* p_end) OFF off = beg + 1; int n = 1; - while(off < ctx->size && (CH(off) == CH(beg) || CH(off) == _T(' '))) { + while(off < ctx->size && (CH(off) == CH(beg) || CH(off) == _T(' ') || CH(off) == _T('\t'))) { if(CH(off) == CH(beg)) n++; off++; @@ -1200,7 +1200,8 @@ md_is_atxheader_line(MD_CTX* ctx, OFF beg, OFF* p_beg, OFF* p_end) return -1; ctx->header_level = n; - if(!(ctx->r.flags & MD_FLAG_PERMISSIVEATXHEADERS) && off < ctx->size && CH(off) != _T(' ') && !ISNEWLINE(off)) + if(!(ctx->r.flags & MD_FLAG_PERMISSIVEATXHEADERS) && off < ctx->size && + CH(off) != _T(' ') && CH(off) != _T('\t') && !ISNEWLINE(off)) return -1; while(off < ctx->size && CH(off) == _T(' '))