From 543628f9f4981031b60a2b2aecdc48b1eb6c1fa5 Mon Sep 17 00:00:00 2001 From: david parsons Date: Fri, 8 Apr 2022 23:54:20 -0700 Subject: [PATCH] the toplevel compilation pass needs to back out of an unclosed bit of fenced code --- markdown.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/markdown.c b/markdown.c index 7b08faf..8dce108 100644 --- a/markdown.c +++ b/markdown.c @@ -1243,10 +1243,16 @@ compile_document(Line *ptr, MMIOT *f) */ ATTACH(source,more); + Cache checkpoint = source; while ( (more = more->next) && !iscodefence(more, ptr->count, ptr->kind, &(f->flags)) ) ATTACH(source,more); - ptr = more; + if ( more ) + ptr = more; + else { + source = checkpoint; + ptr = ptr->next; + } } else { /* source; cache it up to wait for eof or the