MWLinkAnnotationInspector: Work around annoying syntax highlighting bug in Gerrit

Wrap a regexp in parentheses to avoid confusing Gerrit's New UI syntax
highlighter, which goes crazy if a line starts with a regexp.
https://github.com/highlightjs/highlight.js/issues/1962

Change-Id: I7e4ca4d5c4d449925af7168147016ed2fb8a6e33
This commit is contained in:
Bartosz Dziewoński 2019-07-09 10:08:23 +02:00
parent a0aacd89e1
commit 9ba3255c26

View file

@ -217,7 +217,7 @@ ve.ui.MWLinkAnnotationInspector.prototype.onInternalLinkInputChange = function (
}
if (
!this.allowProtocolInInternal &&
/^(?:[a-z][a-z0-9$\-_@.&!*"'(),]*:)?\/\//i.test( value.trim() )
( /^(?:[a-z][a-z0-9$\-_@.&!*"'(),]*:)?\/\//i ).test( value.trim() )
) {
this.linkTypeIndex.setTabPanel( 'external' );
// Changing tabPanel focuses and selects the input, so collapse the cursor back to the end.