summaryrefslogtreecommitdiffstats
path: root/src/htmldocvisitor.cpp
diff options
context:
space:
mode:
authoralbert-github <albert.tests@gmail.com>2019-02-04 18:31:01 (GMT)
committeralbert-github <albert.tests@gmail.com>2019-02-04 18:31:01 (GMT)
commit64ac36480f407145d8fe1e96ea4cf8f7e30285d5 (patch)
treec2ef84b9d62f4d097db1887691fb9ac2a4814f9e /src/htmldocvisitor.cpp
parent8a31e77445a94277151666380860defedcc3838d (diff)
downloadDoxygen-64ac36480f407145d8fe1e96ea4cf8f7e30285d5.zip
Doxygen-64ac36480f407145d8fe1e96ea4cf8f7e30285d5.tar.gz
Doxygen-64ac36480f407145d8fe1e96ea4cf8f7e30285d5.tar.bz2
Bug 136299 - attributes to <p> tag get lost
Besides the `p` tag there were a number of other tags were also the attributes were lost: - `br` - `hr` - `a` in case of used as an anchor i.e. with the `name=` attribute In case of a `caption` with a `table` and no `id=` attribute with the `caption` there was still an anchor generated In scanner.l the warnings message was a bit unclear.
Diffstat (limited to 'src/htmldocvisitor.cpp')
-rw-r--r--src/htmldocvisitor.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/htmldocvisitor.cpp b/src/htmldocvisitor.cpp
index 25166bc..67fc98d 100644
--- a/src/htmldocvisitor.cpp
+++ b/src/htmldocvisitor.cpp
@@ -350,17 +350,17 @@ void HtmlDocVisitor::visit(DocURL *u)
}
}
-void HtmlDocVisitor::visit(DocLineBreak *)
+void HtmlDocVisitor::visit(DocLineBreak *br)
{
if (m_hide) return;
- m_t << "<br />\n";
+ m_t << "<br "<< htmlAttribsToString(br->attribs()) << " />\n";
}
void HtmlDocVisitor::visit(DocHorRuler *hr)
{
if (m_hide) return;
forceEndParagraph(hr);
- m_t << "<hr/>\n";
+ m_t << "<hr "<< htmlAttribsToString(hr->attribs()) << " />\n";
forceStartParagraph(hr);
}
@@ -614,7 +614,7 @@ void HtmlDocVisitor::visit(DocVerbatim *s)
void HtmlDocVisitor::visit(DocAnchor *anc)
{
if (m_hide) return;
- m_t << "<a class=\"anchor\" id=\"" << anc->anchor() << "\"></a>";
+ m_t << "<a class=\"anchor\" id=\"" << anc->anchor() << "\"" << htmlAttribsToString(anc->attribs()) << "></a>";
}
void HtmlDocVisitor::visit(DocInclude *inc)
@@ -1206,9 +1206,9 @@ void HtmlDocVisitor::visitPre(DocPara *p)
//printf(" needsTag=%d\n",needsTag);
// write the paragraph tag (if needed)
if (needsTag)
- m_t << "<p" << getDirHtmlClassOfNode(getTextDirByConfig(p), contexts[t]) << ">";
+ m_t << "<p" << getDirHtmlClassOfNode(getTextDirByConfig(p), contexts[t]) << htmlAttribsToString(p->attribs()) << ">";
else if(!paragraphAlreadyStarted)
- m_t << getHtmlDirEmbedingChar(getTextDirByConfig(p));
+ m_t << getHtmlDirEmbedingChar(getTextDirByConfig(p)) << htmlAttribsToString(p->attribs());
}
void HtmlDocVisitor::visitPost(DocPara *p)
@@ -1492,7 +1492,9 @@ void HtmlDocVisitor::visitPre(DocHtmlTable *t)
if (t->hasCaption())
{
- m_t << "<a class=\"anchor\" id=\"" << t->caption()->anchor() << "\"></a>\n";
+ QCString anc = t->caption()->anchor();
+ if (!anc.isEmpty())
+ m_t << "<a class=\"anchor\" id=\"" << anc << "\"></a>\n";
}
QString attrs = htmlAttribsToString(t->attribs());