mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-02 03:30:04 +00:00
Extract search option as a Vue component (#838)
This commit is contained in:
@@ -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, '<span class="highlight">$1</span>')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user