From 2f79c6938c6d969f3d4ebc9ed0f2648668434502 Mon Sep 17 00:00:00 2001 From: albert-github Date: Sat, 4 Jan 2020 13:24:16 +0100 Subject: issue #7477 Broken urls in the xml output Made code analogous to HTML code. Also the doxygen internal tests suffered from this problem. --- src/xmldocvisitor.cpp | 14 +++++++++----- testing/031/indexpage.xml | 28 ++++++++++++++-------------- 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 @@ 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 -- cgit v0.12