Skip to content

Commit

Permalink
0.2.11
Browse files Browse the repository at this point in the history
  • Loading branch information
zsviczian committed Oct 29, 2023
1 parent c9d1283 commit 79bbabe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "excalibrain",
"name": "ExcaliBrain",
"version": "0.2.10",
"version": "0.2.11",
"minAppVersion": "1.1.6",
"description": "A clean, intuitive and editable graph view for Obsidian",
"author": "Zsolt Viczian",
Expand Down
11 changes: 6 additions & 5 deletions src/utils/dataview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,10 @@ const readDVField = (app: App, field: any, file:TFile):string[] => {
//! currently there is an issue with case sensitivity. DataView retains case sensitivity of links for the front matter, but not the others
const objectLinks:string[] = values
.filter((l:any) => l?.values && typeof l === "object" && typeof l.values[0] === "string")
.map((l:any)=>getPathOrSelf(app,l.values[0],file.path))
?.map((l:any)=>getPathOrSelf(app,l.values[0],file.path))

return Array.from(res).concat(stringLinks).concat(objectLinks);
if(!objectLinks) console.log({error: "objectLinks is undefined which is unexpected",errorLocation:"readDVField", field, file});
return Array.from(res).concat(stringLinks).concat(objectLinks??[]);
}

//the field is a single link
Expand Down Expand Up @@ -115,9 +116,9 @@ export const getPrimaryTag = (
if(dvPage[settings.primaryTagFieldLowerCase]) {
const tags = dvPage[settings.primaryTagFieldLowerCase]
.match(/#([^\s\])$"'\\]*)(?:$|\s)/g)
.map((match:string) => match.trim())
?.map((match:string) => match.trim())
.filter((t:string)=>settings.tagStyleList.some(x=>t.startsWith(x)));
const styleTag = (tags.length > 0) ? tags[0] : pageTags[0];
const styleTag = tags && (tags.length > 0) ? tags[0] : pageTags[0];
return [styleTag, pageTags.filter(t=>t!=styleTag)];
}
return [pageTags[0], pageTags.slice(1)];
Expand Down Expand Up @@ -146,7 +147,7 @@ export const getTagStyle = (
const prefixSet = new Set<string>();
if(style.prefix) prefixSet.add(style.prefix);
keys
.map(key=>settings.tagNodeStyles[key].prefix).filter(x=>Boolean(x))
?.map(key=>settings.tagNodeStyles[key].prefix).filter(x=>Boolean(x))
.forEach(x=>prefixSet.add(x));
const prefix = Array.from(prefixSet).join("");
return {
Expand Down

0 comments on commit 79bbabe

Please sign in to comment.