mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CodeMirror
synced 2024-11-15 02:04:02 +00:00
fix highlighting template variable (v 1.9.2)
Change-Id: Iea975300c0ce1a3f80f75bff1be7b013bad4c420
This commit is contained in:
parent
89e584b947
commit
5cbe8bd28f
|
@ -15,7 +15,7 @@ if ( !defined( 'MEDIAWIKI' ) ) {
|
|||
die( 'This file is an extension to MediaWiki and thus not a valid entry point.' );
|
||||
}
|
||||
|
||||
const EXT_CODEMIRROR_VERSION = '1.9.1';
|
||||
const EXT_CODEMIRROR_VERSION = '1.9.2';
|
||||
|
||||
// Register this extension on Special:Version
|
||||
$wgExtensionCredits['parserhook'][] = array(
|
||||
|
|
|
@ -143,19 +143,14 @@ CodeMirror.defineMode('mediawiki', function( config/*, parserConfig */ ) {
|
|||
style.push( 'string' );
|
||||
break;
|
||||
case 'TemplateVariable':
|
||||
if ( stream.eatWhile( /[^\}\&]/ ) ) {
|
||||
if ( stream.eatWhile( /[^\}\[\]<\{\|\&]/ ) ) {
|
||||
return 'variable-2';
|
||||
}
|
||||
if ( stream.match( '}}}' ) ) {
|
||||
state.ImInBlock.pop();
|
||||
return 'variable-2';
|
||||
}
|
||||
if ( stream.peek() === '&' ) {
|
||||
style = ['variable-2'];
|
||||
} else {
|
||||
stream.next();
|
||||
return 'variable-2';
|
||||
}
|
||||
style = ['variable-2'];
|
||||
break;
|
||||
case 'ParserFunctionName':
|
||||
if ( stream.match( /#?[^\s\u00a0\}\[\]<\{\'\|\&\:]+/ ) ) { // FIXME: {{#name}} and and {{uc}} are wrong, must have ':'
|
||||
|
|
Loading…
Reference in a new issue