Elan Hickler
Elan Hickler

Reputation: 1137

mediawiki: How do you prevent rendering new line or line break in template?

I am creating a complex template and I need new lines to break up the code so I can see it better. How do I break up a template without having it render new lines when the template is called?

Here's a snippet of code

{{#if: {{{value|}}} |'''Market value: '''{{{value}}}
}}

{{#if: {{{damage|}}} |'''Damage: '''{{{damage}}}
}}

{{#if: {{{identified|}}} |'''Description (sufficiently identified): '''"{{{identified}}}"
}}

{{#if: {{{unidentified|}}} |'''Description (insufficiently identified): '''"{{{unidentified}}}"
}}

{{#if: {{{weight|}}} |'''Weight: '''{{{weight}}} lb
}}

{{#if: {{{durability|}}} |'''Durability: '''{{{durability}}}
}}

{{#if: {{{quality|}}} |'''Quality rank: '''{{{quality}}}
}}

{{#if: {{{requirements|}}} |'''Requirements: '''{{{requirements}}}
}}

{{#if: {{{materials|}}} |'''Materials: '''{{{materials}}}
}}

{{#if: {{{materials|}}} |'''Materials: '''{{{materials}}}
}}

Upvotes: 3

Views: 669

Answers (1)

leo
leo

Reputation: 8530

You can use HTML style comments in MediaWiki templates:

}}<!--

-->{{#if: {{{durability|}}} |'''Durability: '''{{{durability}}}
}}<!--

-->{{#if: {{{quality|}}} |'''Quality rank: '''{{{quality}}}
}}<!--

-->

Upvotes: 1

Related Questions