Home / GitHub Page

MD Line break with 2 spaces

#1

I’ve noticed in both the Android version of Joplin and the Mac desktop version that 2 spaces at the end of a line of text is rendered differently than other MD renderings/editors that I’ve used.

According to daringfireball.net: " When you do want to insert a <br /> break tag using Markdown, you end a line with two or more spaces, then type return."

Joplin seems to do the opposite when rendering.

For example, in Joplin:

Line 1 [with 2 spaces appended]
Line 2

Is rendered as:

Line1Line 2

Whereas, without the 2 spaces appended to the first line, is rendered as:

Line 1
Line 2

0 Likes

RFE: Add soft break ON/OFF to General Settings
#2

That’s a feature isn’t it? Moreover, people who have been using the app for a while, with numerous/long notes, will have to go back and edit everything.

0 Likes

#3

As far as I can see that’s a bug, not a feature. Currently in Joplin, this:

Line 1
Line 2

Renders as

Line 1
Line 2

And this:

Line 1  
Line 2

Renders as:

Line 1Line2

I don’t think anyone who want this? Or were you somehow relying on this?

0 Likes

#4

Bug. Hard to imagine that is how someone would want to represent ‘i want these 2 things right one after another’ - with spaces and a line break. :upside_down_face:

0 Likes

#5

I kinda was relying on it. Current Joplin way plays nice when copying in other editors, Word & such. Plus it feels normal, next line starts where it should, the next line.

The two spaces for line break doesn’t work well with other editors, to copy you have to regex it out and mistakes can happen so you’ve to check the whole document manually which is a big waste of time.

Turtl uses markdown and it works the same way Joplin does. Though the spaces are left as it is and new line is taken as new line.

0 Likes

#6

Every MD editor that I’ve ever used renders just as laurent describes (and as I’ve described). As far as I’m concerned, Joplin is rendering just the opposite of the MD spec.

I agree it seems unnatural, and I agree that it makes copying raw MD text to a non-MD editor more difficult.

Joplin desktop offers an “edit in external editor” feature. The point that I’m bringing is that if Joplin note text is edited with an external MD editor, it renders differently.

0 Likes

#7

I think it’s good to adhere to the markdown standard. As I agree that this is a somewhat wierd feat of markdown, but a lot of users already has this in their workflow and existing notes if they should import them to Joplin. Without breaking Joplin notes, why not support both with and without spaces to render line breaks for adjacent paragraphs? Isn’t that possible?

2 Likes

#8

This needs to be implemented correctly, or made configurable.

Markdown is a markup language. Like html, the renderer will render to fit the space between the margins. Why? Because you don’t know where those margins are and if the document is rendered to a widescreen, cell phone, PDF file… the renderer has freedom to adjust it as it wishes (this is why HTML behaves this way). And since it’s a markup language you can have things like. some really long URL right in the middle of your text and and you don’t have to try to determine where the darn end of line should be.

BUT if you really REALLY want to put a hard break in there, you can, very easily, with a standard
(or
) or markdown’s two spaces and a return. Or even just an empty line between two bits of text. Simple. Really, if you can grasp how lists and links work, I think you can work out the difference between soft and hard breaks.

Sadly, now without having soft breaks implemented as they should be, I have to write every paragraph as one long line of text. Always. Especially if I ever take that markdown to another markdown platform.

Anyway. Joplin is a markdown editor. It should behave like a markdown editor. And if it doesn’t it should be, at the very least, configurable.

0 Likes