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 0ed69376576c3b6929bb467f566faf57bf3db1ca
parent 7ada257faf891a9d796cefbbccd4c303cd7fcc2a
Author: Martin Mitas <mity@morous.org>
Date:   Mon,  7 Nov 2016 17:47:21 +0100

md_analyze_lt_gt: Fix assertion condition.

The variable detected_end is valid only for 'is_raw_html' case.

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

diff --git a/md4c/md4c.c b/md4c/md4c.c @@ -1338,14 +1338,14 @@ md_analyze_lt_gt(MD_CTX* ctx, int mark_index, const MD_LINE* lines, int n_lines) /* Check whether the range forms a valid raw HTML. */ if(is_autolink || is_raw_html) { - /* If this fails, it means we have missed some earlier opportunity - * to resolve the opener. */ - MD_ASSERT(detected_end == mark->end); - md_rollback(ctx, opener_index, mark_index, MD_ROLLBACK_ALL); md_resolve_range(ctx, &LOWERTHEN_OPENERS, opener_index, mark_index); if(is_raw_html) { + /* If this fails, it means we have missed some earlier opportunity + * to resolve the opener of raw HTML. */ + MD_ASSERT(detected_end == mark->end); + /* Make these marks zero width so the '<' and '>' are part of its * contents. */ opener->end = opener->beg;