Skip to content

News excerpts: a link in angle brackets is not a tag to close - #1092

Merged
adamjohnwright merged 2 commits into
mainfrom
fix/news-excerpt-autolink
Nov 26, 2026
Merged

adamjohnwright merged 2 commits into
mainfrom
fix/news-excerpt-autolink

Conversation

@adamjohnwright

Copy link
Copy Markdown
Contributor

The homepage's lead news item (V98 Released) ended its summary with ...</https.

Cause. Excerpts are cut by truncateHtml, which took a markdown link written in angle brackets (![…](<https://…svg>)) for an HTML tag named https, and closed it at the cut: ...</https>. The homepage's summaryOf then stripped markdown's > before it stripped tags, so </https> became </https and was printed.

Fix.

  • truncateHtml: a tag's name ends at a space, a slash or the bracket, so <https://…>, <http://…> and <mailto:…> are not tags.
  • summaryOf: tags are stripped before markdown's characters.

Checks. Each fix has a unit test seen failing on main. Run over every content page (220), 62 excerpts change, and each change is only the loss of such closers at its end (</https>, </http>, </mailto>); the closers that remain close real HTML.

Single-PR fix; no spec.

🤖 Generated with Claude Code

adamjohnwright and others added 2 commits November 26, 2026 18:32
The homepage's lead news item (V98) ended "...</https". The excerpt is cut by
truncateHtml, which took the markdown link <https://download...svg> for an HTML tag
named "https" and closed it at the cut: "...</https>". The homepage summary then
stripped markdown's '>' before stripping tags, so "</https>" became "</https" and
was printed.

- truncateHtml: a tag's name ends at a space, a slash or the bracket, so
  <https://...> and <mailto:...> are no longer tags.
- summaryOf: tags are stripped before markdown's characters.

Each has a test seen failing on main. Across all 220 content pages, 62 excerpts
change, and each only loses such closers at its end (</https>, </mailto>, </http>).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…link's text kept

From the adversarial review of this pull request: stripping tags first deleted an
address written as <https://...> outright (the deprecated RESTful API announcement
read "at and is designed"), and "<[^>]+>" took "p < 0.05 and q > 1" for a tag. The
summary now shows such an address as the address, strips only what is shaped like
a tag, and keeps the text of a link the excerpt was cut through (V77, V96 ended in
"[Maturation of nucleoprotein](..." and "([Differentiation of ...").

Each has a test seen failing first. Over all 89 news articles, as the index cuts
them, no summary prints a bracket of markup.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@adamjohnwright
adamjohnwright merged commit d27e07d into main Nov 26, 2026
9 checks passed
@adamjohnwright
adamjohnwright deleted the fix/news-excerpt-autolink branch November 26, 2026 19:10
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