Button: Prepend HTTP to Buttons block links when missing protocol#47311
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
scruffian
left a comment
There was a problem hiding this comment.
LGTM. Should we add a test for this?
|
@scruffian I added an e2e test |
kevin940726
left a comment
There was a problem hiding this comment.
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 <kevin830726@gmail.com>
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