-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
feat: Support URL extraction from markdown link syntax #55850
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,8 +30,9 @@ interface IURLGenerator { | |
| * | ||
| * @since 25.0.0 | ||
| * @since 29.0.0 changed to match localhost and hostnames with ports | ||
| * @since 33.0.0 changed to match URLs in markdown link syntax and square brackets in query parameters | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. since line also needs to be on
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should also add that those are now part of the match and therefor regex group 2+3 are the actual link going forward and the full match in itself does not have to be a full valid link anymore. |
||
| */ | ||
| public const URL_REGEX_NO_MODIFIERS = '(\s|\n|^)(https?:\/\/)([-A-Z0-9+_.]+(?::[0-9]+)?(?:\/[-A-Z0-9+&@#%?=~_|!:,.;()]*)*)(\s|\n|$)'; | ||
| public const URL_REGEX_NO_MODIFIERS = '(\s|\n|^|\]\()(https?:\/\/)([-A-Z0-9+_.]+(?::[0-9]+)?(?:\/[-A-Z0-9+&@#%?=~_|!:,.;\[\()]*)*)(\s|\n|$|\))'; | ||
|
|
||
| /** | ||
| * Returns the URL for a route | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should definitely add tests for this method, are you able to do that, or should someone assist/take over?