this post was submitted on 12 Jul 2026
14 points (93.8% liked)

No Stupid Questions

48895 readers
1206 users here now

No such thing. Ask away!

!nostupidquestions is a community dedicated to being helpful and answering each others' questions on various topics.

The rules for posting and commenting, besides the rules defined here for lemmy.world, are as follows:

Rules (interactive)


Rule 1- All posts must be legitimate questions. All post titles must include a question.

All posts must be legitimate questions, and all post titles must include a question. Questions that are joke or trolling questions, memes, song lyrics as title, etc. are not allowed here. See Rule 6 for all exceptions.



Rule 2- Your question subject cannot be illegal or NSFW material.

Your question subject cannot be illegal or NSFW material. You will be warned first, banned second.



Rule 3- Do not seek mental, medical and professional help here.

Do not seek mental, medical and professional help here. Breaking this rule will not get you or your post removed, but it will put you at risk, and possibly in danger.



Rule 4- No self promotion or upvote-farming of any kind.

That's it.



Rule 5- No baiting or sealioning or promoting an agenda.

Questions which, instead of being of an innocuous nature, are specifically intended (based on reports and in the opinion of our crack moderation team) to bait users into ideological wars on charged political topics will be removed and the authors warned - or banned - depending on severity.



Rule 6- Regarding META posts and joke questions.

Provided it is about the community itself, you may post non-question posts using the [META] tag on your post title.

On fridays, you are allowed to post meme and troll questions, on the condition that it's in text format only, and conforms with our other rules. These posts MUST include the [NSQ Friday] tag in their title.

If you post a serious question on friday and are looking only for legitimate answers, then please include the [Serious] tag on your post. Irrelevant replies will then be removed by moderators.



Rule 7- You can't intentionally annoy, mock, or harass other members.

If you intentionally annoy, mock, harass, or discriminate against any individual member, you will be removed.

Likewise, if you are a member, sympathiser or a resemblant of a movement that is known to largely hate, mock, discriminate against, and/or want to take lives of a group of people, and you were provably vocal about your hate, then you will be banned on sight.



Rule 8- All comments should try to stay relevant to their parent content.



Rule 9- Reposts from other platforms are not allowed.

Let everyone have their own content.



Rule 10- Majority of bots aren't allowed to participate here. This includes using AI responses and summaries.



Credits

Our breathtaking icon was bestowed upon us by @Cevilia!

The greatest banner of all time: by @TheOneWithTheHair!

founded 3 years ago
MODERATORS
 

Sometimes you want to write something with broken lines and you write in the editor:

That's right I'm Sokka
It's pronounced with an Okka
Young Ladies, I rocked ya!

But it ends up looking like this:

That's right I'm Sokka It's pronounced with an Okka Young Ladies, I rocked ya!

The fix is to add two spaces between the final character and the carriage return.

I don't understand what the problem is. CR should be easy enough to translate, and the users intentions are clearly confirmed because they're looking right at what the expect it to look like when they hit submit.

Why does the user have to add two spaces? Why is the universe like this?

Edit: Holy Shit, look, I'm just an idiot typing text expecting WYSIWYG and I don't see a good reason for why I'm not getting it other than that programmers lack theory of mind.

all 32 comments
sorted by: hot top controversial new old
[–] watson387@sopuli.xyz 1 points 5 minutes ago

You're talking about Markdown. If it's not a 'what you see is what you get' editor, that's going to be your experience every time. Also, you can probably learn Markdown in the time it took you to write that post.

[–] folekaule@lemmy.world 8 points 1 hour ago (3 children)

There is a theory in UX that says that it is a bad design when it violates the users expectations of how they think it should work. In this case, the interface may not be clear enough about what you're actually typing. You're not typing WYSIWYG text, as you stated in your edit, you are in fact typing source code, or more specifically: markup, in a language punningly called Markdown.

Some of the confusion in the other replies come from your use of the term Carriage Return (CR) which has a very specific meaning to programmers and does not refer to the Return/Enter key. I won't go into that more here, since that's another tangent.

Anyway, Markdown is designed to be a lightweight markup language, so you can focus mostly on content and apply light formatting where needed for emphasis or bolding. As such, it's a good fit for online comments, provided the users are familiar with it, or enough contextual help is available.

Part of Markdown is that it needs two line breaks or two spaces at the end of a line to introduce a forced line break. This is just a choice the creators made of how things should work in Markdown (more on that below). In HTML, for example, you would use <br> instead.

To your question as to why go through that trouble and not just use the newline characters as-is, the most likely reason people prefer it is text editors. By allowing you to break up long passages of text with single line breaks, you don't need to rely on the editor's word-wrap function to keep the full lines visible in your editor.

Markdown is mostly authored more like source code than prose. Moreover, as it is "code", it may be subject to automated reformatting that could impose its own line-length rules, etc. and that would ruin the formatting. This often results in long lines being wrapped twice: at the intended point and the forced breakpoint and it looks terrible.

The original Markdown spec by John Gruber explains it like this:

Paragraphs and Line Breaks

A paragraph is simply one or more consecutive lines of text, separated by one or more blank lines. (A blank line is any line that looks like a blank line — a line containing nothing but spaces or tabs is considered blank.) Normal paragraphs should not be indented with spaces or tabs.

The implication of the “one or more consecutive lines of text” rule is that Markdown supports “hard-wrapped” text paragraphs. This differs significantly from most other text-to-HTML formatters (including Movable Type’s “Convert Line Breaks” option) which translate every line break character in a paragraph into a tag.

When you do want to insert a break tag using Markdown, you end a line with two or more spaces, then type return.

Yes, this takes a tad more effort to create a , but a simplistic “every line break is a ” rule wouldn’t work for Markdown. Markdown’s email-style blockquoting and multi-paragraph list items work best — and look better — when you format them with hard breaks.

You can argue that that makes it not a good fit for online comment editing, and I would say you have a great point, but it's also very popular and works well for the most common cases. (Especially with programmers because it has many nice features for us.)

Many web apps do allow you to switch between HTML content editing mode (WYSIWYG) and Markdown. I imagine the reason why not more apps do it is just because it's more code to write, test, and maintain.

I usually recommend people learn more about Markdown to avoid being frustrated by the quirks, and maybe even find some handy tricks they didn't already know. On the other side of the screen, as developers, we need to keep in mind that not everyone knows Markdown, and we need to make sure it's obvious to users what it is they are editing and where to find information about it.

[–] schipelblorp@sh.itjust.works 1 points 9 minutes ago* (last edited 7 minutes ago)

Yeah, I actually kind of low-key hate reddit's WYSIWIG editor because I do already know most of the markdown shortcuts and it's faster (and I think there was a time when you couldn't even use Ctrl-B for bold but has to grab your mouse). But you can teach yourself the formatting marks by hitting the button and seeing which characters get added, * for italics (aka emphasis) ~~ for strikethrough etc... the line break thing is completely opaque.

[–] otacon239@lemmy.world 4 points 57 minutes ago

You can also
add new lines
by adding a \ character
to the end of the line before it

[–] cecilkorik@lemmy.ca 12 points 2 hours ago* (last edited 1 hour ago) (1 children)

So you're talking about Markdown. It's a specific format, popularized initially on Reddit, that has now become so widely used it is almost universal nowadays (and only growing more popular since so many AI seem to use it natively), and while I agree with you in general and I'd even go as far as to call this a fundamental anachronistic design flaw of Markdown, I think to gain any understanding of this issue you have to understand the historical context that Markdown was born from, and for that you need a history lesson.

Let's start by establishing some terminology: "ASCII" is the most basic standard for computerized text. It's quite limited, 127 characters, ~30 of which are non-printable control characters (including CR). This is pretty much the most universal, most compatible form of transmitting text over the internet. It's built into almost every other standard as its foundation, and we basically can't live without it anymore. We often call it "plain text", although nowadays we also have unicode, or "UTF-8" in its most common form, that would also like to claim that title, even unicode contains those original 127 ASCII characters hardcoded right at its base.

Anything beyond pure ASCII or sometimes unicode typically falls under the umbrella of "rich text". "ANSI" was one of the earliest and most basic forms of rich text, again completely built on top of ASCII, and is still used sometimes for terminals today. It allows some basic colors and bold/underline, occasionally supporting double-width or italic. It's very primitive compared to what we are used to nowadays and it relied heavily on non-printable ASCII control codes to do its work. In the old days, there was no capability for any sort of line-spacing other than 1. if you wanted a paragraph, you typically did TWO newlines to add 1 line of extra space in between the paragraphs to make it clear the previous paragraph had ended and a new one was starting.

The first truly cross-platform "rich text" that came around was "HTML", which is still of course what we use for the web today in all its glory. It wanted to do things differently than ANSI, and in a way, this was so that it could be compatible with ANSI. If you're copy-pasting code out of a terminal and getting a whole bunch of hidden non-printable ASCII that are going to mess up your HTML, that's a problem. This is where the roots of that issue you're seeing in Markdown were born. HTML intentionally has a whitespace-agnostic definition. It intentionally wanted to get away from all those ASCII "non-printable" control codes and it consciously chooses to completely ignore them, crucially, including CR/LF (which have all sorts of their own problems with cross-platform implementations, DOS/Windows uses both CR-LF and sometimes only recognizes both CR-LF in that specific order. Unix ONLY uses CR. Older macs ONLY used LF. It was a mess, and it caused a lot of problems (sometimes still does). HTML got around this entirely by completely ignoring those characters and treating them as if they didn't exist. They can't have cross-platform compatibility issues if they don't do anything in the first place.

HTML instead supports tags that control when to move text to a new line, and just as critically, HTML decided to make a key semantic distinction between "lines" and "paragraphs". specifies a line break ONLY, without breaking the paragraph. specifies a paragraph break, or a paragraph block depending how you use it, and that caused confusion of its own. But like it or not, paragraphs quickly became the standard method of laying out text on the web, and was sidelined as an afterthought.

As HTML and the web as whole grew, HTML started to gain a lot of very advanced and powerful features. Early internet forums wanted to make it easy for novices to communicate in some form of rich text without necessarily knowing HTML, and they didn't want to enable all the advanced features of HTML some of which posed legitimate security or usability risks for the rest of the site especially with javascript and web requests. They created their own forms of tagging like BBcode that they translated into a safe subset of HTML behind the scenes. Again it was typical to use paragraphs here, it was starting to become the expectation for "CR" to mean paragraph. Sometimes, the old typesetting definition of paragraphs was adopted, where two CRs meant a new paragraph, and one CR meant a new line only.

Meanwhile, you've got Microsoft Word and other word processors which are also working natively in rich text and paragraphs, and hitting enter in Word gives you a new paragraph, OR a new line depending on exactly what context you're currently in, but again paragraph is kind of the assumed default.

Finally, Markdown enters the scene. It comes from the world of HTML and BBcode and Word, but it wants to go back to the days of ASCII and make invisible choices of whitespace start mattering again, to get rid of all the ugly tags wrapped around all of our rich text up to this point and make nicely readable plain text where the whitespace defines how it's going to be presented, and its choice to resolve this dilemma is that it decides to keep the historical typesetting distinction of two CRs in a row makes a new paragraph, and it translates that into an HTML paragraph so it's not actually separated by two full lines when you have an HTML rendering of markdown, it's a proper HTML paragraph. So far so good. At this point, they could've chosen to do exactly what you said and what I think would've been the consistent thing to do: one CR (not two) means just a single new line, and sensibly, that would translate to an HTML element and everything would've been lovely.

But they didn't.

Instead, for whatever baffling reason, possibly because Markdown does interpret CR/LF in other formatting contexts like headings and tables, possibly because DOS/Unix/Mac line endings were still a bit of problem even at that time, and like I said was very, very sidelined by the whole culture and history of HTML, but without being able to see into their minds I can't say for sure exactly why they decided to go their own way for the implementation, coming up with this wonky "two spaces after a line" to require people to be deliberate about it. But they obviously continued following the HTML tradition of CR/LF being otherwise ignored.

Not to fully excuse this decision, but in their defense, sometimes copy-paste can insert newlines where you don't want them, so it's not always as clear that a CR is intentional the way you're hoping. Maybe the idea was that these non-spaced CRs aren't necessarily going to be intended if you're often copy-pasting long, wrapped lines out of an 80 column terminal or something. I still don't think that is justifiable, but it is what it is.

[–] schipelblorp@sh.itjust.works 1 points 27 minutes ago (1 children)

“ANSI” was one of the earliest and most basic forms of rich text, again completely built on top of ASCII, and is still used sometimes for terminals today. It allows some basic colors and bold/underline, occasionally supporting double-width or italic.

Oh, yes, ANSI. I'm having flashbacks to all the dark blue text on black background.

I've had fights with Word condensing cut-and-pasted text from the web to print; one sticking point was having to search and replace pairs of both CR and LF. Oy vey.

Thanks for the detailed explanation! Sounds like QWERTY--a decision that had good reasons behind it and kinda got stapled into a situation where maybe a different decision would have been made for the purpose, but now everyone's used to it and it's good enough the way it is.

[–] cecilkorik@lemmy.ca 2 points 12 minutes ago

Yeah, I think that's a fair summary! I have to admit I'm still fond of ANSI (and some of the old DOS extended ASCII that included all kinds of fancy UI and box drawing characters) but it's mostly nostalgia, and there's the whole different rabbit hole of extended ASCII code pages to get into. :)

[–] TootSweet@lemmy.world 3 points 1 hour ago* (last edited 34 minutes ago) (1 children)

So, I think I kindof know what you're getting at here, but you're not being very precise about it.

