Skip to content

fix: keep ellipses and curly quotes out of linked URLs - #765

Merged
brendt merged 1 commit into
dev-null-sh:productionfrom
Heyosseus:fix/link-punctuation
Oct 20, 2026
Merged

brendt merged 1 commit into
dev-null-sh:productionfrom
Heyosseus:fix/link-punctuation

Conversation

@Heyosseus

Copy link
Copy Markdown
Contributor

Bug

The linkifier only stripped ASCII punctuation (.,;:!?'") from the end of a URL, so …, ” and ’ became part of the link.

  • Feed previews: the excerpt adds … straight after its last word. When that word is a URL (for example, the 8th line of a 9+ line post), the preview link points to https://example.com/x… (%E2%80%A6), which 404s. The same link works after "Show more".
  • Smart punctuation: iOS types curly quotes by default, so “https://example.com/foo”. links to https://example.com/foo”. The server-side link card (Urls::all) fetched the same wrong URL.

Fix

Add …, ” and ’ to the trailing-punctuation strip in both linkified-text.tsx and Urls.php, which are meant to stay in sync. The same characters in the middle of a URL are kept.

Tests

  • UrlsTest.php: ellipsis, curly quotes, inner characters kept, bare domains with a path.
  • LinkifiedText.test.tsx: the href excludes the trailing character, and the character is still shown as text after the link.

@brendt
brendt merged commit a281ca4 into dev-null-sh:production Oct 20, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants