diff options
author | albert-github <albert.tests@gmail.com> | 2021-01-17 12:54:35 (GMT) |
---|---|---|
committer | albert-github <albert.tests@gmail.com> | 2021-01-17 12:54:35 (GMT) |
commit | 4fd8254c903b251be91ab669f4d83cb86ebaf499 (patch) | |
tree | 09f9d49c1cba95de282ee9a5359e60c201f71ccc /src/mandocvisitor.cpp | |
parent | 37dbd4bdf65d21dba0d81940e74801a5504f9c34 (diff) | |
download | Doxygen-4fd8254c903b251be91ab669f4d83cb86ebaf499.zip Doxygen-4fd8254c903b251be91ab669f4d83cb86ebaf499.tar.gz Doxygen-4fd8254c903b251be91ab669f4d83cb86ebaf499.tar.bz2 |
Use language name to get code coloring
In a `\code` or `~~~` or ` ``` ` environment we can define the language of a code block by specifying an extension.
In markdown we see quite often the language name as code block name (especially for `python`)
One can specify it by means of an `EXTENSION_MAPPING` but this is quite unnatural as it it not an extension.
- see to it that the extension (and thus `EXTENSION_MAPPING`) still has precedence
- in case not a known extension, try the language names.
Note: with docbook the explicit name usage was missing.
Diffstat (limited to 'src/mandocvisitor.cpp')
-rw-r--r-- | src/mandocvisitor.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mandocvisitor.cpp b/src/mandocvisitor.cpp index 875cd14..95d15f8 100644 --- a/src/mandocvisitor.cpp +++ b/src/mandocvisitor.cpp @@ -195,10 +195,10 @@ void ManDocVisitor::visit(DocVerbatim *s) { lang = s->language(); } - SrcLangExt langExt = getLanguageFromFileName(lang); + SrcLangExt langExt = getLanguageFromCodeLang(lang); switch (s->type()) { - case DocVerbatim::Code: // fall though + case DocVerbatim::Code: if (!m_firstCol) m_t << endl; m_t << ".PP" << endl; m_t << ".nf" << endl; |