Content deleted Content added
Timeshifter (talk | contribs) →<wbr> and soft hyphens: Clarify |
|||
(22 intermediate revisions by 10 users not shown) | |||
Line 9:
===Newlines===
{{see|Wikipedia:
{{shortcut|H:PARAGRAPH}}
▲{{see|Wikipedia:Don't use line breaks|Wikipedia:Manual of Style#Controlling line breaks}}
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 36:
}}
===
{{shortcut|H:BR}}{{anchor|<br> or <br />|br|br/|br /}}
<code><nowiki><br></nowiki></code>, <code><nowiki><br ></nowiki></code>, <code><nowiki><br/></nowiki></code>, <code><nowiki><br /></nowiki></code>
The {{tag|br|s}} or {{tag|br|o}} tags are used for a single forced line break. For content that is semantically a list, such as in infoboxes, actual list markup is preferred. See {{format link|#Lists}} below.▼
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.
▲
{{markup
|<nowiki>And this line of text<br
|And this line of text<br
}}
The example below includes four forms that are rendered as line breaks and two that display as plain text.
<div style="display:inline-table; border: 2px solid var(--border-color-content-added); padding: 0.5em;">
'''Wiki source'''
<nowiki>One <br>Two <br >Three <br/>Four <br />Five < br>Six </ br>Seven</nowiki>
</div>
<div style="display:inline-table; border: 2px solid var(--border-color-content-added); padding: 0.5em;">
'''Rendered result'''
One <br>Two <br >Three <br/>Four <br />Five < br>Six </ br>Seven
</div>
=== <poem> ===
Line 216 ⟶ 229:
== Preventing and controlling word wraps ==
{{Nutshell|title=This section|To prevent word wraps use <code>&nbsp;</code> in place of each space
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 337 ⟶ 350:
{{anchor|wbr|<wbr>}}
To insert a word-break opportunity, use {{tag|wbr|o}}.
{{markupv
Line 353 ⟶ 366:
Note that {{tag|wbr|o}} will not work inside {{tl|nowrap}}.
In many cases breaking up a word with a space would be inappropriate. [[Soft
The code <code>&shy;</code> is employed in the same manner as {{tag|wbr|o}}. For example:
{{markup
|<nowiki>This long German word Datenschutz&shy;erklärung breaks between its constituent parts "Datenschutz" and "erklärung".</nowiki>
|This long German word Datenschutz­erklärung breaks between its constituent parts "Datenschutz" and "erklärung".
}}
Use of soft hyphens should be limited to special cases, usually involving [[Longest English words|very long words]] or narrow spaces (such as captions in [[infobox|infoboxes]] or other tight page layouts, or column labels in narrow tables). Widespread use of soft hyphens is strongly discouraged, because it makes the wikitext very difficult to read and to edit. For example:
Line 361 ⟶ 381:
|This Wikisource example is difficult to understand
}}
Consider instead using the {{tlx|shy}} template for such complex cases:
{{markup
Line 377 ⟶ 399:
== See also ==
* [[
* {{tl|break}}
* {{tl|clear}}
|