summaryrefslogtreecommitdiffstats
path: root/src/mandocvisitor.cpp
diff options
context:
space:
mode:
authoralbert-github <albert.tests@gmail.com>2019-06-06 10:22:42 (GMT)
committeralbert-github <albert.tests@gmail.com>2019-06-06 10:22:42 (GMT)
commit313cc456d52ccf41f7b32adc3d0400cb7992549d (patch)
treecb32ee79524baadb3538764c75eca46c6babbffa /src/mandocvisitor.cpp
parente773e6cb9e117621e06fb81098d33417e8a97720 (diff)
downloadDoxygen-313cc456d52ccf41f7b32adc3d0400cb7992549d.zip
Doxygen-313cc456d52ccf41f7b32adc3d0400cb7992549d.tar.gz
Doxygen-313cc456d52ccf41f7b32adc3d0400cb7992549d.tar.bz2
issue #7033 Syntax highlighting doesn't work when calling \dontinclude from Markdown files
Don't use the file name extension of the including file but of the included file. In case of no included filename or no extension, fall back of the file extension of the including file.
Diffstat (limited to 'src/mandocvisitor.cpp')
-rw-r--r--src/mandocvisitor.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mandocvisitor.cpp b/src/mandocvisitor.cpp
index 5c98c6f..e407642 100644
--- a/src/mandocvisitor.cpp
+++ b/src/mandocvisitor.cpp
@@ -367,7 +367,9 @@ void ManDocVisitor::visit(DocInclude *inc)
void ManDocVisitor::visit(DocIncOperator *op)
{
- SrcLangExt langExt = getLanguageFromFileName(m_langExt);
+ QCString locLangExt = getFileNameExtension(op->includeFileName());
+ if (locLangExt.isEmpty()) locLangExt = m_langExt;
+ SrcLangExt langExt = getLanguageFromFileName(locLangExt);
//printf("DocIncOperator: type=%d first=%d, last=%d text=`%s'\n",
// op->type(),op->isFirst(),op->isLast(),op->text().data());
if (op->isFirst())
@@ -393,7 +395,7 @@ void ManDocVisitor::visit(DocIncOperator *op)
fd = createFileDef( cfi.dirPath().utf8(), cfi.fileName().utf8() );
}
- Doxygen::parserManager->getParser(m_langExt)
+ Doxygen::parserManager->getParser(locLangExt)
->parseCode(m_ci,op->context(),op->text(),langExt,
op->isExample(),op->exampleFile(),
fd, // fileDef