mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-25 06:46:26 +00:00
Improvements for template / -argument precedence; support for empty params
Change-Id: Id0894ccbedfa47fa3658817ca65119a2af76be3e
This commit is contained in:
parent
2037215185
commit
e3a745a024
|
@ -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] );
|
||||
}
|
||||
|
|
|
@ -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 }
|
||||
)*
|
||||
|
|
Loading…
Reference in a new issue