Fix: Check fir indented code block with higher priority then for blockquote.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
diff --git a/md4c/md4c.c b/md4c/md4c.c
index 94827ae..1ee3e20 100644
--- 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('#')) {