This commit is contained in:
Michael Naumov 2025-04-10 12:26:29 -06:00
parent d8daa16f0e
commit e4da485498
2 changed files with 18 additions and 11 deletions

View file

@ -101,19 +101,23 @@ export class Plugin extends PluginBase<PluginTypes> {
const container = createDiv();
setTooltip(container, file.path);
if (parentStr) {
container.appendText(parentStr);
if (this.settings.shouldDisplayParentPathOnSeparateLine) {
container.createEl('br');
} else {
container.createSpan({ prepend: this.settings.shouldReversePathParts, text: pathSeparator });
}
}
container.createSpan({
cls: this.settings.shouldHighlightFileName ? 'backlink-full-path file-name' : '',
prepend: this.settings.shouldReversePathParts && !this.settings.shouldDisplayParentPathOnSeparateLine,
cls: ['backlink-full-path', 'file-name', ...(this.settings.shouldHighlightFileName ? ['file-name-highlighted'] : [''])],
text: fileNamePart
});
if (parentStr) {
let text = parentStr;
if (!this.settings.shouldDisplayParentPathOnSeparateLine) {
text = this.settings.shouldReversePathParts ? pathSeparator + text : text + pathSeparator;
}
container.createSpan({
cls: ['backlink-full-path', 'parent-path', ...(this.settings.shouldDisplayParentPathOnSeparateLine ? ['separate-line'] : [])],
prepend: !this.settings.shouldReversePathParts && !this.settings.shouldDisplayParentPathOnSeparateLine,
text
});
}
return container;
}

View file

@ -1,6 +1,9 @@
.backlink-full-path {
&.file-name {
&.file-name.file-name-highlighted {
font-size: var(--font-ui-large);
font-weight: bold;
}
&.parent-path.separate-line {
display: block;
}
}