sanity
sanity copied to clipboard
White spaces not preserved when pasting text into Sanity editor
Describe the bug
When you copy & paste a piece of plain text that contains multiple spaces and indents, the spaces aren't preserved.
To Reproduce
- Set up a Sanity schema for a blog based on any example
- Create a new post
- Copy & paste the following text:
Line breaks
and spaces
should be preserved
Expected behavior
Line breaks and spaces should be preserved as in the above example.
Actual behavior
While line breaks get preserved, all extraneous spaces are removed, resulting in this output:
Line breaks
and spaces
should be preserved
Which versions of Sanity are you using?
@sanity/cli 2.29.5 (up to date)
@sanity/base 2.29.5 (up to date)
@sanity/core 2.29.5 (up to date)
@sanity/default-layout 2.29.5 (up to date)
@sanity/default-login 2.29.5 (up to date)
@sanity/desk-tool 2.29.5 (up to date)
@sanity/eslint-config-studio 2.0.0 (up to date)
@sanity/production-preview 2.29.3 (up to date)
@sanity/vision 2.29.5 (up to date)
What operating system are you using?
OSX Catalina 10.15.7
Which versions of Node.js / npm are you running?
Run npm -v && node -v
in the terminal and copy-paste the result here.
8.1.0
v17.0.1
Additional context
I discovered this problem while building a custom style block for preformatted text. My intention was to support copying/pasting plain text snippets (such as ASCII art or code) into the text editor in order to display them on the blog. Unfortunately, this is impossible due to the way the text editor behaves today, and building a custom paste handler for this seems like overkill.
facing the same problem
facing the same problem as well
Any progress on this? Even sitting on a wired fiber connection, I get disconnected from Sanity so often that I feel like I have to compose in Word. Then when I paste in my content, I have to go back and add spaces. Not cool.