GWicke has submitted this change and it was merged.
Change subject: Properly strip WS around tpl and parser-fn. args
......................................................................
Properly strip WS around tpl and parser-fn. args
* Whitespace and newlines around template and parser
function args have to be stripped except when a
template argument is not a named arg.
{{echo| a}} has to emit a pre, but
{{echo|1= a}} should not
Also, note that this white-space stripping has to
happen after all templates have been expanded.
{{echo|{{echo }}}} has to emit a pre, but
{{echo|1={{echo| a}}}} should not
Note that this rule does not apply to #if, #ifeq
parser functions.
{{#if: {{foo}}
| no-pre-then
| no-pre-else
}}
will not generate a pre despite not having named
args. So, significant WS around implicit template
args is an aberration to the strip-whitespace rule.
Unsure why this inconsistent behavior exists, but
this is rather odd.
* This fix eliminates parsing and rt errors in
en:Wikipedia:VG/RELEASE
en:Oguni_Gensai (no regression from 42d265a)
en:Barack_Obama (eliminates excess newlines and pres)
* Check if additional parser tests are required.
Change-Id: I7ea244c4467f430ca82a5c41eb85ead35c775142
---
M js/lib/ext.core.ParserFunctions.js
M js/lib/ext.core.TemplateHandler.js
M js/lib/mediawiki.Util.js
M js/lib/mediawiki.parser.defines.js
M js/lib/mediawiki.parser.environment.js
M js/lib/pegTokenizer.pegjs.txt
6 files changed, 85 insertions(+), 81 deletions(-)
Approvals:
GWicke: Verified; Looks good to me, approved
--
To view, visit https://gerrit.wikimedia.org/r/32405
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I7ea244c4467f430ca82a5c41eb85ead35c775142
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Parsoid
Gerrit-Branch: master
Gerrit-Owner: Subramanya Sastry <[email protected]>
Gerrit-Reviewer: GWicke <[email protected]>
Gerrit-Reviewer: Subramanya Sastry <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits