Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

markdown-to-draft: multi-line block quotes are squashed when preserveNewlines is true #108

Open
Rosey opened this issue Oct 9, 2019 · 2 comments
Labels

Comments

@Rosey
Copy link
Owner

Rosey commented Oct 9, 2019

See failing test here: 71b848b

Would only be an issue for people using preserveNewlines: true as by default stripping those newlines is correct markdown behaviour.

However, we have a hack around preserving newlines when the option is turned on, and in this case it isn't working correctly. The case being where we have one single block quote with blank lines in between text.

Something like this for draft js should be generated for blank lines -

> test
>
>
>
> hello!

but instead we end up with something like

> test
> hello
@Rosey Rosey added the bug label Oct 9, 2019
@petrmarecek
Copy link

I have the same problem. Is there some solution?

@Rosey
Copy link
Owner Author

Rosey commented Oct 25, 2019

A solution needs to be written, it's a bit tricky but doable. remarkable exposes the number of "lines" as a variable even though it strips them so we'd need to update the parser to read the difference between line numbers and then re-add the newlines in. We do this already with regular paragraphs.

Seems straightforward enough but there are some gotchas that I encountered when I tried to do a hot fix so I put it off until I have more time to think about it properly. If anyone else wants to tackle they can also feel free of course!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants