diff --git a/CodeMirror.php b/CodeMirror.php index 40931080..ecc2f054 100644 --- a/CodeMirror.php +++ b/CodeMirror.php @@ -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( diff --git a/resources/mode/mediawiki/mediawiki.js b/resources/mode/mediawiki/mediawiki.js index c51eed3c..8fbb6ab2 100644 --- a/resources/mode/mediawiki/mediawiki.js +++ b/resources/mode/mediawiki/mediawiki.js @@ -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 ':'