mirror of
https://github.com/Orc/discount.git
synced 2026-09-25 04:10:00 +03:00
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:
+1
-1
@@ -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
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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' \
|
||||
|
||||
Reference in New Issue
Block a user