Skip to content

Commit

Permalink
fix: include links in post excerpts
Browse files Browse the repository at this point in the history
closes #2840
  • Loading branch information
steveoh committed Sep 3, 2024
1 parent ecf8b8e commit dd09de2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utilities/collections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function getSnippetFromMarkdown(markdown: string, type: 'md' | 'mdx'): string {
}

// remove any non-text nodes such as ESM imports in MDX files
remove(parsedMarkdown, (node) => !['paragraph', 'heading', 'text'].includes(node.type));
remove(parsedMarkdown, (node) => !['paragraph', 'heading', 'text', 'link'].includes(node.type));

return toString(parsedMarkdown, { includeImageAlt: false }).slice(0, 200) ?? 'a blog post';
}
Expand Down

0 comments on commit dd09de2

Please sign in to comment.