Merge "Don't match // as protocol unless used in a link"

This commit is contained in:
jenkins-bot 2018-03-15 23:51:21 +00:00 committed by Gerrit Code Review
commit 0e4bb8feb6

View file

@ -643,7 +643,7 @@
}
if ( sol ) {
if ( stream.match( urlProtocols ) ) { // highlight free external links, bug T108448
if ( !stream.match( '//', false ) && stream.match( urlProtocols ) ) { // highlight free external links, bug T108448
state.stack.push( state.tokenize );
state.tokenize = eatFreeExternalLink;
return makeLocalStyle( 'mw-free-extlink-protocol', state );
@ -841,7 +841,7 @@
default:
if ( /[\s\u00a0]/.test( ch ) ) {
stream.eatSpace();
if ( stream.match( urlProtocols, false ) ) { // highlight free external links, bug T108448
if ( stream.match( urlProtocols, false ) && !stream.match( '//' ) ) { // highlight free external links, bug T108448
state.stack.push( state.tokenize );
state.tokenize = eatFreeExternalLinkProtocol;
return makeStyle( style, state );