Skip to content

fix(output): print links once and show dates - #7

Merged
voska merged 3 commits into
voska:masterfrom
shbernal:fix/comment-text
Nov 3, 2026
Merged

voska merged 3 commits into
voska:masterfrom
shbernal:fix/comment-text

Conversation

@shbernal

Copy link
Copy Markdown
Contributor

Three small fixes to what hn prints:

  • Links print once. Comments printed each link twice, the second copy shortened with .... One large thread had 30 such pairs.
  • Escaped markup stays literal. CleanHTML decoded entities before stripping tags, so a comment that discussed <p> lost it to a line break. Entities now decode last.
  • Anything older than a day shows its date. 3mo ago becomes 2026-07-30. Relative ages drift in saved output, and at this range they are rounded to the month or year.

Checked with make test, golangci-lint, and a live read of that thread.

Comments printed every link twice, the second copy shortened with
"...", which cost tokens and carried nothing.

Tags are now stripped before entities are decoded. In the old order a
comment discussing `<p>` lost it to a line break.

Anything older than a day shows its date. "3mo ago" says little in a
saved note, and an agent has to work out what it means.
@voska

voska commented Oct 30, 2026

Copy link
Copy Markdown
Owner

All three are right. Decoding entities last fixes the <p> case properly, and replacing the auto-link with its href drops the shortened duplicate without losing anything, since HN only links bare URLs. Dates past the first day also hold up better once output gets saved or pasted somewhere.

@voska
voska merged commit eb1d410 into voska:master Nov 3, 2026
2 checks passed
@voska

voska commented Nov 5, 2026

Copy link
Copy Markdown
Owner

This shipped in v0.3.0.

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.

2 participants