summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas F. K. Jorna <[email protected]>2021-12-04 13:29:00 +0100
committerGitHub <[email protected]>2021-12-04 13:29:00 +0100
commit6c19ce4b762e9c0c7c72fc0105b85aaaad5beafe (patch)
treead202841462dc27382636c02a3f0e5cb12411855
parentf89a8a5ab2939124ac31fe6e9349f9fde341912d (diff)
fix: solve unresolved statistics cookie hierarchy (#158)
-rw-r--r--pages/index.tsx5
1 files changed, 3 insertions, 2 deletions
diff --git a/pages/index.tsx b/pages/index.tsx
index 5900b9b..c74f0af 100644
--- a/pages/index.tsx
+++ b/pages/index.tsx
@@ -160,6 +160,8 @@ export function GraphPage() {
}
}, {})
+ // generate links between level 2 nodes and the level 1 node above it
+ // org-roam does not generate such links, so we have to put them in ourselves
const headingLinks: OrgRoamLink[] = Object.keys(nodesByFile).flatMap((file) => {
const nodesInFile = nodesByFile[file] ?? []
// "file node" as opposed to "heading node"
@@ -174,8 +176,7 @@ export function GraphPage() {
if (
node.level >= headingNode.level ||
node.pos >= headingNode.pos ||
- !headingNode.olp?.includes(node.title) //||
- // node.level >= headingNode.level - headingNode.olp.reverse().indexOf(node.title)
+ !headingNode.olp?.includes((node.title as string)?.replace(/ *\[\d*\/\d*\] */g, ''))
) {
return false
}