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

Copy from Slate rich text ignores empty lines when pasting in word #5616

Open
jokuni opened this issue Mar 13, 2024 · 0 comments
Open

Copy from Slate rich text ignores empty lines when pasting in word #5616

jokuni opened this issue Mar 13, 2024 · 0 comments
Labels

Comments

@jokuni
Copy link

jokuni commented Mar 13, 2024

Description
When having empty lines within the Slate editor, those empty lines will not be pasted into Microsoft Word.

Image
editor

Slate editor with an empty line

pasted

Upon copy & pasting into word the empty line is missing

Sandbox
https://www.slatejs.org/examples/richtext

Steps
To reproduce the behavior:

  1. Go to https://www.slatejs.org/examples/richtext
  2. Replace "A wise quote." with an empty line without formatting
  3. Copy the whole textbox content
  4. Paste into Microsoft Word
  5. Turn on formatting marks
  6. See that the empty line between "... middle of the page, like this:" and "Try it out for yourself!" was not pasted

Expectation
The empty line should be pasted

Environment

  • Slate Version: latest (0.102.0)
  • Operating System: Tested on macOS, Windows 10
  • Browser: Tested on Safari, Firefox

Context
I tried to fix it locally and it seems to work when removing the data-slate-zero-width="n" data-slate-length="0" attributes from the leaf node but you won't be able to edit the text further afterwards

@jokuni jokuni added the bug label Mar 13, 2024
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

1 participant