Skip to content

Fix HTML paragraph parsing in comment text - #12

Merged
brianlovin merged 1 commit into
mainfrom
brianlovin/fix-comment-linebreaks
Jan 26, 2026
Merged

Fix HTML paragraph parsing in comment text#12
brianlovin merged 1 commit into
mainfrom
brianlovin/fix-comment-linebreaks

Conversation

@brianlovin

Copy link
Copy Markdown
Owner

HN comments use <p> tags as paragraph separators but often without closing tags. The previous logic was stripping <p> tags entirely, causing consecutive sentences to merge without spacing. This fix converts <p> tags to double newlines for proper paragraph breaks, matching the intended display on brianlovin.com/hn.

Tested with both HN-style HTML (unclosed tags) and proper HTML format.

HN comments use <p> tags as paragraph separators but often without closing tags. The previous logic was stripping <p> tags entirely, causing consecutive sentences to merge without spacing. Now <p> tags are converted to double newlines for proper paragraph breaks.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@brianlovin
brianlovin merged commit 4ad08f4 into main Jan 26, 2026
1 check passed
@brianlovin
brianlovin deleted the brianlovin/fix-comment-linebreaks branch January 26, 2026 05:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant