mirror of
https://github.com/alrayyes/wiki.git
synced 2025-06-22 21:06:34 +00:00
Support active node with other data at end of url
This commit is contained in:
parent
a09974446d
commit
1a5d158fce
3 changed files with 3 additions and 12 deletions
assets/js
|
@ -9,7 +9,8 @@ async function drawGraph(
|
|||
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])),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue