summaryrefslogtreecommitdiffstats
path: root/src/markdown.cpp
diff options
context:
space:
mode:
authoralbert-github <albert.tests@gmail.com>2021-01-07 17:20:17 (GMT)
committeralbert-github <albert.tests@gmail.com>2021-01-07 17:20:17 (GMT)
commit6213c408be49685c6d9909b8ec09be5ae9680598 (patch)
tree04f2f1158275eacf41224b542906df8d39e07a15 /src/markdown.cpp
parent3f4717ec5583dde8116205e1045095158ab56c15 (diff)
downloadDoxygen-6213c408be49685c6d9909b8ec09be5ae9680598.zip
Doxygen-6213c408be49685c6d9909b8ec09be5ae9680598.tar.gz
Doxygen-6213c408be49685c6d9909b8ec09be5ae9680598.tar.bz2
issue #8308 Verbatim block followed by markdown header breaks verbatim block
Skip block commands.
Diffstat (limited to 'src/markdown.cpp')
-rw-r--r--src/markdown.cpp36
1 files changed, 35 insertions, 1 deletions
diff --git a/src/markdown.cpp b/src/markdown.cpp
index 93d143d..2bc8206 100644
--- a/src/markdown.cpp
+++ b/src/markdown.cpp
@@ -2399,7 +2399,41 @@ QCString Markdown::processBlocks(const QCString &s,int indent)
QCString lang;
blockIndent = indent;
//printf("isHeaderLine(%s)=%d\n",QCString(data+i).left(size-i).data(),level);
- if ((level=isHeaderline(data+i,size-i,TRUE))>0)
+ QCString endBlockName;
+ if (data[i]=='@' || data[i]=='\\') endBlockName = isBlockCommand(data+i,i,size-i);
+ if (!endBlockName.isEmpty())
+ {
+ // handle previous line
+ if (isLinkRef(data+pi,i-pi,id,link,title))
+ {
+ m_linkRefs.insert({id.lower().str(),LinkRef(link,title)});
+ }
+ else
+ {
+ writeOneLineHeaderOrRuler(data+pi,i-pi);
+ }
+ m_out.addChar(data[i]);
+ i++;
+ int l = endBlockName.length();
+ while (i<size-l)
+ {
+ if ((data[i]=='\\' || data[i]=='@') && // command
+ data[i-1]!='\\' && data[i-1]!='@') // not escaped
+ {
+ if (qstrncmp(&data[i+1],endBlockName,l)==0)
+ {
+ m_out.addChar(data[i]);
+ m_out.addStr(endBlockName);
+ pi=i;
+ i+=l+1;
+ break;
+ }
+ }
+ m_out.addChar(data[i]);
+ i++;
+ }
+ }
+ else if ((level=isHeaderline(data+i,size-i,TRUE))>0)
{
//printf("Found header at %d-%d\n",i,end);
while (pi<size && data[pi]==' ') pi++;