commit 2f79c6938c6d969f3d4ebc9ed0f2648668434502 Author: albert-github Date: Sat Jan 4 13:24:16 2020 +0100 issue #7477 Broken urls in the xml output Made code analogous to HTML code. Also the doxygen internal tests suffered from this problem. diff --git a/src/xmldocvisitor.cpp b/src/xmldocvisitor.cpp index 409c2fe6..1e6becbe 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 2d74510a..eaf374b6 100644 --- a/testing/031/indexpage.xml +++ b/testing/031/indexpage.xml @@ -11,42 +11,42 @@ More text. SVG image with caption: -A caption +A caption PNG image with caption: -A caption +A caption SVG image without caption: - + PNG image without caption: - + Inline SVG image with caption: -This image is inline MIT license +This image is inline MIT license within the text. Inline PNG image with caption: -This image is inline MIT license +This image is inline MIT license within the text. Markdown style linked SVG image: - + Markdown style linked PNG image: - + HTML style linked SVG image: - + HTML style linked PNG image: - + HTML style unlinked SVG image: - + HTML style unlinked PNG image: - + Some markdown image tests - + Some normal link - + Some normal link