feat(ui): update SVG assets and enhance localization for knowledge framework
- Redesigned SVG assets for screenshots to improve visual consistency and clarity, including updates to gradients, titles, and layout. - Added a new screenshot asset to showcase the Wiki Knowledge Base feature. - Enhanced localization strings across multiple languages to reflect updated terminology and descriptions for the knowledge framework, including agentic reasoning and hybrid search strategies. - Improved the user interface in the login view to include new tags for agent and wiki features, enhancing user awareness of available functionalities.
This commit is contained in:
@@ -15,6 +15,28 @@ export function escapeHtml(str: string): string {
|
||||
.replace(/'/g, ''')
|
||||
}
|
||||
|
||||
export function highlightRegex(text: string, pattern: string): string {
|
||||
const src = text || ''
|
||||
const p = (pattern || '').trim()
|
||||
const escaped = escapeHtml(src)
|
||||
if (!p) return escaped
|
||||
try {
|
||||
const re = new RegExp(p, 'gi')
|
||||
let result = ''
|
||||
let lastIndex = 0
|
||||
for (const match of src.matchAll(re)) {
|
||||
const idx = match.index ?? 0
|
||||
result += escapeHtml(src.slice(lastIndex, idx))
|
||||
result += `<mark class="search-highlight">${escapeHtml(match[0])}</mark>`
|
||||
lastIndex = idx + match[0].length
|
||||
}
|
||||
result += escapeHtml(src.slice(lastIndex))
|
||||
return result
|
||||
} catch {
|
||||
return escaped
|
||||
}
|
||||
}
|
||||
|
||||
export function highlightText(text: string, query: string): string {
|
||||
const q = (query || '').trim()
|
||||
const escaped = escapeHtml(text || '')
|
||||
|
||||
Reference in New Issue
Block a user