Module talk:Template invocation: Difference between revisions

Content deleted Content added
Editor-hostile wikitext: fix proposal for a minor glitch
Line 42:
: {{Done}} [[User:Pppery|* Pppery *]] [[User talk:Pppery|<sub style="color:#800000">it has begun...</sub>]] 23:23, 9 February 2024 (UTC)
:: {{thank you}}, seems to work better now. I've updated the test cases accordingly. — [[User:Mikhail Ryazanov|Mikhail Ryazanov]] ([[User talk:Mikhail Ryazanov|talk]]) 00:25, 11 February 2024 (UTC)
{{od|2}}
I've stumbled upon a minor glitch caused by [[Special:Diff/1205562670]]. At [[Special:Permalink/1234259862#Notifications|Template:Myprefs/testcases#Notifications]], the wikitext is shown with an extra space before the pipe in {{para|check}}:
 
<pre>
{{Myprefs|Notifications|Notify me about these events |check=Page links}}
</pre>
instead of:
<pre>
{{Myprefs|Notifications|Notify me about these events|check=Page links}}
</pre>
 
This is significant, because for unnamed positional parameters the whitespace isn't stripped. Compare: <code><nowiki>{{tl|x1}}</nowiki></code>→{{tl|x1}} vs <code><nowiki>{{tl| x1 }}</nowiki></code>→{{tl| x1 }}. The extraneous space might confuse editors who are copy-pasting from testcases.
 
I propose to fix it by not adding a space for the first named parameter. A hacky implementation via variable <code>maybeSpace</code> in sandbox: [[Special:Diff/1205562670/1234263149]]. Tested at [[Special:Diff/1234262869]]. —⁠[[User:Andrybak|andrybak]] ([[User talk:Andrybak|talk]]) 12:44, 13 July 2024 (UTC)