diff --git a/blocks/rich-text/format-toolbar/index.js b/blocks/rich-text/format-toolbar/index.js index 8f997a71ec4388..0c63568cdbd3c2 100644 --- a/blocks/rich-text/format-toolbar/index.js +++ b/blocks/rich-text/format-toolbar/index.js @@ -11,6 +11,7 @@ import { withSpokenMessages, } from '@wordpress/components'; import { keycodes } from '@wordpress/utils'; +import { prependHTTP } from '@wordpress/url'; /** * Internal dependencies @@ -138,7 +139,7 @@ class FormatToolbar extends Component { event.preventDefault(); this.setState( { isEditingLink: false, isAddingLink: false, newLinkValue: '' } ); this.props.onChange( { link: { - value: this.state.newLinkValue, + value: prependHTTP( this.state.newLinkValue ), target: this.state.opensInNewWindow ? '_blank' : null, rel: this.state.opensInNewWindow ? 'noreferrer noopener' : null, } } ); diff --git a/package-lock.json b/package-lock.json index 20326c909b8b78..7d79d3fdd3eab0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -458,9 +458,9 @@ } }, "@wordpress/url": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@wordpress/url/-/url-1.0.3.tgz", - "integrity": "sha512-0nqf62SWS0DiFnSD5miszPuAey01OrBsdqBFzOCYChjtB7AZm+8Q06qpeV02rpLY5FHaUxVgL+2JRljYIAFlpA==" + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@wordpress/url/-/url-1.1.0.tgz", + "integrity": "sha512-KT+C4vCh6kYux5fAcyM9Nqj0pVKxYptJde3AcggvZ1rJ71+LNJI63EQFmUhJU0reaNduzQ+YFub9tcQrc7ckmA==" }, "@wordpress/wordcount": { "version": "1.0.0", diff --git a/package.json b/package.json index 2caa2d00a53021..d68f927e8f8472 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "@wordpress/dom-ready": "1.0.4", "@wordpress/hooks": "1.1.6", "@wordpress/i18n": "1.1.0", - "@wordpress/url": "1.0.3", + "@wordpress/url": "1.1.0", "@wordpress/wordcount": "1.0.0", "classnames": "2.2.5", "clipboard": "1.7.1",