Repository navigation
News excerpts: a link in angle brackets is not a tag to close - #1092
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 () for an HTML tag namedhttps, and closed it at the cut:...</https>. The homepage'ssummaryOfthen stripped markdown's>before it stripped tags, so</https>became</httpsand 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