From 1a5d158fce648492c48644acfea039261ac1dffa Mon Sep 17 00:00:00 2001
From: Aiden Bai <aiden.bai05@gmail.com>
Date: Tue, 03 May 2022 17:38:41 +0000
Subject: [PATCH] Support active node with other data at end of url
---
assets/js/graph.js | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/assets/js/graph.js b/assets/js/graph.js
index db1cfe2..5739acd 100644
--- a/assets/js/graph.js
+++ b/assets/js/graph.js
@@ -9,7 +9,8 @@
const container = document.getElementById('graph-container')
const { index, links, content } = await fetchData
- const curPage = window.location.href.replace(baseUrl, "").replace(/\/$/g, "")
+ // Use .pathname to remove hashes / searchParams / text fragments
+ const curPage = window.location.pathname.replace(/\/$/g, "")
const parseIdsFromLinks = (links) => [
...new Set(links.flatMap((link) => [link.source, link.target])),
--
Gitblit v1.10.0