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 088ff08a7dfeab02c987ab60f4f70383aec6af84
parent fcc100768ed74f3e33226d5f79c7df2e4f89a27a
Author: Martin Mitas <mity@morous.org>
Date:   Sun,  9 Oct 2016 00:08:24 +0200

Fix: Check fir indented code block with higher priority then for blockquote.

Diffstat:
Mmd4c/md4c.c | 20++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/md4c/md4c.c b/md4c/md4c.c @@ -1540,6 +1540,16 @@ redo_indentation_after_blockquote_mark: goto done; } + /* Check whether we are indented code line. + * Note indented code block cannot interrupt paragraph. */ + if((pivot_line->type == MD_LINE_BLANK || pivot_line->type == MD_LINE_INDENTEDCODE) + && line->indent >= ctx->code_indent_offset) + { + line->type = MD_LINE_INDENTEDCODE; + line->indent -= ctx->code_indent_offset; + goto done; + } + /* Check blockquote mark. */ if(off < ctx->size && CH(off) == _T('>')) { off++; @@ -1581,16 +1591,6 @@ redo_indentation_after_blockquote_mark: goto done; } - /* Check whether we are indented code line. - * Note indented code block cannot interrupt paragraph. */ - if((pivot_line->type == MD_LINE_BLANK || pivot_line->type == MD_LINE_INDENTEDCODE) - && line->indent >= ctx->code_indent_offset) - { - line->type = MD_LINE_INDENTEDCODE; - line->indent -= ctx->code_indent_offset; - goto done; - } - /* Check whether we are ATX header. * (We check the indentation to fix http://spec.commonmark.org/0.26/#example-40) */ if(line->indent < ctx->code_indent_offset && CH(off) == _T('#')) {