Help:Line-break handling: Difference between revisions

Content deleted Content added
<br>: clarify
 
(11 intermediate revisions by 5 users not shown)
Line 9:
 
===Newlines===
{{see|Wikipedia:Don'tLine usebreaks line breaksusage|Wikipedia:Manual of Style#Controlling line breaks}}
{{shortcut|H:PARAGRAPH}}
There are several ways to force [[newline|line breaks]] and [[hard return|paragraph breaks]] in the text. The simplest method is by inserting newlines; for example:
Line 39:
{{shortcut|H:BR}}{{anchor|&lt;br&gt; or &lt;br /&gt;|br|br/|br /}}
 
<code><nowiki><br></nowiki></code>, <code><nowiki><br ></nowiki></code>, <code><nowiki><br/></nowiki></code>, <code><nowiki><br /></nowiki></code>
 
Use whichever form is simplest for you to remember. The [[MediaWiki]] software uses any of them for a single forced line break. All of them are converted to {{tag|br|s}} in the HTML that browsers read.
 
MediaWiki also converts <code><nowiki></br></nowiki></code> to {{tag|br|s}}, but this form is invalid. Please correct these tags.
All other forms will display as just plain text, and will not create line breaks. Please correct them.
 
For content that is semantically a list, such as in infoboxes, actual list markup is preferred. See {{format link|#Lists}} below.
Line 52:
}}
 
The example below includes fivefour forms, including the invalid <code><nowiki></br></nowiki></code>, that are rendered as line breaks and two that display as plain text.
<div style="display:inline-table; border: 2px solid limevar(--border-color-content-added); padding: 0.5em;">
'''Wiki source'''
 
<nowiki>One <br>Two <br >Three </br/>Four <br />Five < br />Six </ br>Seven </ br>Eight</nowiki>
</div>
 
<div style="display:inline-table; border: 2px solid limevar(--border-color-content-added); padding: 0.5em;">
'''Rendered result'''
 
One <br>Two <br >Three </br/>Four <br />Five < br />Six </ br>Seven </ br>Eight
</div>
 
Line 229:
 
== Preventing and controlling word wraps ==
{{Nutshell|title=This section|To prevent word wraps use <code>&amp;nbsp;</code> in place of each space,; and oruse <code>&amp;#8209;</code> in place of aeach hyphen. For more complex cases, see below.}}
 
There are several ways to prevent word wraps (line wraps) from occurring in unwanted places. This is an overview of when to use which method.
Line 399:
 
== See also ==
* [[metamw:HelpManual:Newlines and spaces]]
* {{tl|break}}
* {{tl|clear}}