Use explicit regex for trailing slash trim

This commit is contained in:
Aiden Bai 2022-05-03 09:27:25 -07:00
parent 018c55bd99
commit 055422cc17

View File

@ -9,7 +9,7 @@ async function drawGraph(
const container = document.getElementById('graph-container') const container = document.getElementById('graph-container')
const { index, links, content } = await fetchData 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) => [ const parseIdsFromLinks = (links) => [
...new Set(links.flatMap((link) => [link.source, link.target])), ...new Set(links.flatMap((link) => [link.source, link.target])),