From b2fad8d85277b4842d578656a7e1c3c6f8e950ce Mon Sep 17 00:00:00 2001 From: sxt1001 Date: Tue, 5 Jan 2021 14:09:28 +0800 Subject: [PATCH] fix incorrect label in map of dot files in xhtml --- ...t-label-in-map-of-dot-files-in-xhtml.patch | 82 +++++++++++++++++++ ...ML-without_regeneration_of_dot_files.patch | 30 +++++++ doxygen.spec | 13 ++- 3 files changed, 122 insertions(+), 3 deletions(-) create mode 100644 backport-Incorrect-label-in-map-of-dot-files-in-xhtml.patch create mode 100644 backport-Incorrect-label-name-in-case-regeneration-of-HTML-without_regeneration_of_dot_files.patch diff --git a/backport-Incorrect-label-in-map-of-dot-files-in-xhtml.patch b/backport-Incorrect-label-in-map-of-dot-files-in-xhtml.patch new file mode 100644 index 0000000..6c1d076 --- /dev/null +++ b/backport-Incorrect-label-in-map-of-dot-files-in-xhtml.patch @@ -0,0 +1,82 @@ +From 320878afdf87d87745d9e36731ae70b8bc23063d Mon Sep 17 00:00:00 2001 +From: albert-github +Date: Wed, 10 Jun 2020 12:32:24 +0200 +Subject: [PATCH] Incorrect label in map of dot files in xhtml + +https://github.com/doxygen/doxygen/pull/7840/commits/320878afdf87d87745d9e36731ae70b8bc23063d + +When a filename of a file starts with a digit the mapping of the resulting dot files results in message like: +``` +Syntax of value for attribute id of map is not valid +``` +an id cannot start with a digit, so an "a" is placed in front of it (unconditionally to overcome problems with a double label id i.e filename 087.cpp and a087.cpp). + +--- + src/dotfilepatcher.cpp | 2 +- + src/dotgraph.cpp | 2 +- + src/util.cpp | 10 ++++++++++ + src/util.h | 1 + + 4 files changed, 13 insertions(+), 2 deletions(-) + +diff --git a/src/dotfilepatcher.cpp b/src/dotfilepatcher.cpp +index e386af9..338be69 100644 +--- a/src/dotfilepatcher.cpp ++++ b/src/dotfilepatcher.cpp +@@ -459,7 +459,7 @@ bool DotFilePatcher::run() const + convertMapFile(tt,map->mapFile,map->relPath,map->urlOnly,map->context); + if (!result.isEmpty()) + { +- t << "label << "\" id=\"" << map->label << "\">" << endl; ++ t << "label << "\" id=\"" << correctId(map->label) << "\">" << endl; + t << result; + t << "" << endl; + } +diff --git a/src/dotgraph.cpp b/src/dotgraph.cpp +index e622dd4..55ea5ab 100644 +--- a/src/dotgraph.cpp ++++ b/src/dotgraph.cpp +@@ -246,7 +246,7 @@ void DotGraph::generateCode(FTextStream &t) + else // add link to bitmap file with image map + { + if (!m_noDivTag) t << "
"; +- t << "\"""; ++ t << "\"""; + if (!m_noDivTag) t << "
"; + t << endl; + if (m_regenerate || !insertMapFile(t, absMapName(), m_relPath, getMapLabel())) +diff --git a/src/util.cpp b/src/util.cpp +index 6d6112e..e8cf778 100644 +--- a/src/util.cpp ++++ b/src/util.cpp +@@ -5382,6 +5382,16 @@ QCString convertToId(const char *s) + return growBuf.get(); + } + ++/*! Some strings have been corrected but the requirement regarding the fact ++ * that an id cannot have a digit at the first position. To overcome problems ++ * with double labels we always place an "a" in front ++ */ ++QCString correctId(QCString s) ++{ ++ if (s.isEmpty()) return s; ++ return "a" + s; ++} ++ + /*! Converts a string to an XML-encoded string */ + QCString convertToXML(const char *s, bool keepEntities) + { +diff --git a/src/util.h b/src/util.h +index 98223b1..54421b2 100644 +--- a/src/util.h ++++ b/src/util.h +@@ -278,6 +278,7 @@ QCString insertTemplateSpecifierInScope(const QCString &scope,const QCString &te + QCString stripScope(const char *name); + + QCString convertToId(const char *s); ++QCString correctId(QCString s); + + QCString convertToHtml(const char *s,bool keepEntities=TRUE); + +-- +2.23.0 + diff --git a/backport-Incorrect-label-name-in-case-regeneration-of-HTML-without_regeneration_of_dot_files.patch b/backport-Incorrect-label-name-in-case-regeneration-of-HTML-without_regeneration_of_dot_files.patch new file mode 100644 index 0000000..8510f99 --- /dev/null +++ b/backport-Incorrect-label-name-in-case-regeneration-of-HTML-without_regeneration_of_dot_files.patch @@ -0,0 +1,30 @@ +From 939eca311ced62d9cb41d8e3c1acc207c99e09ed Mon Sep 17 00:00:00 2001 +From: albert-github +Date: Thu, 15 Oct 2020 13:06:23 +0200 +Subject: [PATCH] Incorrect label / name in case regeneration of HTML without + regeneration of dot files + +https://github.com/doxygen/doxygen/commit/de56d1864473485861bac89436337e8114fb2f6b + +This is a further regression on #7840. +In case we regenerate the HTML files but not the image files based on dot we get incorrect labels for the id / name in the HTML output. +--- + src/dotgraph.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/dotgraph.cpp b/src/dotgraph.cpp +index 55ea5ab..e1844b5 100644 +--- a/src/dotgraph.cpp ++++ b/src/dotgraph.cpp +@@ -249,7 +249,7 @@ void DotGraph::generateCode(FTextStream &t) + t << "\"""; + if (!m_noDivTag) t << ""; + t << endl; +- if (m_regenerate || !insertMapFile(t, absMapName(), m_relPath, getMapLabel())) ++ if (m_regenerate || !insertMapFile(t, absMapName(), m_relPath, correctId(getMapLabel()))) + { + int mapId = DotManager::instance()-> + createFilePatcher(m_fileName.data())-> +-- +2.23.0 + diff --git a/doxygen.spec b/doxygen.spec index dee38e0..b01d193 100644 --- a/doxygen.spec +++ b/doxygen.spec @@ -3,13 +3,17 @@ Name: doxygen Epoch: 1 Version: 1.8.18 -Release: 6 +Release: 7 Summary: A documentation system for C/C++ License: GPL+ Url: http://www.doxygen.nl Source0: https://nchc.dl.sourceforge.net/project/%{name}/rel-%{version}/%{name}-%{version}.src.tar.gz Source1: doxywizard.desktop -Patch6000: ef6cc2b1b3b70fba03e994e7a61926c8e2958867.patch + +Patch6000: ef6cc2b1b3b70fba03e994e7a61926c8e2958867.patch +Patch6001: backport-Incorrect-label-in-map-of-dot-files-in-xhtml.patch +Patch6002: backport-Incorrect-label-name-in-case-regeneration-of-HTML-without_regeneration_of_dot_files.patch + BuildRequires: python3 ImageMagick gcc-c++ gcc perl-interpreter BuildRequires: tex(dvips) tex(latex) tex(multirow.sty) tex(sectsty.sty) tex(tocloft.sty) BuildRequires: tex(xtab.sty) tex(import.sty) tex(tabu.sty) tex(appendix.sty) @@ -93,6 +97,9 @@ make tests -C %{BuildDir} %{_datadir}/icons/hicolor/*/apps/doxywizard.png %changelog +* Tue Jan 05 2020 shixuantong - 1.8.18-7 +- fix incorrect label in map of dot files in xhtml + * Thu Dec 10 2020 shixuantong - 1.8.18-6 - Modify Source0 @@ -112,4 +119,4 @@ make tests -C %{BuildDir} - Type:bugfix - ID:NA - SUG:NA -- DESC:Eliminate PDF file Differences \ No newline at end of file +- DESC:Eliminate PDF file Differences -- Gitee