diff --git a/modules/parser/mediawiki.parser.environment.js b/modules/parser/mediawiki.parser.environment.js index a30b27bfdd..efef63cb69 100644 --- a/modules/parser/mediawiki.parser.environment.js +++ b/modules/parser/mediawiki.parser.environment.js @@ -300,7 +300,11 @@ MWParserEnvironment.prototype.sanitizeURI = function ( s ) { MWParserEnvironment.prototype.dp = function ( ) { if ( this.debug ) { if ( arguments.length > 1 ) { - console.warn( JSON.stringify( arguments, null, 2 ) ); + try { + console.warn( JSON.stringify( arguments, null, 2 ) ); + } catch ( e ) { + console.warn( e ); + } } else { console.warn( arguments[0] ); } diff --git a/modules/parser/pegTokenizer.pegjs.txt b/modules/parser/pegTokenizer.pegjs.txt index a32aecd156..d5853acc9e 100644 --- a/modules/parser/pegTokenizer.pegjs.txt +++ b/modules/parser/pegTokenizer.pegjs.txt @@ -830,8 +830,8 @@ ipv6_address tplarg_or_template = ! '{{{{{{{' ( - &'{{{{{{' tplarg - / & '{{{{{' template + & ( '{{{{{{' (!'}}}' .)* '}}}}}}') tplarg + / & ( '{{{{{' (!'}}}' .)* '}}}}}') template / tplarg / template ) @@ -840,7 +840,7 @@ template = "{{" (newline / space)* target:template_name params:(( newline / space )* "|" - r:( &"|" { return new KV( '', '') } // empty argument + r:( (newline / space )* &"|" { return new KV( '', '') } // empty argument / p:template_param { return p } ) { return r } )*