feat: linkExternalUrls to use GFM-style detection#1879
Merged
pedrolamas merged 2 commits intoJun 16, 2026
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates linkExternalUrls (used to linkify warning/notification text rendered via v-safe-html) to follow more GitHub Flavored Markdown-like URL detection, avoiding inclusion of wrapping quotes and trailing punctuation in generated links.
Changes:
- Tightened URL matching regex to exclude common wrapper characters.
- Added
trimUrl()to strip trailing punctuation and unmatched closing parentheses before linkifying. - Added a Vitest spec covering quotes, punctuation, parentheses, and multiple URLs.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/util/link-external-urls.ts | Reworks URL detection/linkification to trim GFM-style trailing punctuation and unmatched ) before generating anchors. |
| src/util/tests/link-external-urls.spec.ts | Adds unit tests validating the new linkification behavior for common punctuation/parentheses cases. |
Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
4f408c7 to
d5a27f4
Compare
Signed-off-by: Pedro Lamas <pedrolamas@gmail.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.
Improves
linkExternalUrlsto use GFM-style URL detection so quotes and trailing punctuation are excluded from links, and added a test spec.