Fix trimming & others
This merge request contains bug and quotation/spacing fixes. These bugs are explained below.
Parameter trimming
Additional spaces added between a parameter name and the equal sign when using a parser function invalidate the parameter.
For example, the following wikitext returns 1, 2, 4:
{{#listsort:
| list= 1, 4, 2
}}
But the following does not, as the list parameter is no longer recognized:
{{#listsort:
| list = 1, 4, 2
}}
Token trimming
A trimming issue similar to the previous one can be noticed by using several patterns.
For example, the following wikitext returns a->b, c->d, e->f:
{{#listmap:
| list= a:b, c:d, e:f
| token= @fst,@snd
| fieldsep= :
| pattern= @fst->@snd
}}
But the following does not, as the second pattern is @snd instead of @snd:
{{#listmap:
| list= a:b, c:d, e:f
| token= @fst, @snd
| fieldsep= :
| pattern= @fst->@snd
}}
And vice versa, the following does not work either, as the first pattern is @fst instead of @fst:
{{#listmap:
| list= a:b, c:d, e:f
| token= @fst ,@snd
| fieldsep= :
| pattern= @fst->@snd
}}
indextoken with #listsort
The indextoken parameter does not work with the #listsort function. It always returns 1, as the index in not correctly initialized.
Missing namespace
Some sort function parameters break the function. The cause has been identified by @oO_eyes in a bug report. The corresponding commit of this request just applies this fix.
"Undefined variable"
When using the extension on its own on a MediaWiki installation, the parser functions sometimes show "Undefined variable" PHP error messages. However, these issues do not affect the behavior of the parser functions in the majority of cases. This is just a visual issue, which does not appear on Gamepedia as the PHP error messages seem to be hidden.