From 224086c5a1b8f61db0d1a8abb6f84d5f44e2b923 Mon Sep 17 00:00:00 2001 From: almostSouji Date: Sun, 21 Jul 2024 13:31:42 +0200 Subject: [PATCH] chore(docs): remove asterisk from summy in autocomplete name --- src/functions/docs.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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, };