URL: Conform to URL Living Standard definition of valid URL#19871
Merged
URL: Conform to URL Living Standard definition of valid URL#19871
Conversation
6 tasks
getdave
reviewed
Jan 24, 2020
Contributor
getdave
left a comment
There was a problem hiding this comment.
I tested this and couldn't see any regressions with the Nav Block. Simple and effective.
WunderBart
reviewed
Jan 24, 2020
Member
Author
|
@getdave @WunderBart Would one or the other of you be able to approve the pull request? |
2 tasks
aduth
commented
Jan 29, 2020
24 tasks
These are now considered valid by `isURL` and are not necessary to evaluate separately.
d77f1b1 to
b2a3609
Compare
Member
Author
|
Upstream core patch: https://core.trac.wordpress.org/ticket/49360 The branch has been rebased to resolve conflicts, to add references to the above ticket (and a note about when the code can be removed from Gutenberg), and an additional check to make sure that the polyfill handling does not occur if the script is already registered (anticipating that this would be handled by core in the future). |
6 tasks
This was referenced Feb 7, 2020
etoledom
added a commit
that referenced
this pull request
Feb 11, 2020
Changes on this PR: #19871 broke the native `is-url` version since it won't throw if the given string is not a url.
Merged
Member
Author
|
The polyfill chosen here will not be workable. An alternative is proposed in #20225. |
etoledom
added a commit
that referenced
this pull request
Feb 14, 2020
* Fix mobile version of is-url. Changes on this PR: #19871 broke the native `is-url` version since it won't throw if the given string is not a url. * Mobile unit tests to is-url + better REGEXP * Fix lint issues * Remove not-needed comment * Adding inline comments to explain `.match()` decision over `.test()`. * Sharing test suit with web.
3 tasks
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.
Previously: #19816
Related: #9067
Cherry-picks e2c0f74 from #19823 (would require core back-port)
Unblocks: #19775
This pull request seeks to revise the implementation of
@wordpress/urlisURLto accept more of what should be considered as valid URLs based on the URL Living Standard definition of a valid URL string.This includes a number of newly-acceptable URLs:
mailtostringsftp:,ssh:,git:, etc)The original implementation was introduced in #9067, and based on the discussion in that pull request, it seems it was largely intended as a refactoring to replace a simple (naive) regular expression, and wasn't explicitly concerned with dealing with HTTP URLs. In fact, the changes with this pull request should further improve upon the intended changes in #9067, where a link will automatically be applied to e.g.
mailto:hello@example.comif the text is highlighted in a paragraph.Testing Instructions:
Ensure unit tests pass:
Verify there are no regressions in the intended handling of
mailto:andtel:links in the Navigation Block link editor experience (#17846), nor in the behavior of URL paragraph text auto-linking (#9067).