r101598 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r101597‎ | r101598 | r101599 >
Date:09:33, 2 November 2011
Author:neilk
Status:ok
Tags:
Comment:
fixed issue with simple templates and arguments
Modified paths:
  • /trunk/extensions/UploadWizard/resources/mediawiki.language.parser.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UploadWizard/resources/mediawiki.language.parser.js
@@ -372,7 +372,7 @@
373373 }
374374
375375 var templateName = transform(
376 - makeRegexParser( /^[A-Za-z]\w+/ ),
 376+ makeRegexParser( /^[A-Za-z][\w ]+/ ),
377377 function( result ) { return result.toString().toUpperCase(); }
378378 );
379379
@@ -408,7 +408,9 @@
409409 templateWithReplacement,
410410 nOrMore( 0, templateParam )
411411 ] );
412 - return res === null ? null : res[0].concat( res[1] );
 412+ var ret = res === null ? null : res[0].concat( res[1] );
 413+ console.log( "templateWithReplacement!", ret );
 414+ return ret;
413415 },
414416 function() {
415417 var res = sequence( [
@@ -418,7 +420,7 @@
419421 if ( res === null ) {
420422 return null;
421423 }
422 - return res[1].length ? [ res[0], res[1] ] : [ res[0] ];
 424+ return [ res[0] ].concat( res[1] );
423425 }
424426 ] );
425427

Status & tagging log