21
submitted 1 month ago by Mandyv2@lemmy.world to c/lemmy@lemmy.ml

I apologize if this is not right to post here but im not sure where to go with this one as i havent really found an answer myself.

See, heres the thing, as yall surely know when i hit enter on a line once it will not work, it has to be two.

Is that intentional, if so why?

how does one disable that?

all 16 comments
sorted by: hot top controversial new old
[-] Ephera@lemmy.ml 25 points 1 month ago

It's the way Markdown works. If you put two spaces at the end of a line
before hitting enter, then it will only do a normal linebreak.

[-] bleistift2@sopuli.xyz 10 points 1 month ago

Example: Type

Once upon a midnight dreary  
While I was pondering, weak and weary  
Over many a quiant and curious volume of forgotten lore  

To get:

Once upon a midnight dreary
While I was pondering, weak and weary
Over many a quiant and curious volume of forgotten lore

(You can highlight the source code to find the extra spaces at the end of each line). Note that this is different from paragraphs, which add spacing between them:

Once upon a midnight dreary

While I was pondering, weak and weary

Over many a quiant and curious volume of forgotten lore

Once upon a midnight dreary

While I was pondering, weak and weary

Over many a quiant and curious volume of forgotten lore

[-] mark@programming.dev 3 points 1 month ago

For anyone who cares, you can get this same behavior of a normal line break by holding shift while pressing enter as well.

[-] bleistift2@sopuli.xyz 8 points 1 month ago* (last edited 1 month ago)
Not
in
markdown

(Pressed Shift+Return after every word.)

Not in markdown.

But it works in other word processors (like Word, libreoffice) that distinguish between line breaks and paragraph breaks.

[-] SatyrSack@feddit.org 2 points 1 month ago* (last edited 1 month ago)

Apparently it works in Thunder

EDIT: And Photon

[-] bleistift2@sopuli.xyz 1 points 1 month ago

Interesting.

[-] bleistift2@sopuli.xyz 17 points 1 month ago* (last edited 1 month ago)

This is how markdown works. There is no way to disable that. This is an old convention from when text editors didn’t wrap lines automatically and enables you to write long paragraphs of text, breaking the lines as it makes sense to you, without creating a paragraph each time.

See the Lemmy help page on markdown or the Markdown Guide.

[-] NegativeLookBehind@lemmy.world 5 points 1 month ago

The “workaround” is to use a backslash to sort of escape the default behavior:

This is line one \
This is line two

Without the code formatting, of course.

[-] hedgehog@ttrpg.network 3 points 1 month ago

You should also be able to just put two spaces
At the end of a line to insert a line break.

[-] NegativeLookBehind@lemmy.world 1 points 1 month ago

Yup, that works too.

[-] RagingHungryPanda@lemm.ee 8 points 1 month ago

That's the markdown formatting. If you put two spaces at the end of a line, it won't put them together https://www.markdownguide.org/cheat-sheet/

No double space example:
For example, No double space

With double space:
For example,
Double space

[-] emptyother@programming.dev 6 points 1 month ago

It isnt just how Markdown works either, its how HTML works too: Text is grouped in paragraphs there too, not in lines or statements. Of course there is options to force a line break for when its necessary. But most text reads better as paragraphs. And most people overuse manual line breaks.

[-] sugar_in_your_tea@sh.itjust.works 2 points 1 month ago

Yeah.

I really don't want to see text like this.

It would make things a lot more annoying to read.

I much prefer combining sentences by default. It's natural to put a blank line between paragraphs, and Markdown was designed to make the natural thing render decently. You can put things on separate lines if you want, and it'll always read nicely.

But definitely break things up into paragraphs if it makes sense.

[-] Zagorath@aussie.zone 5 points 1 month ago

Lemmy uses for its markup a language called "markdown". It’s the same one used on Reddit, Stack Exchange, as well as in a modified form on Discord.

Markdown requires two line breaks to define a new paragraph to allow you to break your paragraphs across multiple lines, a useful ability to have with writing that’s going to be tracked by Git, or displayed on some old-school text editors. It also gives you the ability to separate between two paragraphs
and one paragraph with a line break in it.
Which is a useful thing to be able to do in some circumstances, like when writing poetry, or sharing your results in !dailygames@lemmy.zip. To enter a "line break", end a line with two spaces and then press enter only once.

[-] penquin@lemm.ee 4 points 1 month ago

Wow, this is an issue I have had even on Reddit and never knew why. Just always did double spaces. Thank you for asking this question and thank you to those
Who answered.

this post was submitted on 13 Oct 2024
21 points (100.0% liked)

Lemmy

11948 readers
5 users here now

Everything about Lemmy; bugs, gripes, praises, and advocacy.

For discussion about the lemmy.ml instance, go to !meta@lemmy.ml.

founded 4 years ago
MODERATORS