Skip to content

Commit d8bdc0f

Browse files
committed
Interaction between markdown blockquotes and sections
In an example (Fossies) I found the code like: ``` @page pg1 page > text ## section ``` and this results in the warning like: ``` warning: found </blockquote> tag without matching <blockquote> ``` so it is better to terminate the block quote when a potential section command appears
1 parent 83118ee commit d8bdc0f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/markdown.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2854,6 +2854,9 @@ size_t Markdown::Private::writeBlockQuote(std::string_view data)
28542854
}
28552855
else
28562856
{
2857+
curLevel=level;
2858+
i = indent;
2859+
if (txt[0] == '#') break; // begin of markdown section command
28572860
out += txt;
28582861
}
28592862
isGitHubFirst = false;
@@ -2875,6 +2878,7 @@ size_t Markdown::Private::writeBlockQuote(std::string_view data)
28752878
{
28762879
out+="</blockquote>";
28772880
}
2881+
out+="\\ilinebr ";
28782882
AUTO_TRACE_EXIT("i={}",i);
28792883
return i;
28802884
}

0 commit comments

Comments
 (0)