Skip to content

Commit

Permalink
Use explicit regex for trailing slash trim
Browse files Browse the repository at this point in the history
  • Loading branch information
aidenybai committed May 3, 2022
1 parent 8d092a3 commit e646cdb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion assets/js/graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -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])),
Expand Down

0 comments on commit e646cdb

Please sign in to comment.