Topic on Project:Support desk

77.185.1.165 (talkcontribs)

when using templates, it is often neccesary to format the template with linebreaks to at least get a chance of de-spaghettify the code. But - on the other hand - when encapsulating templates, you soon get unwanted linebreaks…

Is there any way to say:

"<remove-all-linebreaks-yes-i-mean-it>"
{{#if:{{{1}}}|
  {{#if:
    (some ugly stuff here)
  }}
}}
"</remove-all-linebreaks-yes-i-mean-it>"
114.75.199.182 (talkcontribs)

I did this by putting the {{ on the previous line, like:

 {{
   #if: ...
 }}{{
   #if...
 }}
Unifiedrepublic (talkcontribs)

If you look at the way Wikipedia has their templates, they use HTML comments on break lines so it would look like:


<div><!--
-->{{#if: .. }}<!--
-->{{#if: ..}}
</div>

Since the line breaks technically happen in the comments, it looks a little prettier than if you left them outside the comments. But, I'll say for certain that it's functional.

2A02:188:3600:1:7464:1748:1C77:CC67 (talkcontribs)

You can use the tag to achieve it.

Example:

2A02:188:3600:1:7464:1748:1C77:CC67 (talkcontribs)

Well that went horribly.

You can use the tag"" to achieve it.

Simply replace your "<remove-all-linebreaks-yes-i-mean-it>" with "

2A02:188:3600:1:7464:1748:1C77:CC67 (talkcontribs)

For the love of christ.

The tag is includeonly encapsulated in <>.

AhmadF.Cheema (talkcontribs)
<includeonly>

By-the-way, the above was quite entertaining :)