-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Raw Handling: Text with colon incorrectly interpreted as a link #24895
Raw Handling: Text with colon incorrectly interpreted as a link #24895
Comments
Seems like the problem is in gutenberg/packages/url/src/is-url.js Lines 16 to 25 in a4e381b
new URL doesn't throw. Maybe we can use valid-url dependency?
|
@kirilzh there is an issue with Is there we are using any packages for the check URL is valid or not? or maybe we can create an additional check here for validating URL. |
I suggest just returning FALSE if the successfully parsed URL pathname begins with whitespace. Or the scheme begins with a capital letter but is not all caps. Otherwise you get in the business of the big list of established URI schemes. |
I can submit a PR on branch 7.7.0 but the master branch fails in attempt to patch xcode (I'm on linux). |
There was a similar fix here that it might be possible to take inspiration from - #32663 The difference here is that this problem is pasting something that looks like a link over an existing text selection, whereas that other issue fixed a problem when highlighting text that looks like a link and selecting the link button. |
I have been able to reproduce this. |
Hi, what a horrible "feature". When you select text and paste something, you want to replace it with the pasted content. You have a button to make a link ... |
Noting that I can replicate this with 6.3 RC 1. |
Describe the bug
When pasting over existing text, if the new text has a colon in it without first having a space character, Gutenberg will assume you are pasting a link and will open the link insertion dialog box.
To reproduce
Steps to reproduce the behavior:
Expected behavior
The text should paste without inserting it as a link.
Screenshots
Editor version (please complete the following information):
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: