mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/TemplateData
synced 2024-11-27 17:20:01 +00:00
Update grammar to yield the results in the examples
Change-Id: I5c546e8b80cd7668dce5867b5cabd7940765410e
This commit is contained in:
parent
e7323c051b
commit
7759c1ede2
|
@ -284,8 +284,8 @@ The key corresponds to the name of a Consumer variable that relates to the speci
|
|||
A format string describes how whitespace should be added to a template instantiation in wikitext. A format string looks like `{{_|_=_}}`, with optional whitespace and extended underscores. Formally, its structure is given by the following grammar:
|
||||
```
|
||||
FormatString = StartFormat ParameterFormat EndFormat
|
||||
StartFormat = nl? "{{" ws* Hole ws*
|
||||
ParameterFormat = nl? "|" nl? ws* Hole ws* "=" ws* Hole
|
||||
StartFormat = nl? "{{" ws* Hole
|
||||
ParameterFormat = nl? ws* "|" nl? ws* Hole ws* "=" ws* Hole
|
||||
EndFormat = nl? ws* "}}" nl?
|
||||
Hole = "_"+
|
||||
ws = " "
|
||||
|
|
|
@ -172,7 +172,7 @@ class TemplateDataBlob {
|
|||
$data->format;
|
||||
if (
|
||||
!is_string( $f ) ||
|
||||
!preg_match( '/^\n?\{\{ *_+ *\n?\|\n? *_+ *= *_+\n? *\}\}\n?$/', $f )
|
||||
!preg_match( '/^\n?\{\{ *_+\n? *\|\n? *_+ *= *_+\n? *\}\}\n?$/', $f )
|
||||
) {
|
||||
return Status::newFatal(
|
||||
'templatedata-invalid-format',
|
||||
|
|
Loading…
Reference in a new issue