mersenneforum.org newlines in linux
 User Name Remember Me? Password
 Register FAQ Search Today's Posts Mark Forums Read

 2022-10-27, 16:43 #1 SethTro     "Seth" Apr 2019 32·53 Posts newlines in linux I don't know if this affects others Everytime I add a newline on this forum it gets expanded to two newlines I assume this is to do with "\n" vs "\n\r". My "fix" is to preview the post, remove the extra newlines and then submit the post and god help me if I make an edits when previewing the post. Attached Thumbnails
 2022-10-27, 17:07 #2 EdH     "Ed Hall" Dec 2009 Adirondack Mtns 2×5×521 Posts Yes, this annoys me with all my posts as well. There is another more bothersome problem having to do with edited code blocks. extraneous characters show up at the beginning of a code line. This plays havoc with some languages such as Python. I have to watch carefully what happens if I edit a code block using the forum editor. I often do all code block editing via copy/paste to my local editor and copy/paste back into the forum code block.
 2022-10-27, 17:47 #3 kriesel     "TF79LL86GIMPS96gpu17" Mar 2017 US midwest 23·919 Posts Also anomalous vspace behavior observed on Windows. Using Firefox. Beginning with a certain Firefox version; before that it was not an issue. At first I thought it was something had changed on the forum, but eventually traced it to Firefox behavior changing. Preview early and often before posting original or edits, as a workaround. Or try a different browser. One enter key-press preceded this line. Two preceded this line. It initially looks right, then upon preview it's effectively three, as shown. So if two are sought, enter enter preview delete-one. Code blocks seems to "swallow" trailing vspace and convert them into leading spaces on the last line of the code block. Again, edit, preview, repeat until satisfied. On large reference posts it can be quite tedious. Code: /my code block /of 2 lines followed by 2 enter key-presses. / should be beginning of line. These can be hard to see in preview when the preview font is not fixed width. As can column alignment, which in my experience requires iterating. Another nuisance is code blocks often have an extraneous trailing vspace or multiple that can not be eliminated. Example above has the ending code tag immediately following "lines", and "followed" immediately following the ] Last fiddled with by kriesel on 2022-10-27 at 18:11
 2022-10-27, 18:09 #4 kriesel     "TF79LL86GIMPS96gpu17" Mar 2017 US midwest 23·919 Posts MS Edge Windows experiment First line followed by two enter keypresses Okay, now a code block Code: line1 line2 followed by text without any enter keypresses or vspace, then a second code block Code: line3 line4 followed by 2 enter keypresses, then this line. Attached Thumbnails
 2022-10-28, 14:42 #5 Dr Sardonicus     Feb 2017 Nowhere 7·887 Posts My limited understanding is, it depends on what happens when you press Return. Two of the old ASCII control characters are CR ("Carriage Return", ASCII character code D hex or 13 decimal) and LF ("Line Feed", ASCII character code A hex or 10 decimal). I'm not sure how many other Forumites have seen a teletype machine in operation... IIRC, MS-DOS "saw" pressing Return as CR-LF, while UNIX saw it as LF, AKA "newline." Apparently some "Unixalike" OS's "see" Return as CR instead. Also from "back in the old days," I seem to recall something unexpected happening when UNIX "saw" a line in a text file which had only a single period typed on it. It might have treated it as end-of-file, but I don't remember for sure.
 2022-10-28, 15:56 #6 Xyzzy     Aug 2002 23·1,069 Posts The weird extra CR/LF isn't an issue using Safari on IOS, so we think the problem might be browser-induced.
 2022-10-28, 16:10 #7 kriesel     "TF79LL86GIMPS96gpu17" Mar 2017 US midwest 23×919 Posts @SethTro, EdH: what browsers are you using? Have you tried an alternative and seen the same behavior, or different?
2022-10-28, 16:45   #8
xilman
Bamboozled!

"𒉺𒌌𒇷𒆷𒀭"
May 2003
Down not across

23×3×5×97 Posts

