mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2026-08-15 13:04:36 +00:00
[skipci]Revert docs changes to fix search
docs: remove committed translation files, keep search freeze fix only
This commit is contained in:
commit
de7af06d11
1 changed files with 0 additions and 23 deletions
|
|
@ -16,25 +16,6 @@ import { mainConfig, defaultThemeConfig } from './configs/locales_config.js'
|
|||
|
||||
const isProd = process.env.NODE_ENV === 'production'
|
||||
|
||||
const htmlEntityMap: Record<string, string> = {
|
||||
'&': '&',
|
||||
'<': '<',
|
||||
'>': '>',
|
||||
'"': '"',
|
||||
''': "'",
|
||||
' ': ' ',
|
||||
}
|
||||
|
||||
function normalizeSearchText(text: string): string {
|
||||
return text
|
||||
.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, ' ')
|
||||
.replace(/<style\b[^<]*(?:(?!<\/style>)<[^<]*)*<\/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',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue