Ionaru / easy-markdown-editor

EasyMDE: A simple, beautiful, and embeddable JavaScript Markdown editor. Delightful editing for beginners and experts alike. Features built-in autosaving and spell checking.
https://stackblitz.com/edit/easymde
MIT License
2.41k stars 316 forks source link

2 spaces after hitting enter #500

Closed netz0 closed 2 years ago

netz0 commented 2 years ago

Is it possible to automatically add double spaces after hitting enter for less savvy MD users to have a new line automatically created?

Using pure Markdown most people write like this:

Thanks, Joe

Which in pure markdown outputs: Thanks, Joe

Is there a setting to force a new line or automatically add double spaces after a new line is created?

Ionaru commented 2 years ago

The editor already handles this correctly (using marked), you might need to tweak the markdown renderer you are using.

image

netz0 commented 2 years ago

Hi, the rendering side is actually handling the data as strict markdown hence I was asking if this could be forced on the editor side while typing before submission. I can't currently change the rendering side MD flavor and it's using the standard format, which is actually correct, you need two spaces to create a new line. The preview you attached it's not actually sending the data as such. If you look the source code in the browser, it's not adding a new line, it's only a visual PRE HTML trick from Codemirror to make it look like a new line but it's not adding the correct markdown syntax for a new line, hence data submitted is considered a single line. I know most are using GitHub format, but this seems an issue for anyone using strict markdown.

netz0 commented 2 years ago

Found issue on rendering side. Thanks