Quote:
 Originally Posted by Dr Sardonicus My limited understanding is, it depends on what happens when you press Return. Two of the old ASCII control characters are CR ("Carriage Return", ASCII character code D hex or 13 decimal) and LF ("Line Feed", ASCII character code A hex or 10 decimal). I'm not sure how many other Forumites have seen a teletype machine in operation... IIRC, MS-DOS "saw" pressing Return as CR-LF, while UNIX saw it as LF, AKA "newline." Apparently some "Unixalike" OS's "see" Return as CR instead. Also from "back in the old days," I seem to recall something unexpected happening when UNIX "saw" a line in a text file which had only a single period typed on it. It might have treated it as end-of-file, but I don't remember for sure.

I've used honest-to-\$DEITY teletypes many times. I would love to have an ASR-33 in my collection of memorabilia. A wet-sump printer.

A single dot on a line signalled the end of an email message and the like, such as a Usenet posting. It may well have had other uses.

 2022-10-28, 18:02 #9 EdH     "Ed Hall" Dec 2009 Adirondack Mtns 2×5×521 Posts Yes, I'm guilty of using Firefox and have not tried anything else. I have wandered through the settings a little bit to see if there may have been an editing value somewhere.
 2022-10-28, 18:07 #10 storm5510 Random Account     Aug 2009 Not U. + S.A. 11×229 Posts I have had double spacing for years. I believe it to be a browser issue, mostly. It will do this with Firefox and MS Edge. The extra blank lines get added in while doing a preview.
2022-10-28, 19:30   #11
xilman
Bamboozled!

"𒉺𒌌𒇷𒆷𒀭"
May 2003
Down not across

1164010 Posts

Quote:
 Originally Posted by storm5510 I have had double spacing for years. I believe it to be a browser issue, mostly. It will do this with Firefox and MS Edge. The extra blank lines get added in while doing a preview.
All versions of Firefux that I have used over the years, including this one, have had no such problem.

Perhaps Firefux works better under Linux?

 Thread Tools

 Similar Threads Thread Thread Starter Forum Replies Last Post tServo Software 0 2019-05-07 16:59 henryzz Linux 15 2008-06-29 12:30 gd_barnes No Prime Left Behind 6 2008-05-10 06:28 nbv4 Software 1 2006-04-04 02:04 Drooling_Sheep Software 8 2003-11-22 05:50

All times are UTC. The time now is 05:31.

Fri Jan 27 05:31:33 UTC 2023 up 162 days, 3 hrs, 0 users, load averages: 0.91, 1.01, 1.10

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.

≠ ± ∓ ÷ × · − √ ‰ ⊗ ⊕ ⊖ ⊘ ⊙ ≤ ≥ ≦ ≧ ≨ ≩ ≺ ≻ ≼ ≽ ⊏ ⊐ ⊑ ⊒ ² ³ °
∠ ∟ ° ≅ ~ ‖ ⟂ ⫛
≡ ≜ ≈ ∝ ∞ ≪ ≫ ⌊⌋ ⌈⌉ ∘ ∏ ∐ ∑ ∧ ∨ ∩ ∪ ⨀ ⊕ ⊗ 𝖕 𝖖 𝖗 ⊲ ⊳
∅ ∖ ∁ ↦ ↣ ∩ ∪ ⊆ ⊂ ⊄ ⊊ ⊇ ⊃ ⊅ ⊋ ⊖ ∈ ∉ ∋ ∌ ℕ ℤ ℚ ℝ ℂ ℵ ℶ ℷ ℸ 𝓟
¬ ∨ ∧ ⊕ → ← ⇒ ⇐ ⇔ ∀ ∃ ∄ ∴ ∵ ⊤ ⊥ ⊢ ⊨ ⫤ ⊣ … ⋯ ⋮ ⋰ ⋱
∫ ∬ ∭ ∮ ∯ ∰ ∇ ∆ δ ∂ ℱ ℒ ℓ
𝛢𝛼 𝛣𝛽 𝛤𝛾 𝛥𝛿 𝛦𝜀𝜖 𝛧𝜁 𝛨𝜂 𝛩𝜃𝜗 𝛪𝜄 𝛫𝜅 𝛬𝜆 𝛭𝜇 𝛮𝜈 𝛯𝜉 𝛰𝜊 𝛱𝜋 𝛲𝜌 𝛴𝜎𝜍 𝛵𝜏 𝛶𝜐 𝛷𝜙𝜑 𝛸𝜒 𝛹𝜓 𝛺𝜔