Last modified: 2011-03-13 18:06:37 UTC
As statet on 'http://meta.wikimedia.org/wiki/Template' under 'Parameters', Spaces before or after a parameter value are normally ignored. This is wrong, because all WHITESPACES are ignored. Actually removing the whitespaces is done by calling trim() on both the parameter name AND the value with the following two codelines in the method Parser::braceSubstitution(), line 2158 in MediaWiki 1.4.4: $name = trim( substr( $arg, 0, $eqpos ) ); $value = trim( substr( $arg, $eqpos+1 ) ); By replacing the trimming of the parameter value with $value = trim( substr( $arg, $eqpos+1 ), " \0" ); the functionality will match the docs. It doesn't make sense to remove the other whitespaces ("\n", "\r", "\t", "\v"), as one can be sure they are not entered by the user accidentally. The same goes for the newest CVS version in the HEAD branch. This code change didn't generate any new bugs so far in my Intranet-Wiki. Below an example for further explaining. Wiki text ********* {{File|1=filename|2= #-------------------------------------- # Settings: #-------------------------------------- PARAMETER='value' }} Template 'File' *************** {| |File: {{{1}}} |- | {{{2}}} |} Output ****** File: filename 1. -------------------------------------- # Settings: #-------------------------------------- PARAMETER='value' Output as it should be ********************** File: filename #-------------------------------------- # Settings: #-------------------------------------- PARAMETER='value'
Dear Patrick! As far as I can understand your request is diametrically opposed to the requirement from Bug 3983: BiDi: please assure a high degree of fexibility / maintainability of the template syntax with respect to RTL Please understand that the requirement from bug 3983 is a great help when editing long template lists as http://meta.wikimedia.org/w/index.php?title=User:Gangleri/tests/BiDi/list_01/template&action=edit&oldid=272191 if they would contain both LTR and RTL characters. In such a case the browser will reorder all characters according to the BiDi (bidirectional) algorithm. Having the posibility to use a syntax as used at http://meta.wikimedia.org/w/index.php?title=User:Gangleri/tests/BiDi/list_01/list&action=edit is a great help. Please note that editing large source files with Firefox requires great patience because every pasting into the textarea box jumps the view of the textarea box at the beginning of the textarea box. This is one reason why contributors to projects using a RTL textarea box give up after a few edits. (see bug 4011; note: [[ar:]] and [[he:]] have found a workaround for bug 4011) Just go and edit [[meta:BiDi_workgroup/bugzilla/02248#Without_bugzilla:02248]]. insert some characters, make some previews, resize your browser window, please do *not* save. Contributors using RTL editing have enough problems. I would be happy if you would withdraw this request. best regards reinhardt [[user:gangleri]]
As noted above, this would break many templates, especially longer templates.
Dear Patrick! I must admit that I did neither understand the request of comment #0 nor all implications. A "how to?" obtain the result you want / describe can be found at [[meta:BiDi_workgroup/bugzilla/02248/calls]]. best regards reinhardt [[user:gangleri]]