Rich Text Editor Press "Enter" get two carriage returns

Desktop version: 1.4.7 (prod, win32)
Windows Version: Windows 10 Versioin 20251
When I use rich text editor to edit notes, each time I press "Enter", there will be two carriage returns insert to note, and I can't delete one by one.
The only way I can delete the redundant carriage returns is to switch edit mode by click "Toggle editors" and save (Ctrl+S) the note.

1 Like

Ubuntu Linux Mate 20.04
Joplin 2.4.12

I just noticed this tonight (I don't use the Rich Text editor often.) I have an existing note, with a bunch of lines of text, single spaced. They are displayed properly when I toggle between the two editors. However, if I move the cursor to the end of the last line and tap the enter key, the editor seems to be using double spacing. The cursor is placed what looks to be two lines below the previous line. However, unlike the OP, I don't see two carriage returns. If I use the back space key once, the cursor is moved to the end of the text on the previous (formerly last) line.

If I toggle to the Markdown editor, tapping the Enter key works as expected - the cursor is placed one line below the previous line.

1 Like

I believe it is simply how the rich text editor (TinyMCE) works.
Pressing return on the rich text editor (without soft breaks enabled in the markdown options) creates separate <p> elements for each line whereas if you press shift+return you get a single <p> element with the lines separated by <br>.
e.g.

<div id="rendered-md">
<p data-source-line="1">lines</p>
<p data-source-line="3">lines</p>
<p data-source-line="5">lines</p>
<p data-source-line="7">line<br>line<br>line</p>
</div>

If you were to look at the markdown directly you will have:

lines<cr><lf>
<cr><lf>
lines<cr><lf>
<cr><lf>
lines<cr><lf>
<cr><lf>
lines<cr><lf>
lines<cr><lf>
lines<cr><lf>

The default behaviour of markdown is with "soft breaks" where the last three lines don't have the <cr><lf> converted to a <br> but Joplin defailt to "hard breaks".
See - Markdown Guide | Joplin

So basically, pressing "return" on the rich text editor always inserts a full "hard break" rather than "two lines" where shift+return will enter a "soft break" which is rendered differently depending on the markdown>soft breaks option.

Daeraxa, thanks for the clarification! I verified that using shift-return in the Rich Text editor does indeed result in single spacing. That's great to remember. I'm guessing that newcomers (or even experienced users who don't follow this forum) will be confused by the different behavior between the markdown editor and the rich text editor.

Hi,
If I enter three lines with shift+return keys in rich text mode like this:
line1 | shift+return keys
line2 | shift+return keys
line3 | shift+return keys

Then switch to markdown mode, then switch to rich text mode again, the text will change to one line like this:
line 1 line2 line3.

This is not what i want.

How to enter many lines in rich text mode but don't create space line between two lines( don't create two carriage returns insert to note)?

1 Like

Do you have soft breaks turned off (Config > Markdown)?

My problem was solved when I turned off soft breaks. It will not change to line1 line2 line3 again with shift+return. Thank you.

1 Like

I have this issue too. I sync Joplin between my phone and several computers. The same note will appear on some instances as:

line1
line2
line3

And will appear on others as:

line1 line2 line3

This is rather infuriating.

Also, minor gripe: on a smartphone it is hard (impossible?) to use shift+return.

There isn't a rich text editor on mobile so this doesn't apply.

The other issue will depend on what you have set in your markdown options for "Enable soft breaks".
If you have it turned on with some clients then it will render as the second example if formatted as the first.

Thank you! Yes the "Enable soft breaks" option was set differently on my different devices. Now everything displays consistently.

Re. mobile: True, I see that on mobile I can only edit the markdown directly. So I see new lines don't need a <br> tag to display on a new line here. I guess it's up to that "soft breaks" option to determine how they get rendered. Slowly getting used to this...

Thanks for the support!

I had a lot of trouble finding a way to stop the double spacing after entering return - and all the suggestions I cam across were wrong!
It's actually quite easy - add this code to the, "Custom stylesheet for rendered markdown"

p {
font-size : 15px;
background-color : #ffffff;
padding : 0;
margin : 0;
line-height : 20px;
}
#p2 {
background-color : #ffffff;
}