Is it preferred to use <br>, <br /> or <br/> - help pages disagree.

+9 votes
235 views

In order to force a line break in a profile we can use a br tag. But there is some ambiguity about how exactly to write the tag since the help pages are not consistent.

The WikiTree Help page on recommended tags says to use <br /> (note the space). However the WikiTree Help page on Editing Tips says to use <br>.

In my experience the most common use by WikiTreers is <br/>.

This article gives some background on the HTML tag and comes down slightly in favor of using <br/> but only because it is compatible with XHTML which is probably not relevant to WikiTree. More technical discussion is here on Stack Overflow.

They all have exactly the same effect so perhaps it does not matter. But can we at least make the help pages consistent on this?

in Policy and Style by Rob Pavey G2G6 Pilot (218k points)
edited by Rob Pavey
Personally I would like it if the help pages both said to use <br/> since that is what WikiTree Sourcer has always used :)
I use <br/> .

Does it make a difference to something, anything?
Note - using <br> for dividing text into paragraphs is against W3C recommendation, <p>...</p> should be used instead, with CSS styles for finer control.   So in some cases the answer to your question is -- none of the above !
CSS is not allowed on WT, though, Matt, so all the options are still in.

3 Answers

+7 votes
I always use <br />
by Robynne Lozier G2G Astronaut (1.3m points)
I'm Team <br />, if for no other reason than to be consistent with <references />.
I'm with this crew.
+3 votes

https://en.wikipedia.org/wiki/Help:Wikitext says 

HTML equivalent: <br> or <br /> can be used to break line layout.

So there's a third case.

by Kay Knight G2G6 Pilot (610k points)

Interesting. That example also references this page  https://en.wikipedia.org/wiki/Help:Line-break_handling which says:

<br>, <br >, <br/>, <br />

The MediaWiki software uses any of them for a single forced line break. All of them are converted to <br /> in the HTML that browsers read.

BTW the text above that says "All of them are converted to <br /> in the HTML that browsers read." is probably out of date - perhaps pre-HTML 5.

I checked on WikiTree and tried all three variations and they were all converted to <br/> (no space) in the HTML sent to the browser (Chrome in this case).
+4 votes
WikiTree currently serves profiles with the XHTML 1.0 Transitional doctype tag.

The XHTML specification requires <br /> , and the <br> form is not allowed.  So, that is your "technically correct" answer.

Browsers typically allow incorrect code in pages (otherwise people complain and use a different browser), so the "practical" answer is that they are all interchangeable and will be for the foreseeable future.

What about the future though? I can't comment on any direction WikiTree might move in the future ; whether they start enforcing XHTML 1.0 Transitional, or whether they  might change specification. So the "technically correct"  answer may change over time, but the "practical" answer stays the same; I do not foresee any of the three forms ever being rejected by browsers.

I tried a random WikiTree profile in the W3C validator for XHTML 1.0 Transitional, and it reported 200 errors and 158 warnings;  so at this point in time, WikiTree is not making an effort to actually follow that specification itself, nor have profiles follow it.
by Matt McNabb G2G6 Mach 3 (37.5k points)
I agree that practically it doesn't matter. It would be nice if the help pages were consistent though.

Kay's answer above made me realize that what we type into the bio text is not what gets sent to the browser. The WikiMedia software reads the bio text and generates HTML from it. My testing implies that regardless of what form of br tag a user puts into the bio text the server will send HTML to the browser in a single fixed form.

At first I thought this form was <br> since "Inspect Elements" in Chrome shows the element as <br>.

However, I looked at the network traffic and the HTML returned by the server to the Chrome browser actually uses <br/> everywhere.

So, any argument about which form is best to use in the bio text based on what is best sent to the browser is actually irrelevant.

Perhaps what matters is what forms are most acceptable to the WikiMedia software. At the moment that seems to be all of them. I guess we might switch to a different version of WikiMedia at some point but I doubt very much that it it would be more strict about that.
Agree that the gist of the question is about WikiMedia preferences rather than HTML family specifications .

Related questions

+10 votes
1 answer
322 views asked Jan 27, 2015 in WikiTree Tech by Dan Thompson G2G6 Mach 2 (24.5k points)
+7 votes
5 answers
519 views asked Mar 6, 2023 in WikiTree Help by Beth Schmillen G2G6 Mach 5 (52.2k points)
+3 votes
2 answers
+4 votes
1 answer
204 views asked Nov 2, 2021 in WikiTree Tech by Steve Widdowson G2G2 (2.4k points)
+4 votes
2 answers
137 views asked Jun 2, 2019 in WikiTree Help by Ulrich Seeckt G2G4 (4.4k points)
+2 votes
0 answers
226 views asked Feb 5, 2014 in Genealogy Help by Michael Suter G2G Rookie (190 points)
+2 votes
1 answer

WikiTree  ~  About  ~  Help Help  ~  Search Person Search  ~  Surname:

disclaimer - terms - copyright

...