Skip to content

Commit

Permalink
chore(docs): remove asterisk from summy in autocomplete name
Browse files Browse the repository at this point in the history
  • Loading branch information
almostSouji committed Jul 21, 2024
1 parent 26c69eb commit 224086c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/functions/docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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,
};
Expand Down

0 comments on commit 224086c

Please sign in to comment.