Skip to content

Commit

Permalink
Fix for broken graph edges when note links to anchor (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
tngebauer committed Dec 22, 2021
1 parent a0f94d9 commit 4d5344d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,14 @@ async function fetchData() {

notes.forEach(function(note, id) {
var links = note["links"]
for (const link of links) {
for (let link of links) {

// Slice note link if link directs to an anchor
var index = link.indexOf("#");
if(index != -1){
link = link.substr(0,index);
}

var linkDestExists = notes.has(link);
if (linkDestExists) {
data.edges.push({
Expand Down

0 comments on commit 4d5344d

Please sign in to comment.