fix(autolink): allow dots in repo names and reject invalid slugs - #588
Open
upuddu wants to merge 1 commit into
Open
fix(autolink): allow dots in repo names and reject invalid slugs#588upuddu wants to merge 1 commit into
upuddu wants to merge 1 commit into
Conversation
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.
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? |
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 link-shortening patterns used the character class
[A-z0-9_-]. TheA-zrange also matches the ASCII punctuation betweenZanda([ \ ] ^), 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 - likegithub.com/vercel/next.js/issues/123- were never shortened. This switches to\w`-based classes and allows dots in the repository segment.