Skip to content

Commit

Permalink
issue #9074 Menubar Links not Parsed Correctly
Browse files Browse the repository at this point in the history
The handling in the navtree was done in such a way that absolute links were prepended with a `^`, in the menus this was not done, this has been corrected.
  • Loading branch information
albert-github committed Jan 26, 2022
1 parent d700e56 commit a06eb69
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/index.cpp
Expand Up @@ -5119,6 +5119,7 @@ static bool renderQuickLinksAsJs(std::ostream &t,LayoutNavEntry *root,bool first
if (!firstChild) t << ",\n";
firstChild=FALSE;
QCString url = entry->url();
if (isURL(url)) url = "^" + url;
t << "{text:\"" << convertToJSString(entry->title()) << "\",url:\""
<< convertToJSString(url) << "\"";
bool hasChildren=FALSE;
Expand Down
10 changes: 9 additions & 1 deletion templates/html/menu.js
Expand Up @@ -28,7 +28,15 @@ function initMenu(relPath,searchEnabled,serverSide,searchPage,search) {
if ('children' in data) {
result+='<ul>';
for (var i in data.children) {
result+='<li><a href="'+relPath+data.children[i].url+'">'+
var url;
var link;
link = data.children[i].url;
if (link.substring(0,1)=='^') {
url = link.substring(1);
} else {
url = relPath+link;
}
result+='<li><a href="'+url+'">'+
data.children[i].text+'</a>'+
makeTree(data.children[i],relPath)+'</li>';
}
Expand Down

0 comments on commit a06eb69

Please sign in to comment.