Last modified: 2014-06-13 16:37:27 UTC
Please take a look at this example: https://test.wikipedia.org/wiki/User:Huji/tag:ref For some reason, when an empty parameter "name" is passed, despite the fact that it is empty, the output of the tag changes.
That doesnt look wrong to me.... you are passing the empty string...
Maybe not wrong but is this behavior really needed? For example when trying to create a wrapper template for <ref> tag, if the tag treated emptiness the same as undefinedness, something like this could work: {{ #tag:ref |{{{1}}} |name={{{{name|{{{2|}}}}}}} |group={{{group|{{{3|}}}}}} }} But currently I can't find a way to write it without name and group interference (Mainly because it is needed to use an #if function to determine empty strings AND pipe characters in #if functions will interfere with those of the ref tag)
I stand corrected. You can ignore my last comment. I think I finally found a way to do it: {{#if:{{{group|{{{3|}}}}}} |{{#if:{{{name|{{{2|}}}}}} |{{#tag:ref|{{{1}}}|name="{{{name|{{{2}}}}}}"|group="{{{group|{{{3}}}}}}"}} |{{#tag:ref|{{{1}}}|group="{{{group|{{{3}}}}}}"}} }} |{{#if:{{{name|{{{2|}}}}}} |{{#tag:ref|{{{1}}}|name="{{{name|{{{2}}}}}}"}} |{{#tag:ref|{{{1}}}}} }} }} (Use #if outside of #tag, not inside it)
Another method (hacky) that might work is append extra junk to the name parameter if its not used so that the param becomes some other param. |name{{#if:{{{name|}}}||pad}}={{{name}}} (Have not tested)