slate
slate copied to clipboard
Copy/Paste multiple lines adding more blank lines in between
Description I implemented a slate editor using slate-react. I want to copy multiple lines at a time and paste into another editor like notepad. But it is adding more lines between slate nodes. There are no empty nodes or line breaks between the text nodes. Please check the video.
Recording
https://user-images.githubusercontent.com/24267163/216007739-add79dd1-23f7-4f19-8b99-fda9a35c748e.mp4
Expectation There should not be extra brank lines.
Environment
- Slate Version: 0.81.1
- slate-react: 0.81.0
- Operating System: windows 11
- Browser: Chrome, Safari, mozilla
Looks like if you nested more html tags in the element it will copy with extra lines:
<div>
<p style={style} {...attributes}>
{children}
</p>
</div>
Like this copy without the extra lines:
<p style={style} {...attributes}>
{children}
</p>
CodeSandbox https://codesandbox.io/s/bug-copy-and-paste-fqrsld?file=/src/App.js