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 b0ac9ef4d3f441c5eb8421facf3e7d1dc2469b18
parent c7083d88bf77594a69f6c00f0b895526fe9606c7
Author: Martin Mitas <mity@morous.org>
Date:   Thu,  1 Dec 2016 18:18:10 +0100

md_analyze_line: Ordered list can interrupt paragraph only if start index is 1.

Diffstat:
Mmd4c/md4c.c | 8+++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/md4c/md4c.c b/md4c/md4c.c @@ -4913,8 +4913,14 @@ redo: line->indent = md_line_indentation(ctx, total_indent, off, &off); total_indent += line->indent; - if((off >= ctx->size || ISNEWLINE(off)) && pivot_line->type == MD_LINE_TEXT && n_parents == ctx->n_containers) { + if(pivot_line->type == MD_LINE_TEXT && n_parents == ctx->n_containers && + (off >= ctx->size || ISNEWLINE(off))) + { /* Noop. List mark followed by a blank line cannot interrupt a paragraph. */ + } else if(pivot_line->type == MD_LINE_TEXT && n_parents == ctx->n_containers && + (container.ch == _T('.') || container.ch == _T(')')) && container.start != 1) + { + /* Noop. Ordered list cannot interrupt a paragraph unless the start index is 1. */ } else { line->beg = off;