Help:Line-break handling: Difference between revisions

Content deleted Content added
<br /> or <br>: wording trim. will not break is enough; to be avoided is verbiage
Causing line breaks: added info about nowiki tag
Line 87:
</poem>
}}
 
=== Line breaks without wiki formatting ===
 
Under the tag {{tag|nowiki|link=Help:Wikitext#Nowiki}}, any single or double line breaks are ignored, and you also cannot add a line break with {{tag|br|o}}
 
{{markupv
|
markup=&lt;nowiki>
Single line breaks,
and double line breaks as well,
 
are ignored,
and the tag <br>
is just displayed as is.
&lt;/nowiki>
|
renders=<nowiki>
Single line breaks,
and double line breaks as well,
 
are ignored,
and the tag <br>
is just displayed as is.
</nowiki>
}}
 
There are several ways to deal with this problem:
 
'''Solution 1'''. Use {{tag|nowiki}} for each line separately, with <tag|br|o> or double newline between lines.
 
{{markup
|
&lt;nowiki> First line &lt;/nowiki> <br>
&lt;nowiki> Second line &lt;/nowiki>
 
&lt;nowiki> Third line &lt;/nowiki>
|
<nowiki> First line </nowiki> <br>
<nowiki> Second line </nowiki>
 
<nowiki> Third line </nowiki>
}}
 
'''Solution 2''': Instead of {{tag|nowiki}}, use {{tag|pre}} or {{tl|pre}}. It will keep your line breaks.
 
{{markupv
|m=
&lt;pre>
First line
Second line
</pre>
|r=
<pre>
First line
Second line
</pre>
}}
{{markupv
|m=
<nowiki>{{</nowiki>Pre <nowiki>|</nowiki>
First line
Second line
<nowiki>}}</nowiki>
|r=
{{Pre |
First line
Second line
}}
}}
 
'''Solution 3''': Use {{tag|poem}} to keep your line breaks.
 
{{markup
|
&lt;poem> &lt;nowiki>
’Twas brillig, and the slithy toves
Did gyre and gimble in the wabe:
All mimsy were the borogoves,
And the mome raths outgrabe.
</nowiki></poem>
|<poem><nowiki>
’Twas brillig, and the slithy toves
Did gyre and gimble in the wabe:
All mimsy were the borogoves,
And the mome raths outgrabe.
</nowiki></poem>
}}
 
 
 
=== Lists ===