-
Notifications
You must be signed in to change notification settings - Fork 49
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
Slate transform does not roundtrip when the text uses softbreaks #44
Comments
This issue is most likely related to softbreaks which gets translated into paragraphs. See also accordproject/template-studio-v2#147 |
I think you are correct: https://github.com/accordproject/markdown-transform/blob/master/packages/markdown-slate/src/ToSlateVisitor.js#L235 We may need some metadata on the Slate para to identify it as a "soft break"? |
I'm not sure what is the right way to address this. A couple of possible directions:
As I'm writing it down, I think like option 1. better but it might be more work (since this is a new kind of Slate node to handle in the editor)... There might be other options to handle this that I'm not thinking about. |
Yes, I think I like (1) better as well. E.g. is would allow CTRL-ENTER in the editor to insert a softbreak. FYI, here is what the CommonMark spec says: https://spec.commonmark.org/0.22/#soft-line-breaks |
Yes. That makes sense. @mttrbrts encountered this as well on the HTML side when he looked at pdf rendering, so he may have some thoughts? |
This bug was fixed in #113
|
Describe the bug
Translating from markdown to slate and back sometimes introduces additional new lines.
To Reproduce
For instance on the attached sample.md:
sample.txt
The text was updated successfully, but these errors were encountered: