draft-js-import-markdown icon indicating copy to clipboard operation
draft-js-import-markdown copied to clipboard

Multiple new lines not processing

Open jxodwyer opened this issue 8 years ago • 2 comments

Whenever there are multiple new lines together they seem to be removed after being processed through this module. Here is a link to a project I pieced together showing an example of this bug: https://github.com/jxodwyer/draft-js-markdown-example specifically: https://github.com/jxodwyer/draft-js-markdown-example/blob/master/scripts/App.js

I've also attached a screenshot to show this:

screen shot 2016-07-08 at 11 36 51 am

jxodwyer avatar Jul 08 '16 15:07 jxodwyer

Note: this is also reproducible on https://react-rte.org/demo.

From the Markdown spec on handling paragraphs, two spaces and a newline should create a line break:

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

Below I add valid markdown with 5 space-space-newlines to the demo. The resulting editor content, however, has no new line characters or line breaks (it removes the new lines and creates 2 blocks):

This means that

stateToMarkdown(stateFromMarkdown(markdown)) != markdown

Happy to help in any way I can.

rickhanlonii avatar Jul 08 '16 22:07 rickhanlonii

seeing same issue, any updates on not removing extra lines?

novito avatar May 16 '19 19:05 novito