feat: update debug

This commit is contained in:
tim
2025-07-08 20:43:11 +08:00
parent a0d42360c6
commit 4b369b2d8b

View File

@@ -26,6 +26,7 @@
import { ref } from 'vue'
import Dropdown from './Dropdown.vue'
import { API_BASE_URL } from '../main'
import { stripMarkdown } from '../utils/markdown'
export default {
name: 'SearchDropdown',
@@ -49,9 +50,11 @@ export default {
}
const highlight = (text) => {
text = stripMarkdown(text)
if (!keyword.value) return text
const reg = new RegExp(keyword.value, 'gi')
return text.replace(reg, m => `<span class="highlight">${m}</span>`)
const res = text.replace(reg, m => `<span class="highlight">${m}</span>`)
return res;
}
const iconMap = {