-
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
Button: Prepend HTTP to Buttons block links when missing protocol #47311
Conversation
Size Change: +21 B (0%) Total Size: 1.31 MB
ℹ️ View Unchanged
|
Flaky tests detected in d70db6a. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4116781516
|
9950f96
to
8080ac4
Compare
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.
LGTM. Should we add a test for this?
@scruffian I added an e2e test |
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.
Small error in the test, others look good to me 👍 !
this would also close #6841 |
tested with several links; worked as expected. I also created buttons with several other protocols (git, mailto, tel, doi, and http was not prepended to them; those links still worked as expected. (note that this issue also affects image blocks - up to you whether that should be a separate PR |
634b7d2
to
c6bf594
Compare
Co-authored-by: Kai Hao <[email protected]>
What?
Prepends
http://
to links created using the button block which don't provide a protocol.Closes #46385
Why?
Because it provides a better UX.
How?
prependUrl()
from@wordpress/url
.Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast