diff --git a/main.js b/main.js index 301a3e12..1d2244bd 100644 --- a/main.js +++ b/main.js @@ -22421,7 +22421,7 @@ function removeCycles(g, startNode) { let prevNode = null; graphologyTraversal.dfsFromNode(copy, startNode, (n) => { copy.forEachOutNeighbor(n, (t) => { - if (t === prevNode) { + if (t === prevNode && copy.hasEdge(t, prevNode)) { copy.dropEdge(t, prevNode); } }); @@ -51827,6 +51827,9 @@ class BCPlugin extends require$$0.Plugin { }; this.getAllTags = (file, withHash = true) => { var _a, _b, _c; + // const test = getAllTags( + // this.app.metadataCache.getFileCache(this.app.workspace.getActiveFile()) + // ); const { tags, frontmatter } = this.app.metadataCache.getFileCache(file); return [ ...((_a = tags === null || tags === void 0 ? void 0 : tags.map((t) => (t.tag.startsWith("#") ? t.tag.slice(1) : t.tag))) !== null && _a !== void 0 ? _a : []), diff --git a/src/graphUtils.ts b/src/graphUtils.ts index ad845ee9..d40b9ee1 100644 --- a/src/graphUtils.ts +++ b/src/graphUtils.ts @@ -214,7 +214,7 @@ export function removeCycles(g: Graph, startNode: string) { let prevNode = null; dfsFromNode(copy, startNode, (n) => { copy.forEachOutNeighbor(n, (t) => { - if (t === prevNode) { + if (t === prevNode && copy.hasEdge(t, prevNode)) { copy.dropEdge(t, prevNode); } }); diff --git a/src/main.ts b/src/main.ts index 6db5b47c..7cbe24bd 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,7 +1,7 @@ import { getApi } from "@aidenlx/folder-note-core"; import Graph, { MultiGraph } from "graphology"; import { parseTypedLink } from "juggl-api"; -import { cloneDeep, split } from "lodash"; +import { cloneDeep } from "lodash"; import { debug, error, info, warn } from "loglevel"; import { addIcon, @@ -46,7 +46,6 @@ import { DUCK_ICON_SVG, DUCK_VIEW, MATRIX_VIEW, - regNFlags, splitLinksRegex, STATS_VIEW, TRAIL_ICON, @@ -1079,6 +1078,9 @@ export default class BCPlugin extends Plugin { } getAllTags = (file: TFile, withHash = true): string[] => { + // const test = getAllTags( + // this.app.metadataCache.getFileCache(this.app.workspace.getActiveFile()) + // ); const { tags, frontmatter } = this.app.metadataCache.getFileCache(file); return [ ...(tags?.map((t) => (t.tag.startsWith("#") ? t.tag.slice(1) : t.tag)) ??