diff --git a/src/components/searchbox/NodeSearchBox.vue b/src/components/searchbox/NodeSearchBox.vue index 5d8f4b539..e3fe7a35d 100644 --- a/src/components/searchbox/NodeSearchBox.vue +++ b/src/components/searchbox/NodeSearchBox.vue @@ -43,38 +43,7 @@ :optionLabel="'display_name'" > - - - - - - - - - - - {{ option.category.replaceAll('/', ' > ') }} - - - - - - - - + @@ -92,11 +61,10 @@ + + diff --git a/src/utils/formatUtil.ts b/src/utils/formatUtil.ts index 6bec35cec..496c64ae6 100644 --- a/src/utils/formatUtil.ts +++ b/src/utils/formatUtil.ts @@ -33,3 +33,9 @@ export function appendJsonExt(path: string) { export function trimJsonExt(path: string) { return path.replace(/\.json$/, '') } + +export function highlightQuery(text: string, query: string) { + if (!query) return text + const regex = new RegExp(`(${query})`, 'gi') + return text.replace(regex, '$1') +}