diff --git a/manifest.json b/manifest.json index 2a0fac4b..c9d22436 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "breadcrumbs", "name": "Breadcrumbs", - "version": "0.0.6", + "version": "0.0.7", "minAppVersion": "0.12.5", "description": "Visualise the hierarchy of your vault using a breadcrumb trail", "author": "SkepticMystic", diff --git a/package.json b/package.json index d3a42f87..889c8c5f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "breadcrumbs-plugin", - "version": "0.0.6", + "version": "0.0.7", "description": "Visualise the hierarchy of your vault using a breadcrumb trail", "main": "main.js", "scripts": { diff --git a/src/main.ts b/src/main.ts index 9d03919a..0fd4a47e 100644 --- a/src/main.ts +++ b/src/main.ts @@ -105,13 +105,14 @@ class BreadcrumbsView extends ItemView { // General use const splitLinksRegex = new RegExp(/\[\[(.+?)\]\]/g); const dropHeaderOrAlias = new RegExp(/\[\[([^#|]+)\]\]/); + function splitAndDrop(str: string | undefined): string[] | [] { if (str === undefined || str === "") { return []; } else { return str .match(splitLinksRegex) - .map((link) => link.match(dropHeaderOrAlias)[1]); + .map((link) => link.replace(dropHeaderOrAlias, "$1")); } } @@ -144,8 +145,6 @@ class BreadcrumbsView extends ItemView { const childLinks: string | undefined = arr.content.match(getChildLinksRegex)?.[1]; - - const [splitParentLinks, splitSiblingLinks, splitChildLinks] = [ splitAndDrop(parentLinks), splitAndDrop(siblingLinks), @@ -160,7 +159,7 @@ class BreadcrumbsView extends ItemView { }; console.log(currentNeighbourObj); - return currentNeighbourObj + return currentNeighbourObj; } ); // console.log(neighbourArr); @@ -178,7 +177,7 @@ class BreadcrumbsView extends ItemView { const gSiblings = new Graph(); const gChildren = new Graph(); - neighbourArr.forEach(neighbourObj => { + neighbourArr.forEach((neighbourObj) => { gAllInOne.setNode(neighbourObj.current, neighbourObj.current); gParents.setNode(neighbourObj.current, neighbourObj.current); gSiblings.setNode(neighbourObj.current, neighbourObj.current); @@ -201,11 +200,8 @@ class BreadcrumbsView extends ItemView { gChildren.setEdge(neighbourObj.current, child, "child") ); } - }); - - neighbourArr.forEach((neighbourObj) => { gAllInOne.setNode(neighbourObj.current, neighbourObj.current); @@ -228,7 +224,7 @@ class BreadcrumbsView extends ItemView { } }); - return {gAllInOne, gParents, gChildren, gSiblings}; + return { gAllInOne, gParents, gChildren, gSiblings }; } // Graph stuff... diff --git a/versions.json b/versions.json index 810b7400..f64869d8 100644 --- a/versions.json +++ b/versions.json @@ -1,4 +1,5 @@ { + "0.0.7": "0.12.5", "0.0.6": "0.12.5", "0.0.5": "0.12.5", "0.0.4": "0.12.5",