Skip to content

Commit

Permalink
fix case when alias contains a colon
Browse files Browse the repository at this point in the history
  • Loading branch information
zsviczian committed Apr 29, 2023
1 parent 87c7910 commit 09a4bf3
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/graph/Page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,18 @@ export class Page {
const aliases = (this.file && this.plugin.settings.renderAlias)
? (this.dvPage?.file?.aliases?.values??[])
: [];
const defaultName = aliases.length > 0
let defaultName = aliases.length > 0
? aliases[0]
: this.name

//when the alias contains a colon, it is parsed by DataView as an object
if(defaultName === "[object Object]") {
if(this.dvPage.aliases?.[0]) {
defaultName = Object.entries(this.dvPage.aliases[0])[0].join(": ");
} else {
defaultName = this.name;
}
}
if(this.dvPage?.file && this.plugin.customNodeLabel) {
try {
return this.plugin.customNodeLabel(this.dvPage, defaultName);
Expand Down

0 comments on commit 09a4bf3

Please sign in to comment.