Fix docs search indexing

Agent-Logs-Url: https://github.com/MCCTeam/Minecraft-Console-Client/sessions/d698c0ee-5e22-482e-a065-7cc71068340a

Co-authored-by: milutinke <441903+milutinke@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-05-23 07:53:01 +00:00 committed by GitHub
parent 858f88d9ec
commit 6456149d39
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 1892 additions and 16554 deletions

View file

@ -16,6 +16,25 @@ import { mainConfig, defaultThemeConfig } from './configs/locales_config.js'
const isProd = process.env.NODE_ENV === 'production'
const htmlEntityMap: Record<string, string> = {
'&amp;': '&',
'&lt;': '<',
'&gt;': '>',
'&quot;': '"',
'&#39;': "'",
'&nbsp;': ' ',
}
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 {
@ -154,6 +173,10 @@ export default defineUserConfig({
searchPlugin({
maxSuggestions: 15,
hotKeys: ['s', '/'],
getExtraFields: (page) => {
const content = normalizeSearchText(page.contentRendered)
return content ? [content] : []
},
locales: {
'/': {
placeholder: 'Search',

View file

@ -3432,7 +3432,7 @@ redirectFrom:
</div>
- **Available values:** [Item Type List](https://raw.githubusercontent.com/MCCTeam/Minecraft-Console-Client/master/MinecraftClient/Inventory/ItemType.cs)
- **Available values:** [Item Type List](https://github.com/MCCTeam/Minecraft-Console-Client/blob/master/MinecraftClient/Inventory/ItemType.cs)
- **Type:** `array of strings with item names`

15420
docs/package-lock.json generated

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff