From 6136cf9e3ad70d58cac4d8022cce8c8729805119 Mon Sep 17 00:00:00 2001 From: Christoph Lipka Date: Wed, 27 Apr 2016 02:26:48 +0200 Subject: Bug 765001 - Bad character escaping scheme in HTML anchor generation. --- src/htmlhelp.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/htmlhelp.cpp b/src/htmlhelp.cpp index d365744..9c60727 100644 --- a/src/htmlhelp.cpp +++ b/src/htmlhelp.cpp @@ -134,7 +134,17 @@ static QCString field2URL(const IndexField *f,bool checkReversed) QCString result = f->url + Doxygen::htmlFileExtension; if (!f->anchor.isEmpty() && (!checkReversed || f->reversed)) { - result+="#"+f->anchor; + result+="#"; + // HTML Help needs colons in link anchors to be escaped in the .hhk file. + int prev = 0; + int next; + while ((next=f->anchor.find(':', prev))!=-1) + { + result+=f->anchor.mid(prev,next-prev); + result+="%3A"; + prev=next+1; + } + result+=f->anchor.mid(prev); } return result; } -- cgit v0.12 From e70b45fa4398450b588122f9d36b1ed514fc336a Mon Sep 17 00:00:00 2001 From: Christoph Lipka Date: Sun, 1 May 2016 16:36:30 +0200 Subject: Simplified code of fix for Bug 765001 --- src/htmlhelp.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/htmlhelp.cpp b/src/htmlhelp.cpp index 2d4b168..fbfece0 100644 --- a/src/htmlhelp.cpp +++ b/src/htmlhelp.cpp @@ -134,17 +134,8 @@ static QCString field2URL(const IndexField *f,bool checkReversed) QCString result = f->url + Doxygen::htmlFileExtension; if (!f->anchor.isEmpty() && (!checkReversed || f->reversed)) { - result+="#"; // HTML Help needs colons in link anchors to be escaped in the .hhk file. - int prev = 0; - int next; - while ((next=f->anchor.find(':', prev))!=-1) - { - result+=f->anchor.mid(prev,next-prev); - result+="%3A"; - prev=next+1; - } - result+=f->anchor.mid(prev); + result+="#"+substitute(f->anchor,":","%3A"); } return result; } -- cgit v0.12