Skip to content

Commit 706a414

Browse files
committed
Possibility to use verbatim parts in tblr tables.
Possibility to use verbatim parts in `tblr` tables, i.e. when in a table we switch to `DoxyCode` and do some filtering.
1 parent 445ff9a commit 706a414

File tree

1 file changed

+24
-6
lines changed

1 file changed

+24
-6
lines changed

src/latexdocvisitor.cpp

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -476,9 +476,18 @@ void LatexDocVisitor::operator()(const DocVerbatim &s)
476476
m_t << "}";
477477
break;
478478
case DocVerbatim::Verbatim:
479-
m_t << "\\begin{DoxyVerb}";
480-
m_t << s.text();
481-
m_t << "\\end{DoxyVerb}\n";
479+
if (isTableNested(s.parent())) // in table
480+
{
481+
m_t << "\\begin{DoxyCode}{0}";
482+
filter(s.text(), true);
483+
m_t << "\\end{DoxyCode}\n";
484+
}
485+
else
486+
{
487+
m_t << "\\begin{DoxyVerb}";
488+
m_t << s.text();
489+
m_t << "\\end{DoxyVerb}\n";
490+
}
482491
break;
483492
case DocVerbatim::HtmlOnly:
484493
case DocVerbatim::XmlOnly:
@@ -632,9 +641,18 @@ void LatexDocVisitor::operator()(const DocInclude &inc)
632641
m_t << inc.text();
633642
break;
634643
case DocInclude::VerbInclude:
635-
m_t << "\n\\begin{DoxyVerbInclude}\n";
636-
m_t << inc.text();
637-
m_t << "\\end{DoxyVerbInclude}\n";
644+
if (isTableNested(inc.parent())) // in table
645+
{
646+
m_t << "\\begin{DoxyCode}{0}";
647+
filter(inc.text(), true);
648+
m_t << "\\end{DoxyCode}\n";
649+
}
650+
else
651+
{
652+
m_t << "\n\\begin{DoxyVerbInclude}\n";
653+
m_t << inc.text();
654+
m_t << "\\end{DoxyVerbInclude}\n";
655+
}
638656
break;
639657
case DocInclude::Snippet:
640658
case DocInclude::SnippetWithLines:

0 commit comments

Comments
 (0)