First some definitions (just for purposes of this conversation -- don't take this to be any assertion that a particular term always inherently has a particular meaning, it's just a tool for this conversation specifically):

  • Character: a single unicode character.
  • Plain text: unicode text absent any formatting.
  • Source: the plain text to be fed into a Markdown renderer to produce rendered output.
  • Rendered output: the formatted output of a Markdown renderer, as displayed to an end user.
  • Editor: any computer program or component of a computer program for the entry of plain text.
  • Line: text (plain text or rendered output, depending on context) rendered at the same vertical position.
  • Line break: the point at which text (either plain text or rendered output depending on context) starts rendering on the next line because of a newline.
  • Newline: a character that always forces a line break in an editor. (Remember "editor" is only about plaintext, so a newline doesn't necessarily force a line break in rendered output.)
  • Wrap: the point at which, absent a newline, text starts rendering on the next line due to column width constraints.

(As an aside a line break is sometimes accomplished with a "line feed" character. A "carriage return" character is something else that isn't the same thing. Which is a big part of where the confusion comes from.)

What you're saying, I think, is that putting a single newline in the source doesn't result in a line break in the rendered output. Is that right?

In some editors (Vim being one I know of), when plain text word wraps, pressing "down" when the cursor is on the first line of a wrapped series of lines causes the cursor to jump not to the second line of wrapped text, but to the first line after the next newline. To illustrate:

If this line is wrapped due to
being wider than the available
width.
And if this line is on its own line
due to being immediately preceeded
by a newline.

If your cursor in the above example was on the "w" in the first line there, pressing down would take the cursor to the space immediately before "is" in "And if this line is on its own line".

As a result, it can be quite a pain to deal with word wraps in such editors. This is part of why certain code style guides (like this one and this one have hard limits for how many characters are allowed before the next newline.

Given how much more convenient line breaks can be than word wrapping, people writing source to be rendered into rendered output may wish to be able to insert newlines to cause line breaks in the source without causing any change in the corresponding rendered output.

That all make sense?

At least that's most likely at least one reason why the people who invented Markdown decided specifically to make Markdown work that way.

Edit: Holy Shit, look, I’m just an idiot typing text expecting WYSIWYG and I don’t see a good reason for why I’m not getting it other than that programmers lack theory of mind.

I'm glad you're not in charge. I very much don't want to go back to the days of having TinyMCE embedded in everything.

[–] schipelblorp@sh.itjust.works 1 points 25 minutes ago

Yeah, that makes plenty of sense, especially coming from a coding perspective and also from a perspective of compatibility with different width displays. Thanks!

[–] schnurrito@discuss.tchncs.de 2 points 1 hour ago* (last edited 1 hour ago)

If you mean here on Lemmy or other markdown based sites, I think the reason is that it would become incoherent in terms of the HTML it generates.

HTML is supposed to be a format that describes meaning, not presentation. The meaning is that Lemmy comments consist of paragraphs (p elements) like any piece of text does. The way to start a new paragraph is to type two newlines in a row.

On occasion text isn't divided into paragraphs, like your example of poetry. The way to represent that meaning in HTML is a br element. You already described how to generate that in Markdown. But that is a rare special case. Makes sense that it requires special syntax so people don't do it accidentally.

Old forum software like phpBB or SMF worked the way you imagine. If I am not mistaken they translated a newline in the BBCode to an HTML br element, unfriendly to screen readers and automated technologies in the ordinary case where text was divided into paragraphs.

[–] marcos@lemmy.world 5 points 2 hours ago* (last edited 2 hours ago) (2 children)

Is this a rant about typewriters, computer character encodings, or some computer file format?

Why are you getting files with bare CR characters not followed by a LF? (Is this about last millennium Apple computers?)

[–] TootSweet@lemmy.world 7 points 2 hours ago (1 children)

I think they're talking largely (mostly?) about Markdown. (For instance, in Lemmy, when you stick a newline there, it doesn't give you a line break in the flow of the text.) And when they say "Carriage Return", they don't know what they're talking about. If I'm interpreting them correctly, I think they just mean "newline". And when they say "two spaces", I think they mean two newlines.

[–] schipelblorp@sh.itjust.works 2 points 2 hours ago (2 children)

Yes, I may not be using the right terminology. The "return" button on the keyboard.

I also gave an example, so I'm not sure why there's so much confusion.

[–] Zier@fedia.io 2 points 1 hour ago

Because it's Markdown it gets confusing. Here is some help. Line Breaks

[–] TootSweet@lemmy.world 3 points 2 hours ago (1 children)

I’m not sure why there’s so much confusion.

Because you're not using the right terminology. ;)

[–] schipelblorp@sh.itjust.works 1 points 23 minutes ago

Yeah, but if someone said, "I sharpened a steel bowl and used it to cut my steak, and here's a picture of my bowl" and you see a knife, wouldn't you know what they mean?

Maybe it is I that lacks theory of mind.

[–] schipelblorp@sh.itjust.works 3 points 2 hours ago (1 children)

This is a question about a behavior that the text editor of both Reddit and Lemmy seem to share.

I might be incorrect calling it a carriage return--it's the return button on the keyboard that creates a new line on the editor--I think it's called a line break, but apparently you need two to create an actual new line in the final text. See the other comment for details about how markdown approaches it.

[–] marcos@lemmy.world 2 points 1 hour ago

So, it is about markdown.

It's this way because people want to break their editable text into lines without making the final text break paragraphs. People write entire books in markdown, but it does become unsettling when you use in social media comments.

[–] CubitOom@infosec.pub 2 points 2 hours ago

CR vs CRLF?

[–] one_old_coder@piefed.social 2 points 2 hours ago (1 children)
[–] schipelblorp@sh.itjust.works 2 points 2 hours ago (3 children)

Ah, so that's where it starts, but why isn't it "fixed"? What benefit is there to leaving it like that?

People are writing text, not code and they're expecting the editor to the heavy lifting.

[–] blackbeans@lemmy.zip 2 points 52 minutes ago (1 children)

I'm with you on this one. The behavior is not as people would expect it.

Hitting enter/return should result in a newline. That's what users expect.

The UX is inconsistent because it shows a newline in the entry screen, yet doesn't show it after submitting.

[–] schipelblorp@sh.itjust.works 1 points 21 minutes ago* (last edited 21 minutes ago)

I'll say that the formatting options with the * and the _ and the ** are all pretty awesome. I wish every editor was like that.

[–] TootSweet@lemmy.world 4 points 1 hour ago (1 children)

but why isn’t it “fixed”?

Because it is useful to many people in certain contexts. It's not a bug. It truly is a feature. Not something to be "fixed".

You may prefer your ice cream strawberry flavored, but that doesn't mean any ice cream that is instead chocolate flavored is "defective" and needs to be "corrected" or "fixed" to make it strawberry flavored.

[–] blackbeans@lemmy.zip 1 points 48 minutes ago (1 children)

It can help to give an analogy. But in this case it would be more clear if you would demonstrate the usefulness of this feature by explaining why a user wants to prefer to hit enter and not get any result, instead of hitting enter and getting a newline.

[–] TootSweet@lemmy.world 1 points 41 minutes ago* (last edited 39 minutes ago)

https://lemmyverse.link/lemmy.world/comment/24735359

Also:

hit enter and not get any result

You mean "hit enter and have it not affect the rendered output." It does produce a result. It makes it appear/act differently in the editor. That's not "not getting any result." Just "not getting any result" that's visible in the rendered output.

[–] whaleross@lemmy.world 2 points 2 hours ago (1 children)

Because it is how the format is defined. There is nothing to fix. You write text in paragraphs by default and if you want it to be displayed in any other way you need to declare it. Most formatting is done before the text, like headings and lists, but this newline without a new paragraph is declared with two trailing spaces.

[–] schipelblorp@sh.itjust.works 0 points 2 hours ago* (last edited 2 hours ago) (1 children)

I
declare
it
by
hitting
an
entire
button
dedicated
to
making
a
new
line
that
also
makes
a
new
line
in
the
editor
I'm
looking
at
creating
a
new
line
after
I
hit
the
button
that
creates
a
new
line.

It doesn't make sense from a user perspective, whatever the format is (provided your users aren't programmers).

[–] whaleross@lemmy.world 3 points 1 hour ago (1 children)

Well, you are free to declare your own flavour and try get it supported by whatever editors and libraries you use. Damn, you can make up your own format that works in any particular way you want to. I bet in this time and age you could vibe code it with functions to your heart's desire.

But bitching about it to people that are trying to be helpful and explain why it is like it is will not render much other result than said people dropping you into their blocklist for being annoying.

[–] schipelblorp@sh.itjust.works 1 points 38 minutes ago* (last edited 34 minutes ago)

Fair. Apologies.

This issue is that you gave me kind of a detailed answer that didn't really answer my question: What is the BENEFIT of doing it this way in the face of unexpected behavior to a naive user? Two answers others have given are that it allows easier cut-and-paste, and it allows users to break up their text for their own readability on narrower displays while still allowing it to be formatted to fit the final screen. Your answer of "Is is the way it is because that's the way it is" is logically unassailable, yet lacks explanatory power.