Pasted copy with carriage returns doesn't render the carriage returns
See original GitHub issuebug
What’s the current behavior?
When pasting existing copy with solo carriage returns \r
these aren’t rendered by SlateJS
Given This has a different new line\r\r\r\rThis is the final line.
in the clipboard when pasting into Slate no lines are rendered as shown below.
SlateJS vs Draft JS
What’s the expected behavior?
That the carriage returns are correctly rendered as shown in Draft JS
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (6 by maintainers)
Top Results From Across the Web
Paste as plain text, but also remove any new-line and carriage ...
This strips of all new line characters or carriage returns and works perfectly. However, I need a faster way of doing thihs. ***PureText...
Read more >copy paste loses formatting - Carriage returns are removed ...
When I reply to email, the original message is indented and a blue bar is down the left margin.
Read more >Why is vim stripping the carriage return when I copy a line to ...
When I yank a line that contains a carriage return and paste it into another file, the pasted line does not contain the...
Read more >What is the purpose of "paste newlines as carriage returns" in ...
My understanding is that since many yeas ago Unix and MacOS line endings have become identical and thus there is no room for...
Read more >Reader Question: Getting rid of hard line breaks in pasted text
I quite often copy and paste text from Adobe Acrobat documents rather than retype it, but by far the biggest hassle is having...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Developers can write custom deserializer rules in their paste handlers that convert ‘\r’ to newline at least as a work around.
It looks like this issue is also occurring with plain text with normal
\n
newlines in 0.57.1.I opened a PR to fix both styles of newlines: https://github.com/ianstormtaylor/slate/pull/3472