diff --git a/src/utils.ts b/src/utils.ts index 2d8d140..622573f 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -19,9 +19,9 @@ export function truncateText(text: string, maxLength: number): string { export function stripHtml(html: string): string { return ( html - // Handle paragraphs - add double newline between them + // Handle paragraphs - HN uses

as paragraph separator (often without closing tags) .replace(/<\/p>\s*

/g, "\n\n") - .replace(/

/g, "") + .replace(/

/g, "\n\n") .replace(/<\/p>/g, "\n\n") .replace(//g, "\n") .replace(/]*href="([^"]*)"[^>]*>([^<]*)<\/a>/g, "$2 ($1)")