diff --git a/docs/.vuepress/config.ts b/docs/.vuepress/config.ts index 3afb96dc..d03ff77a 100644 --- a/docs/.vuepress/config.ts +++ b/docs/.vuepress/config.ts @@ -16,25 +16,6 @@ import { mainConfig, defaultThemeConfig } from './configs/locales_config.js' const isProd = process.env.NODE_ENV === 'production' -const htmlEntityMap: Record = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - ''': "'", - ' ': ' ', -} - -function normalizeSearchText(text: string): string { - return text - .replace(/)<[^<]*)*<\/script>/gi, ' ') - .replace(/)<[^<]*)*<\/style>/gi, ' ') - .replace(/<[^>]+>/g, ' ') - .replace(/&(amp|lt|gt|quot|#39|nbsp);/g, (match) => htmlEntityMap[match] ?? ' ') - .replace(/\s+/g, ' ') - .trim() -} - function vueTemplateTolerantPlugin(): Plugin { let compilerSfc: typeof import('@vue/compiler-sfc') | undefined return { @@ -173,10 +154,6 @@ export default defineUserConfig({ searchPlugin({ maxSuggestions: 15, hotKeys: ['s', '/'], - getExtraFields: (page) => { - const content = normalizeSearchText(page.contentRendered) - return content ? [content] : [] - }, locales: { '/': { placeholder: 'Search',