Skip to content

Conversation

@jeryj
Copy link
Contributor

@jeryj jeryj commented Feb 2, 2026

What?

  1. In Add URL validation in LinkControl using ValidatedInputControl #73486 we said we were relying on new URL to validate URLs, but this isn't entirely true. We are using isURLLike to filter out some URLs that would pass the new URL constructor (URLs with spaces, for example, get converted to %20) and we also allow hash links and fragments to skip the new URL check. Not only that, but we call hash links with duplicate # invalid, but new URL passes these and it does technically work.

  2. I noticed that prependHTTPS's flow is to prependHTTP then replace http with https. Since we're defaulting to https more, the easiest way to improve this is to switch that. Have prependHTTP rely on replacing https with http.

Why?

I'm not sure this is the right direction, but wanted to open the discussion to get consistency.

How?

Rely solely on new URL for consistency.

Testing Instructions

Testing Instructions for Keyboard

Screenshots or screencast

Before After

@github-actions github-actions bot added [Package] Url /packages/url [Package] Block editor /packages/block-editor labels Feb 2, 2026
@jeryj
Copy link
Contributor Author

jeryj commented Feb 2, 2026

@getdave - not a priority but what are your thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Block editor /packages/block-editor [Package] Url /packages/url

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants