diff --git a/src/rustbook/javascript.rs b/src/rustbook/javascript.rs index d5483593aa888..26303d13b6cfc 100644 --- a/src/rustbook/javascript.rs +++ b/src/rustbook/javascript.rs @@ -52,7 +52,7 @@ document.addEventListener("DOMContentLoaded", function(event) { } for (var i = 0; i < toc.length; i++) { - if (toc[i].attributes['href'].value === href) { + if (toc[i].attributes['href'].value.split('/').pop() === href) { var nav = document.createElement('p'); if (i > 0) { var prevNode = toc[i-1].cloneNode(true);