react-markdown-editor-lite icon indicating copy to clipboard operation
react-markdown-editor-lite copied to clipboard

[BUG] Keyboard Enter doesn't take to new line in preview mode

Open punithbm opened this issue 3 years ago • 1 comments

When I try to press enter to insert a new line under MD editor it doesn't go to a new line in the preview. If the user presses keyboard enter twice then it's taking to a new line. Please find the attached video. Also, let me know if there is any walkaround or any solution to address this.

https://user-images.githubusercontent.com/13044958/163978835-84c06df3-d50f-4890-b911-1c915b9e21ad.mp4

punithbm avatar Apr 19 '22 09:04 punithbm

For markdown, you need 2 spaces at the end of a line to indicate a new line. In the editor type this, button presses indicated in []:

Line one[space bar][space bar][enter] Line two

That's actually a markdown thing, not specific to this package. https://www.markdownguide.org/basic-syntax/#line-breaks

Because seeing those whitespaces can be problematic, I typically use HTML <br />, but that's up to you. Hope that helps :)

SonicMagna avatar Aug 10 '22 15:08 SonicMagna