Carriage return (CR) and line feeds (LF) in Bio section

+1 vote
323 views
When adding text to the BIO which includes CR/LF, the text appears (already) correctly when in EDIT mode.

However, when switching back to the PROFILE section, WikiTree ignores the CR/LF (most, but not quite all, for some weird reason) and jumbles the text together, which removes the formatting and makes it MUCH harder to read.

Here is one such profile where it is hard to read (for the above reason) on the PROFILE page, but NOT on the EDIT page:

https://www.wikitree.com/wiki/Nixon-3810
in WikiTree Tech by Kenneth Nixon G2G Crew (810 points)

2 Answers

+2 votes
That's the way HTML rendering works

use <br> to add a "break"/new line.
by Dennis Wheeler G2G6 Pilot (589k points)
Correctly I believe it is <br />
Well, it doesn't work CONSISTENTLY between the EDIT and PROFILE pages... which is somewhat less than optimal.

It seems a rather simple matter to have the EDIT page simply strip out the hard-coded CR-LF and replace them with HTML's "<br /" code.

OR...

Since it's quite obvious that the CR-LF is STILL there, in the raw data, simply have the PROFILE page do the substitution either permanently OR on-the-fly.

I agree with you Kenneth. Its not user friendly. Some clever javascript programming could probably "fix" it.

But it IS working consistently as designed. The Edit page contains many text edit fields, which are not HTML. When saved, the Profile is then rendered in HTML -- which is designed to strip out the new lines (why they -- html designers, not wikitree -- designed it that way in the first place, I'll never understand)

and <br> is not technically correct according to spec -- but its still valid. And my muscle memory refuses to change from the original spec.

Thanks, Dennis.

Yeah... the EDIT page is just showing plain text... NOT rendered... while the PROFILE page IS rendered.

Stripping out the "new lines" - This was most likely done because different OS's do it differently.  DOS/Win uses both a CR+LF.  Others use ONLY the CR.  Others use ONLY the LF.  More, if you strip out or ignore ALL three options, then the browser can very effectively do the same thing as "word wrap", scaling for different screen/window and  frame widths.

As for how to handle it in the profile window...

Read the "text" into a memory buffer, like a string variable.  In the buffer only, change all CR+LF to a "<br />", then do the same for LF+CR, then do the same for any remaining CR's, then for LF's, then pass ONLY that variable/buffer to the HTML rendering engine, as if it were the original text, which would then preserve the ACTUAL original text, thus not having any effect on the EDIT page.

More... the "BIO text" is probably ALREADY being read into a dedicated variable/buffer, so that part wouldn't even need to be new.

(Heck, I've done this before in the past, in BASIC and even freaking REXX!.. and REXX is just a powerful scripting tool, NOT a real programming language... think of it as a sort of more powerful DOS batch file.  The REASON I did it was because I had to convert UNIX-formatted text files into something that I could work with on my DOS-based PC.)
ha. I'm usually going the other way around...converting ms dos based files into something usable on unix :)
+2 votes
<br /> is one option to force it, but the wiki formatting actually recognizes a new line as two carriage returns, not one.

https://www.wikitree.com/wiki/Help:Editing_Tips

And <br> is sort of universally recognized, but it's an empty tag, so it's most correct to be <br /> which indicates there is no closing member of the pair (<element> usually implies a closing </element> tag somewhere)
by Jonathan Crawford G2G6 Pilot (297k points)
First, THANKS, for the tip to just use two CR's to get the desired result.  THAT is annoying, but it's do-able.

I'll be DARNED if I'm going to go into all the bios where I've entered raw data to provide proof-of-info to the members of our community just to add that god-awful HTML string.  For one thing, I'm using cut-and-paste which does NOT include, or UNDERSTAND HTML code.

Think about it...

1) go to new line

2) press the <end> key to go to the end of it...

3) type <br />

then repeat fifty or a hundred times for each line break?  Or more, if it's a long bio?

Besides... the EDIT PROFILE tab-page ALREADY interprets and displays the CR correctly, which would certainly appear to prove that it can be done.
it already "interprets" it because its just a plain text edit field, and not being rendered by html

new lines have been a shortcoming of html since its invention many years ago.

its a pain in the butt.

down with WYSIWYG
down with HTML
long live 7-bit ASCII text
Okay... I went back and reformatted one Bio that I had created.

Using TWO <enter> actually resulted in double-spacing the lines, so to make it look better, I had to go in and add the HTML code, <br /> at the end of each line.

It was, quite frankly, a hassle, so I doubt I'll ever bother to do it again.

After taking the time to do research, then enter the data, then add the bio... THIS hassle is just simply a "bridge too far".
yeah, two enter keys is a new paragraph (although, before I get corrected again, technically <p> is a new paragraph with more spacing), not a new line.

not the best workaround

Related questions

+11 votes
0 answers
+1 vote
1 answer
323 views asked Nov 6, 2012 in Genealogy Help by Fontaine Wiatt G2G1 (1.7k points)
+3 votes
1 answer
120 views asked Aug 8 in Genealogy Help by Марина Жубрик G2G2 (2.2k points)
+3 votes
1 answer
316 views asked Oct 28, 2021 in Genealogy Help by Barry Smith G2G6 Pilot (320k points)
+3 votes
4 answers
+3 votes
1 answer
+16 votes
1 answer
195 views asked Feb 7, 2016 in The Tree House by Bill Sekel G2G6 Pilot (127k points)
+9 votes
0 answers
129 views asked Dec 13, 2015 in The Tree House by Kitty Cooper G2G6 Mach 1 (11.6k points)

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

disclaimer - terms - copyright

...