Linking text containing a colon breaks the URL
Description
When creating a link where the linked text itself contains a colon (:), WordPress incorrectly interprets the text after the colon as part of the URL.
Expected behavior: The linked text should remain unchanged, while the URL should only contain the actual hyperlink target.
Actual behavior: WordPress incorrectly includes the text after the colon in the generated link, resulting in malformed URLs.
Step-by-step reproduction instructions
Steps to reproduce: 1.Create or edit a post/page. 2.Add a hyperlink. 3.Use linked text containing a colon, for example:
Example:text
4.Insert a normal HTTPS URL.
Screenshots, screen recording, code snippet
Environment info
- WordPress 7.0, Gutenberg:
- Chrome Browser 146.0.7680.178 (Offizieller Build) (arm64)
Please confirm that you have searched existing issues in the repo.
- [x] Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
- [x] Yes
Please confirm which theme type you used for testing.
- [ ] Block
- [ ] Classic
- [ ] Hybrid (e.g. classic with theme.json)
- [x] Not sure
@ProLeadsOnline, It seems that feature is not provided by Gutenberg. The icon is different.
The default link icon looks like this.
Is any plugin overriding the default link functionality? Can you reproduce the issue with all plugins disabled?
This appears to have been addressed in #32301 (fixed via #32663), however I was able to reproduce the issue on the 23.3.0-rc.1 version. Looking into it further.
https://github.com/user-attachments/assets/8660425f-81e8-4561-ab9d-39019933831d
Image
WordPress incorrectly includes the text after the colon in the generated link, resulting in malformed URLs.
I don't think this as a bug. scheme-colon-path is a standard URI scheme: https://en.wikipedia.org/wiki/List_of_URI_schemes
Agree, this isn't a bug - the colon is supported purposely as there are a number of URI schemes (official and unofficial) that use it (mailto: and tel: being the most common). I'll close this.