Skip to content

Commit

Permalink
Fix: Invalid results with differently-capitalized links
Browse files Browse the repository at this point in the history
  • Loading branch information
HEmile committed Oct 26, 2021
1 parent 77d6dc6 commit 467427a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/MyGraph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,9 @@ export default class MyGraph extends Graph {

const preCocitations: { [name: string]: [number, CoCitation[]] } = {}
let spl = a.split('/')
let ownBasename = spl[spl.length - 1]
let ownBasename = spl[spl.length - 1].toLowerCase();
const ownLinks = cache.links.filter((link) => {
return link.link === ownBasename
return link.link.toLowerCase() === ownBasename
})

const cachedRead = await this.app.vault.cachedRead(file)
Expand Down Expand Up @@ -209,7 +209,7 @@ export default class MyGraph extends Graph {
cache.headings && cache.headings.length > 0 ? maxHeadingLevel : 0

cache.links.forEach((link) => {
if (link.link === ownBasename) return
if (link.link.toLowerCase() === ownBasename) return

// Initialize to 0 if not set yet
if (!(link.link in preCocitations)) {
Expand Down Expand Up @@ -350,6 +350,7 @@ export default class MyGraph extends Graph {
})
})


// Add the found weights to the results
for (let key in preCocitations) {
const file = mdCache.getFirstLinkpathDest(key, '')
Expand Down

0 comments on commit 467427a

Please sign in to comment.