#4268·slate

Paste HTML adds several blank lines and positions the caret in the wrong spot

Author: itsameandreaCreated May 19, 2021Updated Apr 2, 2026
Labelsbugexamples

Description I was adding slate to a CMS when I noticed that pasting rich text content would add blank lines above and below the content and would position the caret in the wrong spot. I copied the code from the "Paste HTML" example

Recording PaZXSFUUqj

Sandbox https://www.slatejs.org/examples/paste-html

Steps To reproduce the behavior:

  1. Go to here
  2. Paste rich text content as shown in the GIF

Expectation I would expect to have the caret at the end of the pasted content without any additional blank line

Environment

  • Slate Version: 0.62
  • Operating System: Mac OS
  • Browser: Chrome