summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2016-05-15 12:28:21 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2016-05-15 12:28:21 (GMT)
commit8ccd98643a3b88aaa3245b76202666900a2cd401 (patch)
tree93cc38afce4eb326a183ad04cae18f6e43d6b9d3 /src
parentab96c077a8cd99308e6ae90c3c861ab1c0e911d7 (diff)
downloadDoxygen-8ccd98643a3b88aaa3245b76202666900a2cd401.zip
Doxygen-8ccd98643a3b88aaa3245b76202666900a2cd401.tar.gz
Doxygen-8ccd98643a3b88aaa3245b76202666900a2cd401.tar.bz2
Bug 675165 - Uses <img> instead of <object> html tag for SVG images
Diffstat (limited to 'src')
-rw-r--r--src/htmldocvisitor.cpp42
1 files changed, 34 insertions, 8 deletions
diff --git a/src/htmldocvisitor.cpp b/src/htmldocvisitor.cpp
index c6e0dee..b589f71 100644
--- a/src/htmldocvisitor.cpp
+++ b/src/htmldocvisitor.cpp
@@ -1312,7 +1312,7 @@ void HtmlDocVisitor::visitPre(DocHtmlTable *t)
}
else
{
- m_t << "<table " << htmlAttribsToString(t->attribs()) << ">\n";
+ m_t << "<table" << htmlAttribsToString(t->attribs()) << ">\n";
}
}
@@ -1429,17 +1429,43 @@ void HtmlDocVisitor::visitPre(DocImage *img)
}
m_t << "<div class=\"image\">" << endl;
QCString url = img->url();
+ QCString sizeAttribs;
+ if (!img->width().isEmpty())
+ {
+ sizeAttribs+=" width=\""+img->width()+"\"";
+ }
+ if (!img->height().isEmpty())
+ {
+ sizeAttribs+=" height=\""+img->height()+"\"";
+ }
if (url.isEmpty())
{
- m_t << "<img src=\"" << img->relPath() << img->name() << "\" alt=\""
- << baseName << "\"" << htmlAttribsToString(img->attribs())
- << "/>" << endl;
+ if (img->name().right(4)==".svg")
+ {
+ m_t << "<object type=\"image/svg+xml\" data=\"" << img->relPath() << img->name()
+ << "\"" << sizeAttribs << htmlAttribsToString(img->attribs()) << ">" << baseName
+ << "</object>" << endl;
+ }
+ else
+ {
+ m_t << "<img src=\"" << img->relPath() << img->name() << "\" alt=\""
+ << baseName << "\"" << sizeAttribs << htmlAttribsToString(img->attribs())
+ << "/>" << endl;
+ }
}
else
{
- m_t << "<img src=\"" << correctURL(url,img->relPath()) << "\" "
- << htmlAttribsToString(img->attribs())
- << "/>" << endl;
+ if (url.right(4)==".svg")
+ {
+ m_t << "<object type=\"image/svg+xml\" data=\"" << correctURL(url,img->relPath())
+ << "\"" << sizeAttribs << htmlAttribsToString(img->attribs()) << "></object>" << endl;
+ }
+ else
+ {
+ m_t << "<img src=\"" << correctURL(url,img->relPath()) << "\""
+ << sizeAttribs << htmlAttribsToString(img->attribs())
+ << "/>" << endl;
+ }
}
if (img->hasCaption())
{
@@ -1810,7 +1836,7 @@ void HtmlDocVisitor::visitPre(DocHtmlBlockQuote *b)
}
else
{
- m_t << "<blockquote " << htmlAttribsToString(b->attribs()) << ">\n";
+ m_t << "<blockquote" << htmlAttribsToString(b->attribs()) << ">\n";
}
}