summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Theegarten <jan@moduleworks.com>2020-06-18 13:39:54 (GMT)
committerJan Theegarten <jan@moduleworks.com>2021-01-07 09:53:56 (GMT)
commitc37fe44163a254835aef8cf05e59979b18552ab0 (patch)
treea45b801052af29f6b387a2b77895df45bc2f3cb2
parent7527114a304dbb9e21236a453ed0f2e1bd51b884 (diff)
downloadDoxygen-c37fe44163a254835aef8cf05e59979b18552ab0.zip
Doxygen-c37fe44163a254835aef8cf05e59979b18552ab0.tar.gz
Doxygen-c37fe44163a254835aef8cf05e59979b18552ab0.tar.bz2
Implement alt="" for images in xml.
-rw-r--r--src/xmldocvisitor.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/xmldocvisitor.cpp b/src/xmldocvisitor.cpp
index 73aac7c..77f3e8e 100644
--- a/src/xmldocvisitor.cpp
+++ b/src/xmldocvisitor.cpp
@@ -41,7 +41,7 @@ static void visitCaption(XmlDocVisitor *parent, QList<DocNode> children)
static void visitPreStart(FTextStream &t, const char *cmd, bool doCaption,
XmlDocVisitor *parent, QList<DocNode> children,
const QCString &name, bool writeType, DocImage::Type type, const QCString &width,
- const QCString &height, bool inlineImage = FALSE)
+ const QCString &height, const QCString &alt = QCString(""), bool inlineImage = FALSE)
{
t << "<" << cmd;
if (writeType)
@@ -68,6 +68,10 @@ static void visitPreStart(FTextStream &t, const char *cmd, bool doCaption,
{
t << " height=\"" << convertToXML(height) << "\"";
}
+ if (!alt.isEmpty())
+ {
+ t << " alt=\"" << convertToXML(alt) << "\"";
+ }
if (inlineImage)
{
t << " inline=\"yes\"";
@@ -907,7 +911,7 @@ void XmlDocVisitor::visitPre(DocImage *img)
{
baseName = correctURL(url,img->relPath());
}
- visitPreStart(m_t, "image", FALSE, this, img->children(), baseName, TRUE, img->type(), img->width(), img->height(), img ->isInlineImage());
+ visitPreStart(m_t, "image", FALSE, this, img->children(), baseName, TRUE, img->type(), img->width(), img->height(), img->attribs().find("alt"), img->isInlineImage());
// copy the image to the output dir
FileDef *fd;