summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralbert-github <albert.tests@gmail.com>2020-01-04 12:24:16 (GMT)
committeralbert-github <albert.tests@gmail.com>2020-01-04 12:24:16 (GMT)
commit2f79c6938c6d969f3d4ebc9ed0f2648668434502 (patch)
tree378f05d9fdbcf8484d4bd78833e5fb7318759306
parent0e874a5229554347254d5b346149e8540ba0f686 (diff)
downloadDoxygen-2f79c6938c6d969f3d4ebc9ed0f2648668434502.zip
Doxygen-2f79c6938c6d969f3d4ebc9ed0f2648668434502.tar.gz
Doxygen-2f79c6938c6d969f3d4ebc9ed0f2648668434502.tar.bz2
issue #7477 Broken urls in the xml output
Made code analogous to HTML code. Also the doxygen internal tests suffered from this problem.
-rw-r--r--src/xmldocvisitor.cpp14
-rw-r--r--testing/031/indexpage.xml28
2 files changed, 23 insertions, 19 deletions
diff --git a/src/xmldocvisitor.cpp b/src/xmldocvisitor.cpp
index 409c2fe..1e6becb 100644
--- a/src/xmldocvisitor.cpp
+++ b/src/xmldocvisitor.cpp
@@ -824,18 +824,22 @@ void XmlDocVisitor::visitPre(DocImage *img)
{
if (m_hide) return;
- QCString baseName=img->name();
- int i;
- if ((i=baseName.findRev('/'))!=-1 || (i=baseName.findRev('\\'))!=-1)
+ QCString url = img->url();
+ QCString baseName;
+ if (url.isEmpty())
{
- baseName=baseName.right(baseName.length()-i-1);
+ baseName = img->relPath()+img->name();
+ }
+ else
+ {
+ baseName = correctURL(url,img->relPath());
}
visitPreStart(m_t, "image", FALSE, this, img->children(), baseName, TRUE, img->type(), img->width(), img->height(), img ->isInlineImage());
// copy the image to the output dir
FileDef *fd;
bool ambig;
- if ((fd=findFileDef(Doxygen::imageNameDict,img->name(),ambig)))
+ if (url.isEmpty() && (fd=findFileDef(Doxygen::imageNameDict,img->name(),ambig)))
{
QFile inImage(fd->absFilePath());
QFile outImage(Config_getString(XML_OUTPUT)+"/"+baseName.data());
diff --git a/testing/031/indexpage.xml b/testing/031/indexpage.xml
index 2d74510..eaf374b 100644
--- a/testing/031/indexpage.xml
+++ b/testing/031/indexpage.xml
@@ -11,42 +11,42 @@
<image type="docbook" name="sample.png"/>
More text.</para>
<para>SVG image with caption:<linebreak/>
-<image type="html" name="license-MIT-brightgreen.svg">A caption</image>
+<image type="html" name="http://img.shields.io/badge/license-MIT-brightgreen.svg">A caption</image>
</para>
<para>PNG image with caption:<linebreak/>
-<image type="html" name="license-MIT-brightgreen.png">A caption</image>
+<image type="html" name="http://img.shields.io/badge/license-MIT-brightgreen.png">A caption</image>
</para>
<para>SVG image without caption:<linebreak/>
-<image type="html" name="license-MIT-brightgreen.svg"/>
+<image type="html" name="http://img.shields.io/badge/license-MIT-brightgreen.svg"/>
</para>
<para>PNG image without caption:<linebreak/>
-<image type="html" name="license-MIT-brightgreen.png"/>
+<image type="html" name="http://img.shields.io/badge/license-MIT-brightgreen.png"/>
</para>
<para>Inline SVG image with caption:<linebreak/>
-This image is inline <image type="html" name="license-MIT-brightgreen.svg" inline="yes">MIT license</image>
+This image is inline <image type="html" name="http://img.shields.io/badge/license-MIT-brightgreen.svg" inline="yes">MIT license</image>
within the text.</para>
<para>Inline PNG image with caption:<linebreak/>
-This image is inline <image type="html" name="license-MIT-brightgreen.png" inline="yes">MIT license</image>
+This image is inline <image type="html" name="http://img.shields.io/badge/license-MIT-brightgreen.png" inline="yes">MIT license</image>
within the text.</para>
<para>Markdown style linked SVG image:<linebreak/>
-<ulink url="http://opensource.org/licenses/MIT"><image type="html" name="license-MIT-brightgreen.svg" inline="yes"/></ulink></para>
+<ulink url="http://opensource.org/licenses/MIT"><image type="html" name="http://img.shields.io/badge/license-MIT-brightgreen.svg" inline="yes"/></ulink></para>
<para>Markdown style linked PNG image:<linebreak/>
-<ulink url="http://opensource.org/licenses/MIT"><image type="html" name="license-MIT-brightgreen.png" inline="yes"/></ulink></para>
+<ulink url="http://opensource.org/licenses/MIT"><image type="html" name="http://img.shields.io/badge/license-MIT-brightgreen.png" inline="yes"/></ulink></para>
<para>HTML style linked SVG image:<linebreak/>
-<ulink url="http://opensource.org/licenses/MIT"><image type="html" name="license-MIT-brightgreen.svg" inline="yes"/></ulink></para>
+<ulink url="http://opensource.org/licenses/MIT"><image type="html" name="http://img.shields.io/badge/license-MIT-brightgreen.svg" inline="yes"/></ulink></para>
<para>HTML style linked PNG image:<linebreak/>
-<ulink url="http://opensource.org/licenses/MIT"><image type="html" name="license-MIT-brightgreen.png" inline="yes"/></ulink></para>
+<ulink url="http://opensource.org/licenses/MIT"><image type="html" name="http://img.shields.io/badge/license-MIT-brightgreen.png" inline="yes"/></ulink></para>
<para>HTML style unlinked SVG image:<linebreak/>
-<image type="html" name="license-MIT-brightgreen.svg" inline="yes"/>
+<image type="html" name="http://img.shields.io/badge/license-MIT-brightgreen.svg" inline="yes"/>
</para>
<para>HTML style unlinked PNG image:<linebreak/>
-<image type="html" name="license-MIT-brightgreen.png" inline="yes"/>
+<image type="html" name="http://img.shields.io/badge/license-MIT-brightgreen.png" inline="yes"/>
</para>
<para>Some markdown image tests<linebreak/>
-<image type="html" name="docs-Doxygen-blue.svg?foo&amp;bar" inline="yes"/>
+<image type="html" name="https://img.shields.io/badge/docs-Doxygen-blue.svg?foo&amp;bar" inline="yes"/>
<ulink url="http://www.doxygen.nl?foo&amp;bar">Some normal link</ulink></para>
<para>
- <image type="html" name="docs-Doxygen-blue.svg?foo&amp;bar" inline="yes"/>
+ <image type="html" name="https://img.shields.io/badge/docs-Doxygen-blue.svg?foo&amp;bar" inline="yes"/>
<ulink url="http://www.doxygen.nl?foo&amp;bar">Some normal link</ulink>
</para>
</detaileddescription>