From e646cdb0be7977f31fa1d619a5b9125875c73475 Mon Sep 17 00:00:00 2001
From: Aiden Bai <aiden.bai05@gmail.com>
Date: Tue, 03 May 2022 16:27:25 +0000
Subject: [PATCH] Use explicit regex for trailing slash trim

---
 assets/js/graph.js |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/assets/js/graph.js b/assets/js/graph.js
index e92f7db..db1cfe2 100644
--- a/assets/js/graph.js
+++ b/assets/js/graph.js
@@ -9,7 +9,7 @@
   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])),

--
Gitblit v1.10.0