|
Than Ngo |
d1c487 |
commit 2f79c6938c6d969f3d4ebc9ed0f2648668434502
|
|
Than Ngo |
d1c487 |
Author: albert-github <albert.tests@gmail.com>
|
|
Than Ngo |
d1c487 |
Date: Sat Jan 4 13:24:16 2020 +0100
|
|
Than Ngo |
d1c487 |
|
|
Than Ngo |
d1c487 |
issue #7477 Broken urls in the xml output
|
|
Than Ngo |
d1c487 |
|
|
Than Ngo |
d1c487 |
Made code analogous to HTML code.
|
|
Than Ngo |
d1c487 |
Also the doxygen internal tests suffered from this problem.
|
|
Than Ngo |
d1c487 |
|
|
Than Ngo |
d1c487 |
diff --git a/src/xmldocvisitor.cpp b/src/xmldocvisitor.cpp
|
|
Than Ngo |
d1c487 |
index 409c2fe6..1e6becbe 100644
|
|
Than Ngo |
d1c487 |
--- a/src/xmldocvisitor.cpp
|
|
Than Ngo |
d1c487 |
+++ b/src/xmldocvisitor.cpp
|
|
Than Ngo |
d1c487 |
@@ -824,18 +824,22 @@ void XmlDocVisitor::visitPre(DocImage *img)
|
|
Than Ngo |
d1c487 |
{
|
|
Than Ngo |
d1c487 |
if (m_hide) return;
|
|
Than Ngo |
d1c487 |
|
|
Than Ngo |
d1c487 |
- QCString baseName=img->name();
|
|
Than Ngo |
d1c487 |
- int i;
|
|
Than Ngo |
d1c487 |
- if ((i=baseName.findRev('/'))!=-1 || (i=baseName.findRev('\\'))!=-1)
|
|
Than Ngo |
d1c487 |
+ QCString url = img->url();
|
|
Than Ngo |
d1c487 |
+ QCString baseName;
|
|
Than Ngo |
d1c487 |
+ if (url.isEmpty())
|
|
Than Ngo |
d1c487 |
{
|
|
Than Ngo |
d1c487 |
- baseName=baseName.right(baseName.length()-i-1);
|
|
Than Ngo |
d1c487 |
+ baseName = img->relPath()+img->name();
|
|
Than Ngo |
d1c487 |
+ }
|
|
Than Ngo |
d1c487 |
+ else
|
|
Than Ngo |
d1c487 |
+ {
|
|
Than Ngo |
d1c487 |
+ baseName = correctURL(url,img->relPath());
|
|
Than Ngo |
d1c487 |
}
|
|
Than Ngo |
d1c487 |
visitPreStart(m_t, "image", FALSE, this, img->children(), baseName, TRUE, img->type(), img->width(), img->height(), img ->isInlineImage());
|
|
Than Ngo |
d1c487 |
|
|
Than Ngo |
d1c487 |
// copy the image to the output dir
|
|
Than Ngo |
d1c487 |
FileDef *fd;
|
|
Than Ngo |
d1c487 |
bool ambig;
|
|
Than Ngo |
d1c487 |
- if ((fd=findFileDef(Doxygen::imageNameDict,img->name(),ambig)))
|
|
Than Ngo |
d1c487 |
+ if (url.isEmpty() && (fd=findFileDef(Doxygen::imageNameDict,img->name(),ambig)))
|
|
Than Ngo |
d1c487 |
{
|
|
Than Ngo |
d1c487 |
QFile inImage(fd->absFilePath());
|
|
Than Ngo |
d1c487 |
QFile outImage(Config_getString(XML_OUTPUT)+"/"+baseName.data());
|
|
Than Ngo |
d1c487 |
diff --git a/testing/031/indexpage.xml b/testing/031/indexpage.xml
|
|
Than Ngo |
d1c487 |
index 2d74510a..eaf374b6 100644
|
|
Than Ngo |
d1c487 |
--- a/testing/031/indexpage.xml
|
|
Than Ngo |
d1c487 |
+++ b/testing/031/indexpage.xml
|
|
Than Ngo |
d1c487 |
@@ -11,42 +11,42 @@
|
|
Than Ngo |
d1c487 |
<image type="docbook" name="sample.png"/>
|
|
Than Ngo |
d1c487 |
More text.</para>
|
|
Than Ngo |
d1c487 |
<para>SVG image with caption:<linebreak/>
|
|
Than Ngo |
d1c487 |
-<image type="html" name="license-MIT-brightgreen.svg">A caption</image>
|
|
Than Ngo |
d1c487 |
+<image type="html" name="http://img.shields.io/badge/license-MIT-brightgreen.svg">A caption</image>
|
|
Than Ngo |
d1c487 |
</para>
|
|
Than Ngo |
d1c487 |
<para>PNG image with caption:<linebreak/>
|
|
Than Ngo |
d1c487 |
-<image type="html" name="license-MIT-brightgreen.png">A caption</image>
|
|
Than Ngo |
d1c487 |
+<image type="html" name="http://img.shields.io/badge/license-MIT-brightgreen.png">A caption</image>
|
|
Than Ngo |
d1c487 |
</para>
|
|
Than Ngo |
d1c487 |
<para>SVG image without caption:<linebreak/>
|
|
Than Ngo |
d1c487 |
-<image type="html" name="license-MIT-brightgreen.svg"/>
|
|
Than Ngo |
d1c487 |
+<image type="html" name="http://img.shields.io/badge/license-MIT-brightgreen.svg"/>
|
|
Than Ngo |
d1c487 |
</para>
|
|
Than Ngo |
d1c487 |
<para>PNG image without caption:<linebreak/>
|
|
Than Ngo |
d1c487 |
-<image type="html" name="license-MIT-brightgreen.png"/>
|
|
Than Ngo |
d1c487 |
+<image type="html" name="http://img.shields.io/badge/license-MIT-brightgreen.png"/>
|
|
Than Ngo |
d1c487 |
</para>
|
|
Than Ngo |
d1c487 |
<para>Inline SVG image with caption:<linebreak/>
|
|
Than Ngo |
d1c487 |
-This image is inline <image type="html" name="license-MIT-brightgreen.svg" inline="yes">MIT license</image>
|
|
Than Ngo |
d1c487 |
+This image is inline <image type="html" name="http://img.shields.io/badge/license-MIT-brightgreen.svg" inline="yes">MIT license</image>
|
|
Than Ngo |
d1c487 |
within the text.</para>
|
|
Than Ngo |
d1c487 |
<para>Inline PNG image with caption:<linebreak/>
|
|
Than Ngo |
d1c487 |
-This image is inline <image type="html" name="license-MIT-brightgreen.png" inline="yes">MIT license</image>
|
|
Than Ngo |
d1c487 |
+This image is inline <image type="html" name="http://img.shields.io/badge/license-MIT-brightgreen.png" inline="yes">MIT license</image>
|
|
Than Ngo |
d1c487 |
within the text.</para>
|
|
Than Ngo |
d1c487 |
<para>Markdown style linked SVG image:<linebreak/>
|
|
Than Ngo |
d1c487 |
-<ulink url="http://opensource.org/licenses/MIT"><image type="html" name="license-MIT-brightgreen.svg" inline="yes"/></ulink></para>
|
|
Than Ngo |
d1c487 |
+<ulink url="http://opensource.org/licenses/MIT"><image type="html" name="http://img.shields.io/badge/license-MIT-brightgreen.svg" inline="yes"/></ulink></para>
|
|
Than Ngo |
d1c487 |
<para>Markdown style linked PNG image:<linebreak/>
|
|
Than Ngo |
d1c487 |
-<ulink url="http://opensource.org/licenses/MIT"><image type="html" name="license-MIT-brightgreen.png" inline="yes"/></ulink></para>
|
|
Than Ngo |
d1c487 |
+<ulink url="http://opensource.org/licenses/MIT"><image type="html" name="http://img.shields.io/badge/license-MIT-brightgreen.png" inline="yes"/></ulink></para>
|
|
Than Ngo |
d1c487 |
<para>HTML style linked SVG image:<linebreak/>
|
|
Than Ngo |
d1c487 |
-<ulink url="http://opensource.org/licenses/MIT"><image type="html" name="license-MIT-brightgreen.svg" inline="yes"/></ulink></para>
|
|
Than Ngo |
d1c487 |
+<ulink url="http://opensource.org/licenses/MIT"><image type="html" name="http://img.shields.io/badge/license-MIT-brightgreen.svg" inline="yes"/></ulink></para>
|
|
Than Ngo |
d1c487 |
<para>HTML style linked PNG image:<linebreak/>
|
|
Than Ngo |
d1c487 |
-<ulink url="http://opensource.org/licenses/MIT"><image type="html" name="license-MIT-brightgreen.png" inline="yes"/></ulink></para>
|
|
Than Ngo |
d1c487 |
+<ulink url="http://opensource.org/licenses/MIT"><image type="html" name="http://img.shields.io/badge/license-MIT-brightgreen.png" inline="yes"/></ulink></para>
|
|
Than Ngo |
d1c487 |
<para>HTML style unlinked SVG image:<linebreak/>
|
|
Than Ngo |
d1c487 |
-<image type="html" name="license-MIT-brightgreen.svg" inline="yes"/>
|
|
Than Ngo |
d1c487 |
+<image type="html" name="http://img.shields.io/badge/license-MIT-brightgreen.svg" inline="yes"/>
|
|
Than Ngo |
d1c487 |
</para>
|
|
Than Ngo |
d1c487 |
<para>HTML style unlinked PNG image:<linebreak/>
|
|
Than Ngo |
d1c487 |
-<image type="html" name="license-MIT-brightgreen.png" inline="yes"/>
|
|
Than Ngo |
d1c487 |
+<image type="html" name="http://img.shields.io/badge/license-MIT-brightgreen.png" inline="yes"/>
|
|
Than Ngo |
d1c487 |
</para>
|
|
Than Ngo |
d1c487 |
<para>Some markdown image tests<linebreak/>
|
|
Than Ngo |
d1c487 |
-<image type="html" name="docs-Doxygen-blue.svg?foo&bar" inline="yes"/>
|
|
Than Ngo |
d1c487 |
+<image type="html" name="https://img.shields.io/badge/docs-Doxygen-blue.svg?foo&bar" inline="yes"/>
|
|
Than Ngo |
d1c487 |
<ulink url="http://www.doxygen.nl?foo&bar">Some normal link</ulink></para>
|
|
Than Ngo |
d1c487 |
<para>
|
|
Than Ngo |
d1c487 |
- <image type="html" name="docs-Doxygen-blue.svg?foo&bar" inline="yes"/>
|
|
Than Ngo |
d1c487 |
+ <image type="html" name="https://img.shields.io/badge/docs-Doxygen-blue.svg?foo&bar" inline="yes"/>
|
|
Than Ngo |
d1c487 |
<ulink url="http://www.doxygen.nl?foo&bar">Some normal link</ulink>
|
|
Than Ngo |
d1c487 |
</para>
|
|
Than Ngo |
d1c487 |
</detaileddescription>
|