diff --git a/modules/ve-mw/ui/widgets/ve.ui.MWMediaSearchWidget.js b/modules/ve-mw/ui/widgets/ve.ui.MWMediaSearchWidget.js index 0679b291e9..1c4a1c1578 100644 --- a/modules/ve-mw/ui/widgets/ve.ui.MWMediaSearchWidget.js +++ b/modules/ve-mw/ui/widgets/ve.ui.MWMediaSearchWidget.js @@ -199,7 +199,12 @@ ve.ui.MWMediaSearchWidget.prototype.processQueueResults = function ( items ) { * @return {string} Query value */ ve.ui.MWMediaSearchWidget.prototype.getQueryValue = function () { - return this.query.getValue().trim(); + var queryValue = this.query.getValue().trim(); + + if ( queryValue.match( ve.init.platform.getExternalLinkUrlProtocolsRegExp() ) ) { + queryValue = queryValue.match( /.+\/([^\/]+)/ )[ 1 ]; + } + return queryValue; }; /**