feat(CommandPalette): improve theme and performance

This commit is contained in:
Benjamin Canac
2024-06-07 16:01:30 +02:00
parent 4e17da21f3
commit 20476f4b9a
4 changed files with 24 additions and 20 deletions

View File

@@ -54,9 +54,9 @@ export function highlight<T>(item: T & { matches?: FuseResult<T>['matches'] }, s
content += value.substring(nextUnhighlightedRegionStartingIndex)
const endIndex = content.indexOf('</mark>')
if (endIndex > 50) {
content = truncateHTMLFromStart(content, 45)
const markIndex = content.indexOf('<mark>')
if (markIndex !== -1) {
content = truncateHTMLFromStart(content, content.length - markIndex)
}
return content