-
Notifications
You must be signed in to change notification settings - Fork 101
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
Blank Lines Cannot Get Copied and Pasted #269
Comments
@irmerk @jeromesimeon is this because markdown doesn't preserve white space? |
It's my understanding that if a user were able to save this document and reopen it, any white space like line breaks would be removed when the document is reopened |
I am not sure. This could be an artefact of markdown (there is no way to create random space between paragraphs), or a bug in copy paste. This might need investigation. |
@jeromesimeon I think it was probably because of how the line was being created. I did some tests and now it works fine. |
We'll need to do a thorough investigation on all of this to see what is going on, the limitations, and what these changes do. |
Copy/paste uses the Slate <--> CiceroMark <--> HTML transformation, so it is likely that markdown insignificant whitespace is getting dropped. Perhaps we can be smarter at representing blank paras when we convert from Slate to CiceroMark? |
Using this input Slate document:
And running:
The following HTML is produced:
Showing that the Slate paragraph containing an empty text node got removed during the transformation from Slate to |
@dselman What should be the proper solution to this? I didn't pay much attention to this problem and kind of tinkered here and there with few things until it worked. |
This line removes empty paragraphs when converting from Slate to CiceroMark: While this handles the conversion from CiceroMark to Slate: CiceroMark whitespace handling should be consistent with markdown (i.e. whitespace is not significant), however you can force a hard line break in markdown using
So, one approach would be to replace empty paragraphs in the Slate DOM with hard line breaks in the CiceroMark DOM (and vice-a-versa, to preserve roundtripping). |
@dselman that sounds like something that needs to come from |
Agreed. I will move the discussion to this issue: accordproject/markdown-transform#362 |
Bug Report 🐛
When we copy a block of text from one place to another, the text is copied properly but the blank lines between them are not getting copied. This makes formatting more annoying.
Expected Behavior
Current Behavior
Possible Solution
Steps to Reproduce
Context (Environment)
Desktop
Detailed Description
Possible Implementation
The text was updated successfully, but these errors were encountered: