summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorShi Yan <billconan@gmail.com>2017-08-22 07:00:25 (GMT)
committerShi Yan <billconan@gmail.com>2017-08-22 07:00:25 (GMT)
commit141dbfd5a4f79c98da14a1b414c6db4e1b34618b (patch)
tree264393e6013fcffcf3a2d913c521d5ab012776a2 /src
parent76d2c2f71602c7797ad8fdb7b22cedc37f998476 (diff)
downloadDoxygen-141dbfd5a4f79c98da14a1b414c6db4e1b34618b.zip
Doxygen-141dbfd5a4f79c98da14a1b414c6db4e1b34618b.tar.gz
Doxygen-141dbfd5a4f79c98da14a1b414c6db4e1b34618b.tar.bz2
Add language type attribute to programlisting tag
The current programlisting tag doesn't have any attribute to indicate the code's language. This makes code highlighting customization difficult. For example, the current doxygen generated document doesn't hightlight javascript code block. If one wants to customize the code block by parsing the xml files and uses 3rd party syntax highlighter, there is no way to tell from the xml file what language the code snippet is using. This change introduces an attribute "lang" to the programlisting tag.
Diffstat (limited to 'src')
-rw-r--r--src/xmldocvisitor.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/xmldocvisitor.cpp b/src/xmldocvisitor.cpp
index 815759e..ae36980 100644
--- a/src/xmldocvisitor.cpp
+++ b/src/xmldocvisitor.cpp
@@ -211,7 +211,7 @@ void XmlDocVisitor::visit(DocVerbatim *s)
switch(s->type())
{
case DocVerbatim::Code: // fall though
- m_t << "<programlisting>";
+ m_t << "<programlisting lang=\"" << lang << "\">";
Doxygen::parserManager->getParser(lang)
->parseCode(m_ci,s->context(),s->text(),langExt,
s->isExample(),s->exampleFile());