Skip to content

Commit e3130cb

Browse files
authored
Merge pull request doxygen#11388 from albert-github/feature/issue_11387
issue doxygen#11387 commit 152ad34 can break verbatim
2 parents b9ac9e4 + c0b6a69 commit e3130cb

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/mandocvisitor.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -216,18 +216,18 @@ void ManDocVisitor::operator()(const DocVerbatim &s)
216216
m_firstCol=TRUE;
217217
break;
218218
case DocVerbatim::JavaDocLiteral:
219-
filter(s.text());
219+
filter(s.text(),true);
220220
break;
221221
case DocVerbatim::JavaDocCode:
222222
m_t << "\\fR\n";
223-
filter(s.text());
223+
filter(s.text(),true);
224224
m_t << "\\fP\n";
225225
break;
226226
case DocVerbatim::Verbatim:
227227
if (!m_firstCol) m_t << "\n";
228228
m_t << ".PP\n";
229229
m_t << ".nf\n";
230-
filter(s.text());
230+
filter(s.text(),true);
231231
if (!m_firstCol) m_t << "\n";
232232
m_t << ".fi\n";
233233
m_t << ".PP\n";
@@ -984,7 +984,7 @@ void ManDocVisitor::operator()(const DocParBlock &pb)
984984
visitChildren(pb);
985985
}
986986

987-
void ManDocVisitor::filter(const QCString &str)
987+
void ManDocVisitor::filter(const QCString &str, const bool retainNewline)
988988
{
989989
if (!str.isEmpty())
990990
{
@@ -998,7 +998,7 @@ void ManDocVisitor::filter(const QCString &str)
998998
case '.': m_t << "\\&."; break; // see bug652277
999999
case '\\': m_t << "\\\\"; break;
10001000
case '\"': m_t << "\""; insideDoubleQuote = !insideDoubleQuote; break;
1001-
case '\n': if (!insideDoubleQuote) m_t << c; break;
1001+
case '\n': if (retainNewline || !insideDoubleQuote) m_t << c; break;
10021002
default: m_t << c; break;
10031003
}
10041004
}

src/mandocvisitor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ class ManDocVisitor : public DocVisitor
117117
// helper functions
118118
//--------------------------------------
119119

120-
void filter(const QCString &str);
120+
void filter(const QCString &str, const bool retainNewline = false);
121121

122122
//--------------------------------------
123123
// state variables

0 commit comments

Comments
 (0)