Skip to content

fix(comments): stop hyperlinks truncating at hyphens - #30

Merged
Rushaway merged 1 commit into
mainfrom
fix/comment-link-hyphen-truncation
Sep 17, 2026
Merged

Rushaway merged 1 commit into
mainfrom
fix/comment-link-hyphen-truncation

Conversation

@Rushaway

Copy link
Copy Markdown
Member

Summary

  • Auto-linkified comment URLs were truncated at the first hyphen because the path character class ([\w/_\.]*) didn't include -
  • Example: https://youtu.be/T1MnG-gKgF0 rendered as a clickable https://youtu.be/T1MnG followed by plain-text -gKgF0
  • Added - to the path character class in all three duplicated occurrences of this regex

Test plan

  • Verified fixed regex against https://youtu.be/T1MnG-gKgF0 locally with php -r — full URL now links correctly
  • Post a comment containing a hyphenated URL on the banlist / commslist / admin bans pages and confirm the full link is clickable

🤖 Generated with Claude Code

The auto-linkify regex for comment URLs used [\w/_\.]* for the path
segment, which excludes '-'. A link like
https://youtu.be/T1MnG-gKgF0 was rendered as a clickable
https://youtu.be/T1MnG followed by plain-text -gKgF0. Added '-' to
the path character class in all three places this regex is
duplicated.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@Rushaway
Rushaway requested a review from maxijabase September 16, 2026 21:56
@Rushaway
Rushaway merged commit 2380d22 into main Sep 17, 2026
4 checks passed
@Rushaway
Rushaway deleted the fix/comment-link-hyphen-truncation branch September 17, 2026 12:01
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