Contents |
I was making some notes to myself on how to use this template, but it trashed my wiki markup, like this:
Those double bullets and pre-formatted blocks (above) are a side effect of a newline from the template. Here's the template's code, with a <noinclude> clause as the last line:
<span class="plainlinks">[http://www.mutopiaproject.org/{{ #if: {{{1|}}} |cgibin/piece-info.cgi?id={{{1}}}| }} Mutopia Project{{ #if: {{{2|}}} |, {{{2}}}| }}]</span> <noinclude>[[Category:External Links templates|m]]</noinclude>
Transclusion omits the <noinclude> but does include the trailing newline ahead of the <noinclude>, just like this:
<span class="plainlinks">[http://www.mutopiaproject.org/{{ #if: {{{1|}}} |cgibin/piece-info.cgi?id={{{1}}}| }} Mutopia Project{{ #if: {{{2|}}} |, {{{2}}}| }}]</span>
That trailing newline causes whatever text that follows the template invocation (including an innocent space) to appear at the start of the next line, where it can be misinterpreted as wiki markup (hence the innocent space begins a pre-formatted block).
Putting the <noinclude> on the same line as the <span> produces the expected output:
Admittedly, the {{Mutopia}} template is typically used only as an argument within a work page template, where the extra newline does no harm. But other templates that are intended to be used within ordinary wiki markup should be careful not to put a <noinclude> clause on a line by itself.
A quick google suggests this sort of issue is a known headache: