Fix bug where incorrect elements in the navigation sidebar were highlighted, thanks to arg for reporting this.
This commit is contained in:
parent
c046cbd057
commit
3a1191a4a0
@ -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…
Reference in New Issue
Block a user