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 24ac7eadd8d6168456f297a0775bfddb0dea37db
parent 0832e11363c171f4aa238fedc1b073471b2c784a
Author: Martin Mitas <mity@morous.org>
Date:   Sat,  8 Oct 2016 20:55:53 +0200

Fix parsing of ATX headers.

If indented, it cannot be ATX header.

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

diff --git a/md4c/md4c.c b/md4c/md4c.c @@ -1564,8 +1564,9 @@ redo_indentation_after_blockquote_mark: goto done; } - /* Check whether we are ATX header. */ - if(CH(off) == _T('#')) { + /* Check whether we are ATX header. + * (We check the indentation to fix http://spec.commonmark.org/0.26/#example-40) */ + if(line->indent < 4 && CH(off) == _T('#')) { if(md_is_atxheader_line(ctx, off, &line->beg, &off) == 0) { line->type = MD_LINE_ATXHEADER; goto done;