Content deleted Content added
Tags: Disambiguation links added Reply |
→Inconsistency between Test case nowiki and others: new section |
||
Line 159:
:Hmm. Would it make sense to have that be opt-in, at least initially, by adding a new {{para|format|syntaxhighlight}} (and/or {{para|format|syntax}} maybe) instead? Are there any weird border cases where {{tag|code|content={{tag|nowiki}}}} works, but {{tag|syntaxhighlight|attribs=lang{{=}}"mediawiki" inline}} might break? [[User:FeRDNYC|FeRDNYC]] ([[User talk:FeRDNYC|talk]]) 04:00, 15 July 2023 (UTC)
== Inconsistency between Test case nowiki and others ==
So, in most of the test case templates, you pass arguments to the test-case code preceded by underscores, and actual arguments to the template being tested are passed as usual, e.g.:
<syntaxhighlight lang="mediawiki">
{{Test case|_collapsible=yes|_showcode=yes|_title=Some test case
|_template1=Code
|1=wikitable
}}
</syntaxhighlight>
OK, great. But then here comes {{tlx|Test case nowiki}}, where the underscore arguments don't work, and you have to use non-underscored ones:
===BAD===
<syntaxhighlight lang="mediawiki">
{{Test case nowiki|_collapsible=yes|_showcode=yes|_title=Some test case
|_template1=Code
|<nowiki>{{__TEMPLATENAME__
|1=wikitable}}</nowiki>
}}
</syntaxhighlight>
===Works===
<syntaxhighlight lang="mediawiki">
{{Test case nowiki|collapsible=yes|showcode=yes|title=Some test case
|template1=Code
|<nowiki>{{__TEMPLATENAME__
|1=wikitable}}</nowiki>
}}
</syntaxhighlight>
My question is, '''''why'''''??? If these templates are a "family", and so often used together, doesn't it make sense for {{tlx|Test case nowiki}} to take the same set of arguments that {{tlx|Test case}} and all the others take? Even if it's not strictly ''necessary'' for them to be preceded by underscores? It would make converting test cases between the non-nowiki and nowiki versions a lot quicker and more convenient. Am I really the only person who finds themselves doing that pretty frequently? [[User:FeRDNYC|FeRDNYC]] ([[User talk:FeRDNYC|talk]]) 06:33, 15 July 2023 (UTC)
|