# Rich Text Editor Press "Enter" get two carriage returns

**URL:** <https://discourse.joplinapp.org/t/rich-text-editor-press-enter-get-two-carriage-returns/12343>\
**Category:** Support\
**Created:** [10 November 2020 06:48 UTC](https://discourse.joplinapp.org/t/rich-text-editor-press-enter-get-two-carriage-returns/12343 "2020-11-10T06:48:19Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![gb2013](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/gb2013/32/5076_2.png) [@gb2013](https://discourse.joplinapp.org/u/gb2013)\
**Post date:** [10 November 2020 06:48 UTC](https://discourse.joplinapp.org/t/rich-text-editor-press-enter-get-two-carriage-returns/12343/1 "2020-11-10T06:48:19Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![guy-rouillier](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/guy-rouillier/32/15581_2.png) [@guy-rouillier](https://discourse.joplinapp.org/u/guy-rouillier)\
**Post date:** [27 October 2021 07:35 UTC](https://discourse.joplinapp.org/t/rich-text-editor-press-enter-get-two-carriage-returns/12343/2 "2021-10-27T07:35:57Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Daeraxa](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/daeraxa/32/6172_2.png) [@Daeraxa](https://discourse.joplinapp.org/u/Daeraxa)\
**Post date:** [27 October 2021 11:18 UTC](https://discourse.joplinapp.org/t/rich-text-editor-press-enter-get-two-carriage-returns/12343/3 "2021-10-27T11:18:53Z")

</div>

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.

```auto
<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:

```auto
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](https://joplinapp.org/markdown/#plugins)

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.

---

<div class="post-metadata">

**Author:** ![guy-rouillier](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/guy-rouillier/32/15581_2.png) [@guy-rouillier](https://discourse.joplinapp.org/u/guy-rouillier)\
**Post date:** [28 October 2021 08:37 UTC](https://discourse.joplinapp.org/t/rich-text-editor-press-enter-get-two-carriage-returns/12343/4 "2021-10-28T08:37:49Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Notedev](https://avatars.discourse-cdn.com/v4/letter/n/c89c15/32.png) [@Notedev](https://discourse.joplinapp.org/u/Notedev)\
**Post date:** [23 March 2022 08:10 UTC](https://discourse.joplinapp.org/t/rich-text-editor-press-enter-get-two-carriage-returns/12343/5 "2022-03-23T08:10:34Z")

</div>

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)?

---

<div class="post-metadata">

**Author:** ![Daeraxa](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/daeraxa/32/6172_2.png) [@Daeraxa](https://discourse.joplinapp.org/u/Daeraxa)\
**Post date:** [23 March 2022 09:07 UTC](https://discourse.joplinapp.org/t/rich-text-editor-press-enter-get-two-carriage-returns/12343/6 "2022-03-23T09:07:43Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Notedev](https://avatars.discourse-cdn.com/v4/letter/n/c89c15/32.png) [@Notedev](https://discourse.joplinapp.org/u/Notedev)\
**Post date:** [24 March 2022 06:25 UTC](https://discourse.joplinapp.org/t/rich-text-editor-press-enter-get-two-carriage-returns/12343/7 "2022-03-24T06:25:27Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Unis\_Torvalds](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/unis_torvalds/32/7181_2.png) [@Unis\_Torvalds](https://discourse.joplinapp.org/u/Unis_Torvalds)\
**Post date:** [24 August 2022 18:33 UTC](https://discourse.joplinapp.org/t/rich-text-editor-press-enter-get-two-carriage-returns/12343/8 "2022-08-24T18:33:11Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Daeraxa](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/daeraxa/32/6172_2.png) [@Daeraxa](https://discourse.joplinapp.org/u/Daeraxa)\
**Post date:** [24 August 2022 19:21 UTC](https://discourse.joplinapp.org/t/rich-text-editor-press-enter-get-two-carriage-returns/12343/9 "2022-08-24T19:21:07Z")

</div>

> [@Unis\_Torvalds](#):
>
> 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.

---

<div class="post-metadata">

**Author:** ![Unis\_Torvalds](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/unis_torvalds/32/7181_2.png) [@Unis\_Torvalds](https://discourse.joplinapp.org/u/Unis_Torvalds)\
**Post date:** [24 August 2022 21:41 UTC](https://discourse.joplinapp.org/t/rich-text-editor-press-enter-get-two-carriage-returns/12343/10 "2022-08-24T21:41:55Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![piggle](https://avatars.discourse-cdn.com/v4/letter/p/c2a13f/32.png) [@piggle](https://discourse.joplinapp.org/u/piggle)\
**Post date:** [21 June 2023 06:17 UTC](https://discourse.joplinapp.org/t/rich-text-editor-press-enter-get-two-carriage-returns/12343/11 "2023-06-21T06:17:05Z")

</div>

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;  
}
