![]() | This is an archive of past discussions. Do not edit the contents of this page. If you wish to start a new discussion or revive an old one, please do so on the current talk page. |
Archive 1 |
Some months ago we created several new {{ nowrap}} related templates and CSS classes, since we had problems to handle line wrapping here at Wikipedia. But now people seem very confused about which nowrap handling method to use when and how. So now I made this how-to guide to explain things. (I hope it will not confuse people even more?)
Since this page might also be read by beginners I added a section about "Causing line breaks", mainly as background information. I hope we can keep that section short.
My intention is that the section "Preventing and controlling word wraps" should be the main focus of this how-to guide.
Some other notes:
-- David Göthberg ( talk) 21:07, 11 March 2008 (UTC)
<nowiki/>
tags, in favor of HTML entities ("<" and "{" for "<" and "{", respectively).<nowiki>
tags, but I tend to be lazy about that...{{nowrap begin}}+{{nowrap end}}
, unless they are humongous... (Of course such formulas should really use
TeX.I guess it is time for a rant:
Remember that this page is a learning tool. It will hopefully be read by a lot of beginner editors, most of which have no idea about the inner workings of templates and never heard of things like CSS classes. So try to keep things simple and only introduce complicated concepts after the simpler concepts. After all, most editors just need to know how and when to use the nowrap templates, they don't need to understand what makes them tick. (What makes them tick is described on their own doc pages under "Technical details" and should not be in this how-to guide.)
Avoid the "sea of blue" effect. As the Manual of Style puts it: "Make links only where they are relevant to the context: It is not useful and can be very distracting to mark all possible words as hyperlinks. Links should add to the user's experience; they should not detract from it by making the article harder to read."
Should this page be written in a neutral point of view (NPOV)? No, since this is not a Wikipedia article, it is a Wikipedia project namespace how-to guide. It should instead teach best practises. It should not teach things like "You can even use the incorrect <some code>
". And yes, it is perfectly okay that this page is mostly based on original research and doesn't have references.
-- David Göthberg ( talk) 20:01, 13 March 2008 (UTC)
Based on the code by User:Dinoguy1000: I added simplified id's to the rest of the section headers that have special characters in their names. So now it is much easier to link to those sections. (Can be good from other pages or talk pages.) Here is a complete list of links to the sections:
-- David Göthberg ( talk) 02:47, 14 March 2008 (UTC)
Ouch, I just discovered that the Firefox "expanding out of the box" bug doesn't only apply to {{ nowraplinks}}. It applies to any span-nowrap tag, such as the one used in {{ nowrap}}. That is, any span-nowrap tag that is immediately followed by text without any spaces between. And it doesn't matter if there is a link inside the span-nowrap tag or just normal text. Here is a code example:
{| class="wikitable" | {{nowrap|[[Salt|some link]]}}SomeText {{nowrap|[[Salt|some link]]}}SomeText {{nowrap|[[Salt|some link]]}}SomeText {{nowrap|[[Salt|some link]]}}SomeText | {{nowrap|some text}}SomeText {{nowrap|some text}}SomeText {{nowrap|some text}}SomeText {{nowrap|some text}}SomeText |}
And here is how it renders. If you have Firefox, try dragging your web browser window so it gets smaller and smaller and see how the text in both cells will overflow:
some linkSomeText some linkSomeText some linkSomeText some linkSomeText |
some textSomeText some textSomeText some textSomeText some textSomeText |
This also happens if you put two {{nowrap|something}}
{{nowrap|something}}
next to each other without any space between them.
If you use spaces between the nowrap protected text and the normal text, then if doesn't overflow. Like this:
some link SomeText some link SomeText some link SomeText some link SomeText |
some text SomeText some text SomeText some text SomeText some text SomeText |
You can also use {{ nowrap begin}} + {{ wrap}} + {{ nowrap end}}, but that also causes a space at the {{wrap}}. Perhaps that is why {{nowrap begin}} doesn't overflow in Firefox?
-- David Göthberg ( talk) 11:03, 22 March 2008 (UTC)
Note that when it comes to this bug then a non-breaking space
counts as a "normal" character, not as a space. That is, the bug also occurs if you use non-breaking spaces. Like this:
{| class="wikitable" | {{nowrap|[[Salt|some link]]}} SomeText {{nowrap|[[Salt|some link]]}} SomeText {{nowrap|[[Salt|some link]]}} SomeText {{nowrap|[[Salt|some link]]}} SomeText | {{nowrap|some text}} SomeText {{nowrap|some text}} SomeText {{nowrap|some text}} SomeText {{nowrap|some text}} SomeText |}
This too will overflow in Firefox:
some link SomeText some link SomeText some link SomeText some link SomeText |
some text SomeText some text SomeText some text SomeText some text SomeText |
-- David Göthberg ( talk) 05:59, 10 April 2008 (UTC)
[[Some link]] (2008){{·}}
or "[[Some link]]"{{·}}
. Those two texts have 9 and 4 characters respectively outside the link before the real space. That's enough many characters to expand outside the box and become a real problem.I assume you mean you want to report the bug to the Firefox developers? I have been thinking of doing that for some time too. So I took a quick look over at bugzilla.mozilla.org and searched for "nowrap", it turned up at least two bug reports that clearly is the exact same bug:
And there are several other "nowrap" bug reports that seem related. I am going to get myself an account over there so I can write comments at those bug reports telling them those two bugs are the same bug. And also link back here to Wikipedia:Line break handling and it's talk page.
But even if the next version of Firefox is fixed we still have to handle the bug for the next two years or so. And we have the problems with wrapping in several Internet Explorer versions which means we need to use {{ nowrap begin}} etc in many places anyway.
By the way, I will copy parts of this discussion to Wikipedia talk:Line break handling#Firefox bug.
-- David Göthberg ( talk) 15:28, 10 April 2008 (UTC)
Editors may be interested in this new section at WT:MOS, where I propose this talkpage for continued discussion of the proposal that we use ,, as markup for the hard space. Here is the current text of the proposal, as recently modified following discussion at WT:MOS:
See a full draft of the proposal |
---|
|
Myself, I'll be taking no further part in this in the foreseeable future. But I do hope that other editors will continue their good work on it, and that new editors will join in the effort.
– ⊥¡ɐɔıʇǝoNoetica! T– 11:41, 27 March 2008 (UTC)
I've read through the proposal a couple of times now, and I've gotta say, it's pretty solid, straightforward, and simple, and I'd really like to see it implemented. — Dino guy 1000 20:04, 28 March 2008 (UTC)
"
. But when I saved the text the invisible space was back. (Previous sentence added later.) Weird.The proposal looks really good. Just one question (please give a link if it has already been answered): have you searched through the WP article database to see if there are any existing uses of ,, that would be affected? Doesn't seem likely, but life is full of surprises... If there are a few cases, that doesn't mean the proposal is wrong, but that the existing ,, would need to be escaped with < nowiki >. -- Itub ( talk) 16:44, 1 April 2008 (UTC)
function(a,b,c,,,f)
. But it's better style to use spaces after the commas anyway. Of course that's extremely rare, and probably not worth worrying about. --
Hans Adler (
talk)
19:00, 1 April 2008 (UTC)I wonder if we should suggest this as a general solution, or not. Here's an example of <div style="overflow:auto"> in practice:
It's not elegant, but it gets past the problem of no soft hyphens in MediaWiki. The hard-coding of line breaks is possible, but will have little relationship to the text and browser window size in use by a reader. Note that in such articles only the body text can be given this treatment; the article title will still run off the right margin. -- Dhartung | Talk 00:32, 8 April 2008 (UTC)
I'm not sure that this is the right place to pose this question, but here it is! :)
I was editing
a page because a simple in-line equation (1 ⁄ e) was breaking. At first I tried <nobr>, then I found my way here and opted for . (Nice editing, by the way, to whomever came up with the section in a nutshell banner!)
The thing is, while I was trying out different things I changed the back-slash to a division symbol, using the Math and logic section of the editor. When you click on the symbol it inserts the character into your wiki mark-up, but it is subsequently transposed into a back-slash, rendering the click here to insert math symbol functionality useless (as all keyboards have a back-slash key).
Anyway, what I was wondering is, if WP must replace ÷ with /, shouldn't it replace 1 ÷ ''e''
with 1 / ''e''
?
nagualdesign (
talk)
01:31, 15 September 2010 (UTC)
Is there any difference between <br> and <br/>? I've seen both used, and I've even seen editors fight over which one is correct. I've always been of the assumption that they basically the same and I often use the former to eliminated needless code space. Is there an actual preferred version? BIGNOLE (Contact me) 12:13, 24 October 2009 (UTC)
<br>
tag.<br>
is the correct "HTML wikimarkup". But MediaWiki was updated to also understand <br />
some years ago so that it would be easier to copy and paste text from other free sources without having to modify each br tag in those texts.<br \>, <br\>, </br>, </ br>, <\br> and <\ br>
all are faulty variants. And the variant <br/>
(without space) is not a recommended variant of the <br />
tag, according to the
World Wide Web Consortium (W3C), since it breaks older web browsers.<br>
tag and not change all our
18 million pages every time the web standards change.<br \>
.<br />
in wiki code to <br>
in the rendered pages. Again, wikimarkup is not the same thing as rendered page code.Question: if, as I understand from the above, <br>
is the preferred format, why does the
edit toolbar give <br />
?
PC78 (
talk)
12:21, 6 August 2010 (UTC)
There's plenty of information on WP about non-breaking spaces and how to render them, but I couldn't find anything about the converse: I helped to write
Template:Etymology, and noticed today that the first 2 or 3 words of an etymology weren't wrapping at line-breaks. After a little detective work I realized that I'd used non-breaking spaces ( 's) in the mark-up in order that the spaces weren't ignored as whitespace, but they shouldn't really be non-breaking. So I ended up changing  's to &emsp's, then to &ensp's and finally to  's. The last one was a guess! As far as I can tell, they're the only line-breaking equivalent of  's - &emsp's and &ensp's are both too thick - but I don't know how  's render on different browsers.
Please could someone include something in this article about the use of  's?
Thank you in advance. Regards,
nagualdesign (
talk)
01:50, 10 March 2011 (UTC)
‑
) in an Arabic-English transliteration, as‑simt, as I thought it looked wrong when wrapped. Are there any guidelines for this?First, is there a written policy of no soft hyphens in Wikipedia? Please provide a short explanation of the reason, and link to the policy from this article. Second, is the zero-width space (​) allowed? I've found it useful. -- Traal ( talk) 01:24, 2 November 2012 (UTC)
[Line breaks in the wiki source (not reader visible, just for editors)]
Since a question about line break tags in source was mentioned above it doesn't seem too off-topic to ask if there is any sort of formatting guideline for editors when writing wiki source? I find large blocks of wiki-markup and citations hard to read unless they contain spaces and line breaks. The citation templates for include examples with lots of line breaks in the wiki markup, and others with just a few spaces between parameters. The readability of markup is important because when editing I will try to improve citations by remove extra junk from URLs, or filling in citations with extra details such as author or date that others may not have filled in.
I'm hoping there are existing guidelines, expecting other editors to politely not strip spaces and line breaks out of articles doesn't work. It seems only polite to at least try and abide by the formatting of previous editors. Some editors even try to explain their stripping of line breaks by suggesting there is a "shortage of space", and are probably not aware about the compression used when web pages are sent by webservers (compression that makes it especially pointless to worry about spaces and line breaks). If the built in Wikipedia editor and diff tool were better it might help, but removing the line breaks also makes it difficult to check diff between revisions.
All I'm really asking that in an article that is not stable, and has not even reached the level of good article (GA) there will still be people working on it and to avoid wholesale stripping of indentation, spaces and line breaks. (On an article that is more stable and well written and citations mostly properly filled out already I don't mind so much about line breaks being removed.) I hope there is already a guideline I can point to next time an editor thinks it is appropriate to strip out all the line breaks. -- 109.77.175.76 ( talk) 04:09, 12 January 2013 (UTC)
Hi,
On
Wikipedia talk:WPCleaner, different users are giving a different opinion on what syntax should be used to replace an incorrect break tag (</br>
, <br/>
and <br.>
, ...). Should I use <br>
or <br />
? Both are correct in HTML5, only the second one is correct in XHTML but MediaWiki doesn't try to enforce XHTML anymore. By default, my preference would go to <br />
, because I find it cleaner. --
NicoV (
Talk on frwiki)
13:05, 3 July 2013 (UTC)
<wbr>
will be allowed with MediaWiki 1.22/wmf13.
[1] --
Gadget850
talk
07:22, 17 August 2013 (UTC)
I'm not sure that this change is appropriate. First some background:
<br>
into <br/>
in an article I was editing,
User:Woodstone noticed and queried the merits of this change. Details at
User talk:Mitch Ames#Line break. In summary, I changed them to keep
this syntax highlighting tool happy, per that tool's
documentation.Note that I am not an expert in HTML/XTML or variations thereof, so I make no assertions about what the "correct" syntax is or should be. However, looking at the new version of WP:LINEBREAK
Mitch Ames ( talk) 09:26, 27 October 2013 (UTC)
<br/>
and <br />
. Which one you use is a matter of personal preference. There is no technical advantage to <br />
over <br/>
.<br />
is better than <br/>
then feel free to change this page to reflect that, and feel free to make any other changes that make the page's meaning more clear. I'm pretty open about it. —
Remember the dot (
talk)
21:28, 27 October 2013 (UTC)
<br/>
and <br />
are correct XHTML, but there used to be browsers that did not accept <br/>
(if I remember well Microsofts IE). If you inspect the output of WP, you will notice that it always has <br>
, as that is correct HTML. Therefore there is no advantage in changing existing <br>
into <br />
. It makes the edit box less human friendly for the vast majority of editors that do not use syntax highlighting. −
Woodstone (
talk)
12:15, 28 October 2013 (UTC)
<br>
, <br/>
and <br />
are valid HTML5.
[3]<br />
is valid.<br />
.<br>
tag was the only valid form up to and including HTML 3.2<br>
form, and also permitted the <br />
form for compatibility with XML parsers; in XML,
the space is optional<br />
form - the XHTML documentation is inconsistent as to whether the space is
optional or
mandatory<br>
and <br />
are
equally valid HTML5<br>
to <br />
(or vice versa) is unnecessary; changing <br/>
to <br />
(or vice versa) is pretty much pointless. However, changing invalid forms such as </br>
or <br\>
to either of the valid forms should be performed wherever the invalid forms are found. --
Redrose64 (
talk)
15:11, 28 October 2013 (UTC)<br />
, not <br>
-- see all the discussion about HTML Tidy.<br/>
or <br />
must be used in the MediaWiki namespace (and everywhere on wikis without HTML Tidy) or XML parsers will break.<br/>
or <br />
should always be preferred, but I recognize that others feel differently and I'm willing to just leave this page alone. —
Remember the dot (
talk)
17:35, 28 October 2013 (UTC)
<br/>
or <br />
must be used in the MediaWiki namespace (and everywhere on wikis without HTML Tidy)"? Wikipedia does not serve XML - it serves HTML5 (you can tell by the
<!DOCTYPE html>
before the <html>
when viewing the page source): the space and the slash are therefore both optional. HTML permits a certain amount of "sloppiness" that XHTML does not - this is not just <br>
and other empty elements with no slash, but also unclosed non-empty elements including (but not limited to) <colgroup>
<dd>
<dt>
<li>
<option>
<p>
<td>
<tfoot>
<th>
<thead>
<tr>
. HTML Tidy adds in any missing closing tags for these elements, not to make valid HTML, but to make valid XHTML. But the need for HTML Tidy is reduced since we switched away from XHTML.<br>
to <br/>
. That's a matter of opinion, there's no way for me to convince you. —
Remember the dot (
talk)
00:05, 29 October 2013 (UTC)<br />
is consistent with MediaWiki extensions such as <references />
. —
Remember the dot (
talk)
03:27, 29 October 2013 (UTC)
<references />
is an extension tag- early in extension development someone decided to use markup that mimicked XHTML, but it is not HTML.<br>
and <br />
are equally valid, and converting from one form to the other is generally a meaningless edit, except for consistency on a particular page. --
Gadget850
talk
10:50, 29 October 2013 (UTC)I had made a page desine in html with lots of new text heading and content in it, my query is- i want to break text and move to next page in ipad. can I give page text command in span? because if I am giving this command to para in mid, the line breaks and the remaining text start from new line. Is there any query for it. — Preceding unsigned comment added by 115.111.50.254 ( talk) 11:01, 11 September 2014 (UTC)
How would I edit the Wikimedia code to respect single line breaks everywhere, instead of just in the poem tag? Techni ( talk) 14:46, 18 July 2017 (UTC)
- Paul T +/ C 21:17, 7 March 2018 (UTC)
Is there a discussion somewhere demonstrating consensus for
this change by @
SMcCandlish:? The edit summary was This hasn't been updated in years.
, which is 100% true, but I'd like to read the rationale for this decision. This seems like a pretty big change by adding this section:
While forms without the
/
(such as<br>
and<br >
) will work properly in the renedered page, they break several of the available syntax highlighers for wikicode in the editing view, and so should be avoided. Please correct occurrences to<br />
as you encounter them, though preferably as a part of a more substantive edit.
Where before there was no such directive to "correct" all <br>
to <br />
. I can't believe there wasn't a huge thread hashing it out and showing agreement before making a change like this. -
Paul
T
+/
C
00:34, 6 March 2019 (UTC)
Question: Do any of these templates for preventing line breaks work for images because all of them seem to cause a line break. Mn1548 ( talk) 14:51, 17 March 2019 (UTC)
An editor has asked for a discussion to address the redirect Wikipedia:Line break. Please participate in the redirect discussion if you wish to do so. UnitedStatesian ( talk) 12:42, 12 April 2019 (UTC)
Is it me or shouldn't this article include information on how to make browsers trigger line-breaks automatically? As does running text, sometimes it is useful for other purposes aswell, e.g. tables. EnTerbury ( talk) 05:17, 5 April 2020 (UTC)
![]() | This is an archive of past discussions. Do not edit the contents of this page. If you wish to start a new discussion or revive an old one, please do so on the current talk page. |
Archive 1 |
Some months ago we created several new {{ nowrap}} related templates and CSS classes, since we had problems to handle line wrapping here at Wikipedia. But now people seem very confused about which nowrap handling method to use when and how. So now I made this how-to guide to explain things. (I hope it will not confuse people even more?)
Since this page might also be read by beginners I added a section about "Causing line breaks", mainly as background information. I hope we can keep that section short.
My intention is that the section "Preventing and controlling word wraps" should be the main focus of this how-to guide.
Some other notes:
-- David Göthberg ( talk) 21:07, 11 March 2008 (UTC)
<nowiki/>
tags, in favor of HTML entities ("<" and "{" for "<" and "{", respectively).<nowiki>
tags, but I tend to be lazy about that...{{nowrap begin}}+{{nowrap end}}
, unless they are humongous... (Of course such formulas should really use
TeX.I guess it is time for a rant:
Remember that this page is a learning tool. It will hopefully be read by a lot of beginner editors, most of which have no idea about the inner workings of templates and never heard of things like CSS classes. So try to keep things simple and only introduce complicated concepts after the simpler concepts. After all, most editors just need to know how and when to use the nowrap templates, they don't need to understand what makes them tick. (What makes them tick is described on their own doc pages under "Technical details" and should not be in this how-to guide.)
Avoid the "sea of blue" effect. As the Manual of Style puts it: "Make links only where they are relevant to the context: It is not useful and can be very distracting to mark all possible words as hyperlinks. Links should add to the user's experience; they should not detract from it by making the article harder to read."
Should this page be written in a neutral point of view (NPOV)? No, since this is not a Wikipedia article, it is a Wikipedia project namespace how-to guide. It should instead teach best practises. It should not teach things like "You can even use the incorrect <some code>
". And yes, it is perfectly okay that this page is mostly based on original research and doesn't have references.
-- David Göthberg ( talk) 20:01, 13 March 2008 (UTC)
Based on the code by User:Dinoguy1000: I added simplified id's to the rest of the section headers that have special characters in their names. So now it is much easier to link to those sections. (Can be good from other pages or talk pages.) Here is a complete list of links to the sections:
-- David Göthberg ( talk) 02:47, 14 March 2008 (UTC)
Ouch, I just discovered that the Firefox "expanding out of the box" bug doesn't only apply to {{ nowraplinks}}. It applies to any span-nowrap tag, such as the one used in {{ nowrap}}. That is, any span-nowrap tag that is immediately followed by text without any spaces between. And it doesn't matter if there is a link inside the span-nowrap tag or just normal text. Here is a code example:
{| class="wikitable" | {{nowrap|[[Salt|some link]]}}SomeText {{nowrap|[[Salt|some link]]}}SomeText {{nowrap|[[Salt|some link]]}}SomeText {{nowrap|[[Salt|some link]]}}SomeText | {{nowrap|some text}}SomeText {{nowrap|some text}}SomeText {{nowrap|some text}}SomeText {{nowrap|some text}}SomeText |}
And here is how it renders. If you have Firefox, try dragging your web browser window so it gets smaller and smaller and see how the text in both cells will overflow:
some linkSomeText some linkSomeText some linkSomeText some linkSomeText |
some textSomeText some textSomeText some textSomeText some textSomeText |
This also happens if you put two {{nowrap|something}}
{{nowrap|something}}
next to each other without any space between them.
If you use spaces between the nowrap protected text and the normal text, then if doesn't overflow. Like this:
some link SomeText some link SomeText some link SomeText some link SomeText |
some text SomeText some text SomeText some text SomeText some text SomeText |
You can also use {{ nowrap begin}} + {{ wrap}} + {{ nowrap end}}, but that also causes a space at the {{wrap}}. Perhaps that is why {{nowrap begin}} doesn't overflow in Firefox?
-- David Göthberg ( talk) 11:03, 22 March 2008 (UTC)
Note that when it comes to this bug then a non-breaking space
counts as a "normal" character, not as a space. That is, the bug also occurs if you use non-breaking spaces. Like this:
{| class="wikitable" | {{nowrap|[[Salt|some link]]}} SomeText {{nowrap|[[Salt|some link]]}} SomeText {{nowrap|[[Salt|some link]]}} SomeText {{nowrap|[[Salt|some link]]}} SomeText | {{nowrap|some text}} SomeText {{nowrap|some text}} SomeText {{nowrap|some text}} SomeText {{nowrap|some text}} SomeText |}
This too will overflow in Firefox:
some link SomeText some link SomeText some link SomeText some link SomeText |
some text SomeText some text SomeText some text SomeText some text SomeText |
-- David Göthberg ( talk) 05:59, 10 April 2008 (UTC)
[[Some link]] (2008){{·}}
or "[[Some link]]"{{·}}
. Those two texts have 9 and 4 characters respectively outside the link before the real space. That's enough many characters to expand outside the box and become a real problem.I assume you mean you want to report the bug to the Firefox developers? I have been thinking of doing that for some time too. So I took a quick look over at bugzilla.mozilla.org and searched for "nowrap", it turned up at least two bug reports that clearly is the exact same bug:
And there are several other "nowrap" bug reports that seem related. I am going to get myself an account over there so I can write comments at those bug reports telling them those two bugs are the same bug. And also link back here to Wikipedia:Line break handling and it's talk page.
But even if the next version of Firefox is fixed we still have to handle the bug for the next two years or so. And we have the problems with wrapping in several Internet Explorer versions which means we need to use {{ nowrap begin}} etc in many places anyway.
By the way, I will copy parts of this discussion to Wikipedia talk:Line break handling#Firefox bug.
-- David Göthberg ( talk) 15:28, 10 April 2008 (UTC)
Editors may be interested in this new section at WT:MOS, where I propose this talkpage for continued discussion of the proposal that we use ,, as markup for the hard space. Here is the current text of the proposal, as recently modified following discussion at WT:MOS:
See a full draft of the proposal |
---|
|
Myself, I'll be taking no further part in this in the foreseeable future. But I do hope that other editors will continue their good work on it, and that new editors will join in the effort.
– ⊥¡ɐɔıʇǝoNoetica! T– 11:41, 27 March 2008 (UTC)
I've read through the proposal a couple of times now, and I've gotta say, it's pretty solid, straightforward, and simple, and I'd really like to see it implemented. — Dino guy 1000 20:04, 28 March 2008 (UTC)
"
. But when I saved the text the invisible space was back. (Previous sentence added later.) Weird.The proposal looks really good. Just one question (please give a link if it has already been answered): have you searched through the WP article database to see if there are any existing uses of ,, that would be affected? Doesn't seem likely, but life is full of surprises... If there are a few cases, that doesn't mean the proposal is wrong, but that the existing ,, would need to be escaped with < nowiki >. -- Itub ( talk) 16:44, 1 April 2008 (UTC)
function(a,b,c,,,f)
. But it's better style to use spaces after the commas anyway. Of course that's extremely rare, and probably not worth worrying about. --
Hans Adler (
talk)
19:00, 1 April 2008 (UTC)I wonder if we should suggest this as a general solution, or not. Here's an example of <div style="overflow:auto"> in practice:
It's not elegant, but it gets past the problem of no soft hyphens in MediaWiki. The hard-coding of line breaks is possible, but will have little relationship to the text and browser window size in use by a reader. Note that in such articles only the body text can be given this treatment; the article title will still run off the right margin. -- Dhartung | Talk 00:32, 8 April 2008 (UTC)
I'm not sure that this is the right place to pose this question, but here it is! :)
I was editing
a page because a simple in-line equation (1 ⁄ e) was breaking. At first I tried <nobr>, then I found my way here and opted for . (Nice editing, by the way, to whomever came up with the section in a nutshell banner!)
The thing is, while I was trying out different things I changed the back-slash to a division symbol, using the Math and logic section of the editor. When you click on the symbol it inserts the character into your wiki mark-up, but it is subsequently transposed into a back-slash, rendering the click here to insert math symbol functionality useless (as all keyboards have a back-slash key).
Anyway, what I was wondering is, if WP must replace ÷ with /, shouldn't it replace 1 ÷ ''e''
with 1 / ''e''
?
nagualdesign (
talk)
01:31, 15 September 2010 (UTC)
Is there any difference between <br> and <br/>? I've seen both used, and I've even seen editors fight over which one is correct. I've always been of the assumption that they basically the same and I often use the former to eliminated needless code space. Is there an actual preferred version? BIGNOLE (Contact me) 12:13, 24 October 2009 (UTC)
<br>
tag.<br>
is the correct "HTML wikimarkup". But MediaWiki was updated to also understand <br />
some years ago so that it would be easier to copy and paste text from other free sources without having to modify each br tag in those texts.<br \>, <br\>, </br>, </ br>, <\br> and <\ br>
all are faulty variants. And the variant <br/>
(without space) is not a recommended variant of the <br />
tag, according to the
World Wide Web Consortium (W3C), since it breaks older web browsers.<br>
tag and not change all our
18 million pages every time the web standards change.<br \>
.<br />
in wiki code to <br>
in the rendered pages. Again, wikimarkup is not the same thing as rendered page code.Question: if, as I understand from the above, <br>
is the preferred format, why does the
edit toolbar give <br />
?
PC78 (
talk)
12:21, 6 August 2010 (UTC)
There's plenty of information on WP about non-breaking spaces and how to render them, but I couldn't find anything about the converse: I helped to write
Template:Etymology, and noticed today that the first 2 or 3 words of an etymology weren't wrapping at line-breaks. After a little detective work I realized that I'd used non-breaking spaces ( 's) in the mark-up in order that the spaces weren't ignored as whitespace, but they shouldn't really be non-breaking. So I ended up changing  's to &emsp's, then to &ensp's and finally to  's. The last one was a guess! As far as I can tell, they're the only line-breaking equivalent of  's - &emsp's and &ensp's are both too thick - but I don't know how  's render on different browsers.
Please could someone include something in this article about the use of  's?
Thank you in advance. Regards,
nagualdesign (
talk)
01:50, 10 March 2011 (UTC)
‑
) in an Arabic-English transliteration, as‑simt, as I thought it looked wrong when wrapped. Are there any guidelines for this?First, is there a written policy of no soft hyphens in Wikipedia? Please provide a short explanation of the reason, and link to the policy from this article. Second, is the zero-width space (​) allowed? I've found it useful. -- Traal ( talk) 01:24, 2 November 2012 (UTC)
[Line breaks in the wiki source (not reader visible, just for editors)]
Since a question about line break tags in source was mentioned above it doesn't seem too off-topic to ask if there is any sort of formatting guideline for editors when writing wiki source? I find large blocks of wiki-markup and citations hard to read unless they contain spaces and line breaks. The citation templates for include examples with lots of line breaks in the wiki markup, and others with just a few spaces between parameters. The readability of markup is important because when editing I will try to improve citations by remove extra junk from URLs, or filling in citations with extra details such as author or date that others may not have filled in.
I'm hoping there are existing guidelines, expecting other editors to politely not strip spaces and line breaks out of articles doesn't work. It seems only polite to at least try and abide by the formatting of previous editors. Some editors even try to explain their stripping of line breaks by suggesting there is a "shortage of space", and are probably not aware about the compression used when web pages are sent by webservers (compression that makes it especially pointless to worry about spaces and line breaks). If the built in Wikipedia editor and diff tool were better it might help, but removing the line breaks also makes it difficult to check diff between revisions.
All I'm really asking that in an article that is not stable, and has not even reached the level of good article (GA) there will still be people working on it and to avoid wholesale stripping of indentation, spaces and line breaks. (On an article that is more stable and well written and citations mostly properly filled out already I don't mind so much about line breaks being removed.) I hope there is already a guideline I can point to next time an editor thinks it is appropriate to strip out all the line breaks. -- 109.77.175.76 ( talk) 04:09, 12 January 2013 (UTC)
Hi,
On
Wikipedia talk:WPCleaner, different users are giving a different opinion on what syntax should be used to replace an incorrect break tag (</br>
, <br/>
and <br.>
, ...). Should I use <br>
or <br />
? Both are correct in HTML5, only the second one is correct in XHTML but MediaWiki doesn't try to enforce XHTML anymore. By default, my preference would go to <br />
, because I find it cleaner. --
NicoV (
Talk on frwiki)
13:05, 3 July 2013 (UTC)
<wbr>
will be allowed with MediaWiki 1.22/wmf13.
[1] --
Gadget850
talk
07:22, 17 August 2013 (UTC)
I'm not sure that this change is appropriate. First some background:
<br>
into <br/>
in an article I was editing,
User:Woodstone noticed and queried the merits of this change. Details at
User talk:Mitch Ames#Line break. In summary, I changed them to keep
this syntax highlighting tool happy, per that tool's
documentation.Note that I am not an expert in HTML/XTML or variations thereof, so I make no assertions about what the "correct" syntax is or should be. However, looking at the new version of WP:LINEBREAK
Mitch Ames ( talk) 09:26, 27 October 2013 (UTC)
<br/>
and <br />
. Which one you use is a matter of personal preference. There is no technical advantage to <br />
over <br/>
.<br />
is better than <br/>
then feel free to change this page to reflect that, and feel free to make any other changes that make the page's meaning more clear. I'm pretty open about it. —
Remember the dot (
talk)
21:28, 27 October 2013 (UTC)
<br/>
and <br />
are correct XHTML, but there used to be browsers that did not accept <br/>
(if I remember well Microsofts IE). If you inspect the output of WP, you will notice that it always has <br>
, as that is correct HTML. Therefore there is no advantage in changing existing <br>
into <br />
. It makes the edit box less human friendly for the vast majority of editors that do not use syntax highlighting. −
Woodstone (
talk)
12:15, 28 October 2013 (UTC)
<br>
, <br/>
and <br />
are valid HTML5.
[3]<br />
is valid.<br />
.<br>
tag was the only valid form up to and including HTML 3.2<br>
form, and also permitted the <br />
form for compatibility with XML parsers; in XML,
the space is optional<br />
form - the XHTML documentation is inconsistent as to whether the space is
optional or
mandatory<br>
and <br />
are
equally valid HTML5<br>
to <br />
(or vice versa) is unnecessary; changing <br/>
to <br />
(or vice versa) is pretty much pointless. However, changing invalid forms such as </br>
or <br\>
to either of the valid forms should be performed wherever the invalid forms are found. --
Redrose64 (
talk)
15:11, 28 October 2013 (UTC)<br />
, not <br>
-- see all the discussion about HTML Tidy.<br/>
or <br />
must be used in the MediaWiki namespace (and everywhere on wikis without HTML Tidy) or XML parsers will break.<br/>
or <br />
should always be preferred, but I recognize that others feel differently and I'm willing to just leave this page alone. —
Remember the dot (
talk)
17:35, 28 October 2013 (UTC)
<br/>
or <br />
must be used in the MediaWiki namespace (and everywhere on wikis without HTML Tidy)"? Wikipedia does not serve XML - it serves HTML5 (you can tell by the
<!DOCTYPE html>
before the <html>
when viewing the page source): the space and the slash are therefore both optional. HTML permits a certain amount of "sloppiness" that XHTML does not - this is not just <br>
and other empty elements with no slash, but also unclosed non-empty elements including (but not limited to) <colgroup>
<dd>
<dt>
<li>
<option>
<p>
<td>
<tfoot>
<th>
<thead>
<tr>
. HTML Tidy adds in any missing closing tags for these elements, not to make valid HTML, but to make valid XHTML. But the need for HTML Tidy is reduced since we switched away from XHTML.<br>
to <br/>
. That's a matter of opinion, there's no way for me to convince you. —
Remember the dot (
talk)
00:05, 29 October 2013 (UTC)<br />
is consistent with MediaWiki extensions such as <references />
. —
Remember the dot (
talk)
03:27, 29 October 2013 (UTC)
<references />
is an extension tag- early in extension development someone decided to use markup that mimicked XHTML, but it is not HTML.<br>
and <br />
are equally valid, and converting from one form to the other is generally a meaningless edit, except for consistency on a particular page. --
Gadget850
talk
10:50, 29 October 2013 (UTC)I had made a page desine in html with lots of new text heading and content in it, my query is- i want to break text and move to next page in ipad. can I give page text command in span? because if I am giving this command to para in mid, the line breaks and the remaining text start from new line. Is there any query for it. — Preceding unsigned comment added by 115.111.50.254 ( talk) 11:01, 11 September 2014 (UTC)
How would I edit the Wikimedia code to respect single line breaks everywhere, instead of just in the poem tag? Techni ( talk) 14:46, 18 July 2017 (UTC)
- Paul T +/ C 21:17, 7 March 2018 (UTC)
Is there a discussion somewhere demonstrating consensus for
this change by @
SMcCandlish:? The edit summary was This hasn't been updated in years.
, which is 100% true, but I'd like to read the rationale for this decision. This seems like a pretty big change by adding this section:
While forms without the
/
(such as<br>
and<br >
) will work properly in the renedered page, they break several of the available syntax highlighers for wikicode in the editing view, and so should be avoided. Please correct occurrences to<br />
as you encounter them, though preferably as a part of a more substantive edit.
Where before there was no such directive to "correct" all <br>
to <br />
. I can't believe there wasn't a huge thread hashing it out and showing agreement before making a change like this. -
Paul
T
+/
C
00:34, 6 March 2019 (UTC)
Question: Do any of these templates for preventing line breaks work for images because all of them seem to cause a line break. Mn1548 ( talk) 14:51, 17 March 2019 (UTC)
An editor has asked for a discussion to address the redirect Wikipedia:Line break. Please participate in the redirect discussion if you wish to do so. UnitedStatesian ( talk) 12:42, 12 April 2019 (UTC)
Is it me or shouldn't this article include information on how to make browsers trigger line-breaks automatically? As does running text, sometimes it is useful for other purposes aswell, e.g. tables. EnTerbury ( talk) 05:17, 5 April 2020 (UTC)