Add highlighting in the note path (#327)
Co-authored-by: Maxime Lapointe <maxlap@gmail.com>
This commit is contained in:
@@ -39,6 +39,7 @@
|
|||||||
}
|
}
|
||||||
$: reg = stringsToRegex(note.foundWords)
|
$: reg = stringsToRegex(note.foundWords)
|
||||||
$: matchesTitle = getMatches(title, reg)
|
$: matchesTitle = getMatches(title, reg)
|
||||||
|
$: matchesNotePath = getMatches(notePath, reg)
|
||||||
$: matchesExcerpt = cloneDeep(note.matches).map(m => {
|
$: matchesExcerpt = cloneDeep(note.matches).map(m => {
|
||||||
m.offset = m.offset - cleanedContent.offset
|
m.offset = m.offset - cleanedContent.offset
|
||||||
return m
|
return m
|
||||||
@@ -94,7 +95,7 @@
|
|||||||
{#if notePath}
|
{#if notePath}
|
||||||
<div class="omnisearch-result__folder-path">
|
<div class="omnisearch-result__folder-path">
|
||||||
<span bind:this="{elFolderPathIcon}"></span>
|
<span bind:this="{elFolderPathIcon}"></span>
|
||||||
<span>{notePath}</span>
|
<span>{@html highlightText(notePath, matchesNotePath)}</span>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user