Skip to content

fix(autolink): allow dots in repo names and reject invalid slugs - #588

Open
upuddu wants to merge 1 commit into
charmbracelet:mainfrom
upuddu:fix/autolink-repo-dots
Open

fix(autolink): allow dots in repo names and reject invalid slugs#588
upuddu wants to merge 1 commit into
charmbracelet:mainfrom
upuddu:fix/autolink-repo-dots

Conversation

@upuddu

@upuddu upuddu commented Jul 7, 2026

Copy link
Copy Markdown

The link-shortening patterns used the character class [A-z0-9_-]. The A-z range also matches the ASCII punctuation between Z and a ([ \ ] ^ ), so URLs with those characters in the owner/repo were wrongly shortened; and the class excluded ., so links to repos whose names contain a dot - like github.com/vercel/next.js/issues/123- were never shortened. This switches to\w`-based classes and allows dots in the repository segment.

The shortening patterns used the character class [A-z0-9_-], where the
A-z range also matches the punctuation between Z and a ([ \ ] ^ ` ), so
URLs with those characters in the owner or repo slug were incorrectly
detected. The class also excluded dots, so links to common repositories
such as vercel/next.js were never shortened.

Use \w-based classes and allow dots in the repository segment.
@meowgorithm

Copy link
Copy Markdown
Member

Thanks for the contribution. Mind adding a bit more (human-written) context here? What are you seeing and how does this PR fix it?

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