Skip to content

Commit bc9cfa6

Browse files
committed
issue doxygen#11812 How to linebreak inside long titles in a HTML description list
- Allow `<br>` tag inside a `<dt>` tag - adjust latex code so it will also be shown properly
1 parent 3d38ae4 commit bc9cfa6

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

src/docnode.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2517,6 +2517,10 @@ Token DocHtmlDescTitle::parse()
25172517
parser()->handleAHref(thisVariant(),children(),parser()->context.token->attribs);
25182518
}
25192519
}
2520+
else if (tagId==HtmlTagType::HTML_BR)
2521+
{
2522+
children().append<DocLineBreak>(parser(),thisVariant(),parser()->context.token->attribs);
2523+
}
25202524
else
25212525
{
25222526
warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Unexpected html tag <{}{}> found within <dt> context",

src/latexdocvisitor.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,14 @@ void LatexDocVisitor::operator()(const DocURL &u)
350350
void LatexDocVisitor::operator()(const DocLineBreak &)
351351
{
352352
if (m_hide) return;
353+
if (m_insideItem)
354+
{
355+
m_t << "\\\\\n";
356+
}
357+
else
358+
{
353359
m_t << "~\\newline\n";
360+
}
354361
}
355362

356363
void LatexDocVisitor::operator()(const DocHorRuler &)
@@ -1215,11 +1222,11 @@ void LatexDocVisitor::operator()(const DocHtmlDescList &dl)
12151222
void LatexDocVisitor::operator()(const DocHtmlDescTitle &dt)
12161223
{
12171224
if (m_hide) return;
1218-
m_t << "\n\\item[";
1225+
m_t << "\n\\item[{\\parbox[t]{\\linewidth}{";
12191226
m_insideItem=TRUE;
12201227
visitChildren(dt);
12211228
m_insideItem=FALSE;
1222-
m_t << "]";
1229+
m_t << "}}]";
12231230
}
12241231

12251232
void LatexDocVisitor::operator()(const DocHtmlDescData &dd)

0 commit comments

Comments
 (0)