Skip to content

Commit

Permalink
fix(algolia): hit and docs body lines need to be mutually exclusive
Browse files Browse the repository at this point in the history
  • Loading branch information
almostSouji committed Oct 12, 2024
1 parent 4c7bc9f commit c8f5927
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/functions/algoliaResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ export async function algoliaResponse(

const contentParts = [
`<:${emojiName}:${emojiId}> ${bold(resolveHitToNamestring(hit))}${headlineSuffix ? ` ${headlineSuffix}` : ''}`,
hit.content?.length ? `${truncate(decode(hit.content), 300)}` : null,
docsBody?.lines.length ? docsBody.lines.at(0) : null,
hit.content?.length ? `${truncate(decode(hit.content), 300)}` : docsBody?.lines.at(0),
`${hyperlink('read more', hideLinkEmbed(hit.url))}`,
].filter(Boolean) as string[];

Expand Down

0 comments on commit c8f5927

Please sign in to comment.