模板打印空段落

Template prints empty paragraphs

我有以下模板

{{#if:{{{1|}}}|{{Subtemplate|{{{1}}}}}}}
{{#if:{{{2|}}}|{{Subtemplate|{{{2}}}}}}}
{{#if:{{{3|}}}|{{Subtemplate|{{{3}}}}}}}
{{#if:{{{4|}}}|{{Subtemplate|{{{4}}}}}}}
{{#if:{{{5|}}}|{{Subtemplate|{{{5}}}}}}}
{{#if:{{{6|}}}|{{Subtemplate|{{{6}}}}}}}
{{#if:{{{7|}}}|{{Subtemplate|{{{7}}}}}}}
{{#if:{{{8|}}}|{{Subtemplate|{{{8}}}}}}}
{{#if:{{{9|}}}|{{Subtemplate|{{{9}}}}}}}
{{#if:{{{10|}}}|{{Subtemplate|{{{10}}}}}}}
{{#if:{{{11|}}}|{{Subtemplate|{{{11}}}}}}}
{{#if:{{{12|}}}|{{Subtemplate|{{{12}}}}}}}

用作 {{Template|first|second|third}} 效果非常好,但它会为不存在的参数打印空段落。我怎样才能摆脱它们?

尝试删除 if 语句之间的换行符:

{{#if:{{{1|}}}|{{Subtemplate|{{{1}}}}}}}<!--
-->{{#if:{{{2|}}}|{{Subtemplate|{{{2}}}}}}}<!--
-->{{#if:{{{3|}}}|{{Subtemplate|{{{3}}}}}}}<!--
-->{{#if:{{{4|}}}|{{Subtemplate|{{{4}}}}}}}<!--
-->{{#if:{{{5|}}}|{{Subtemplate|{{{5}}}}}}}<!--
-->{{#if:{{{6|}}}|{{Subtemplate|{{{6}}}}}}}<!--
-->{{#if:{{{7|}}}|{{Subtemplate|{{{7}}}}}}}<!--
-->{{#if:{{{8|}}}|{{Subtemplate|{{{8}}}}}}}<!--
-->{{#if:{{{9|}}}|{{Subtemplate|{{{9}}}}}}}<!--
-->{{#if:{{{10|}}}|{{Subtemplate|{{{10}}}}}}}<!--
-->{{#if:{{{11|}}}|{{Subtemplate|{{{11}}}}}}}<!--
-->{{#if:{{{12|}}}|{{Subtemplate|{{{12}}}}}}}