mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-26 19:56:49 +00:00
Merge "MWLinkTargetInputWidget: Check title is valid in MediaWiki"
This commit is contained in:
commit
73e05df441
|
@ -97,7 +97,7 @@ ve.ui.MWLinkTargetInputWidget.prototype.isValid = function () {
|
|||
valid = this.annotation.getAttribute( 'href' )
|
||||
.match( /(^|\s)((https?:\/\/)?[\w-]+(\.[\w-]+)+\.?(:\d+)?(\/\S*)?)/gi );
|
||||
} else {
|
||||
valid = !!this.getValue();
|
||||
valid = !!mw.Title.newFromText( this.getValue() );
|
||||
}
|
||||
return $.Deferred().resolve( valid ).promise();
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue