add a 'section_break' flag into the line structure to keep the contents of adjacent blockquote chunks as separate blocks inside the blockquote

This commit is contained in:
jessica parsons
2026-06-09 12:07:54 -07:00
parent 39be61ef2c
commit a55e87e63d
4 changed files with 18 additions and 1 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* mkdio -- markdown front end input functions
* mkd_basename -- a url callback function that adds a prefix to an absolute path.
*
* Copyright (C) 2007 Jessica L Parsons.
* The redistribution terms are provided in the COPYRIGHT file that must
+4
View File
@@ -684,6 +684,8 @@ fencedcodechunk(Line *first, mkd_flag_t *flags, int *yes)
* past the closing fence
*/
for ( r = first->next; r; r = r->next ) {
if ( r->section_break )
break;
if ( iscodefence(r, first, flags) ) {
if (S(first->text) - first->count > 0) {
char *lang_attr = T(first->text) + first->count;
@@ -856,6 +858,8 @@ quoteblock(Paragraph *p, mkd_flag_t *flags)
t = q;
break;
}
if ( q != t->next )
t->section_break = 1;
}
if ( isdivmarker(p->text,0,flags) ) {
char *prefix = "class";
+1
View File
@@ -85,6 +85,7 @@ typedef struct line {
int has_pipechar; /* line contains a | */
int is_checked;
line_type kind;
int section_break; /* paragraph break in blockquote */
int is_fenced; /* line inside a fenced code block (ick) */
char *fence_class; /* fenced code class (ick) */
int count;
+12
View File
@@ -80,6 +80,18 @@ code
</code></pre>
</blockquote>'
try -ffencedcode 'fenced code block in two adjacent blockquote chunks' \
'>~~~~
> not code
> still not code
> ~~~~ ' \
'<blockquote><p>~~~~
not code</p>
<p>still not code
~~~~</p></blockquote>'
try -ffencedcode 'unterminated fenced code block' \
'~~~
code' \