diff --git a/src/functions/docs.ts b/src/functions/docs.ts index 6241c82..07b8993 100644 --- a/src/functions/docs.ts +++ b/src/functions/docs.ts @@ -49,6 +49,10 @@ function searchURL(pack: string, version: string) { return `${BASE_SEARCH}indexes/${pack}-${version.replaceAll('.', '-')}/search`; } +function sanitizeText(name: string) { + return name.replaceAll('*', ''); +} + export async function queryDocs(query: string, pack: string, version: string) { const searchRes = await fetch(searchURL(pack, version), { method: 'post', @@ -92,7 +96,7 @@ export async function queryDocs(query: string, pack: string, version: string) { return { ...hit, - autoCompleteName: truncate(`${name}${hit.summary ? ` - ${hit.summary}` : ''}`, 100, ' '), + autoCompleteName: truncate(`${name}${hit.summary ? ` - ${sanitizeText(hit.summary)}` : ''}`, 100, ' '), autoCompleteValue: parts.join('|'), isMember, };