Fix bug where incorrect elements in the navigation sidebar were highlighted, thanks to arg for reporting this.
This commit is contained in:
parent
e4f6185bfa
commit
1181046c9e
1 changed files with 5 additions and 1 deletions
|
|
@ -26,7 +26,11 @@ fn nav_tree {
|
|||
path = $0 d
|
||||
gsub(/[\-_]/, " ", bname)
|
||||
|
||||
if(index(ENVIRON["req_path"] "/", path) == 1)
|
||||
# To avoid false matches add trailing / even for plain files to act as delimiter
|
||||
pa = path
|
||||
gsub(/[^\/]$/, "&/", pa)
|
||||
|
||||
if(index(ENVIRON["req_path"] "/", pa) == 1)
|
||||
print "<li><a href=\"" path "\" class=\"thisPage\">»<i> " bname "</i></a></li>"
|
||||
else
|
||||
print "<li><a href=\"" path "\">› " bname "</a></li>"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue