Skip to content

Commit

Permalink
Prepend HTTP
Browse files Browse the repository at this point in the history
  • Loading branch information
getdave authored and draganescu committed Feb 7, 2023
1 parent 5df361a commit 935c7ef
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/block-library/src/button/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import { displayShortcut, isKeyboardEvent } from '@wordpress/keycodes';
import { link, linkOff } from '@wordpress/icons';
import { createBlock } from '@wordpress/blocks';
import { useMergeRefs } from '@wordpress/compose';
import { prependHTTP } from '@wordpress/url';

const NEW_TAB_REL = 'noreferrer noopener';

Expand Down Expand Up @@ -240,7 +241,7 @@ function ButtonEdit( props ) {
url: newURL = '',
opensInNewTab: newOpensInNewTab,
} ) => {
setAttributes( { url: newURL } );
setAttributes( { url: prependHTTP( newURL ) } );

if ( opensInNewTab !== newOpensInNewTab ) {
onToggleOpenInNewTab( newOpensInNewTab );
Expand Down

0 comments on commit 935c7ef

Please sign in to comment.