diff --git a/assets/js/torch.js b/assets/js/torch.js index 8d60bc5d..0e1dae0c 100644 --- a/assets/js/torch.js +++ b/assets/js/torch.js @@ -55,9 +55,9 @@ window.onload = () => { slice.call(document.querySelectorAll('.torch-nav a'), 0).forEach((field) => { const url = window.location.href const linkTarget = field.getAttribute('href') - const regex = RegExp(linkTarget) + const linkTargetFullPath = new URL(linkTarget, document.baseURI).href - if (regex.test(url)) { + if (url === linkTargetFullPath) { field.classList.add('active') } })