feat: Allow #heading as display title setting (#434)

* feat: Allow #heading as display name setting

* Add displayTitle usage to create markdown link

* Tweak description text

* Address comments
This commit is contained in:
Eli W. Hunter
2025-01-29 03:45:14 -05:00
committed by GitHub
parent 8d52c2023b
commit 9d7f4183cf
4 changed files with 15 additions and 8 deletions
+3 -2
View File
@@ -240,9 +240,10 @@
// Generate link
let link: string
if (file && active) {
link = plugin.app.fileManager.generateMarkdownLink(file, active.path)
link = plugin.app.fileManager.generateMarkdownLink(file, active.path, "", selectedNote.displayTitle)
} else {
link = `[[${selectedNote.basename}.${getExtension(selectedNote.path)}]]`
const maybeDisplayTitle = selectedNote.displayTitle === "" ? "" : `|${selectedNote.displayTitle}`
link = `[[${selectedNote.basename}.${getExtension(selectedNote.path)}${maybeDisplayTitle}]]`
}
// Inject link
+5 -3
View File
@@ -172,9 +172,11 @@
<span>
{@html plugin.textProcessor.highlightText(title, matchesTitle)}
</span>
<span class="omnisearch-result__extension">
.{getExtension(note.path)}
</span>
{#if !note.displayTitle}
<span class="omnisearch-result__extension">
.{getExtension(note.path)}
</span>
{/if}
<!-- Counter -->
{#if note.matches.length > 0}