From 055422cc17b59333afb994c723260e4ba0924c4e Mon Sep 17 00:00:00 2001 From: Aiden Bai Date: Tue, 3 May 2022 09:27:25 -0700 Subject: [PATCH] Use explicit regex for trailing slash trim --- assets/js/graph.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/js/graph.js b/assets/js/graph.js index e92f7db6..db1cfe2a 100644 --- a/assets/js/graph.js +++ b/assets/js/graph.js @@ -9,7 +9,7 @@ async function drawGraph( const container = document.getElementById('graph-container') const { index, links, content } = await fetchData - const curPage = window.location.href.replace(baseUrl, '').slice(0, -1) + const curPage = window.location.href.replace(baseUrl, "").replace(/\/$/g, "") const parseIdsFromLinks = (links) => [ ...new Set(links.flatMap((link) => [link.source, link.target])),