ianstormtaylor / slate

A completely customizable framework for building rich text editors. (Currently in beta.)
http://slatejs.org
MIT License
29.71k stars 3.24k forks source link

CSS from body is being copied when copying text from slate, even if slate div has css that should override this #1484

Closed stevenwinslowwhite closed 6 years ago

stevenwinslowwhite commented 6 years ago

As reported in slack, when the body has any CSS, this is used when copying text out of slate. See gif of issue. I reproduced it by:

going to http://slatejs.org/#/rich-text Opening inspector, adding red background to body element of the page Copying everything in the editor Pasting into a outlook new email

Actual behavior: Copied with red background which I put on body

Expected behavior: Copied with css only from slate editor (white background).

Conversation here: https://slate-js.slack.com/archives/C1RH7AXSS/p1513711945000264, Jinxuan Zhu seemed to acknowledge that this is a slate bug here: https://slate-js.slack.com/archives/C1RH7AXSS/p1513717102000279

There is a gif of this in slack, I can't seem to upload it here. Feel free to ask questions on slate slack, @steven.white

stevenwinslowwhite commented 6 years ago

@ianstormtaylor do you know the extent of the fix for this? We could probably devote some resources to fixing it if you gave us instructions on where this code is broken. Jinxuan Zhu said on slack:

My mistake. I have just read the code and find slate transfer the dom rather than plain html text…

https://slate-js.slack.com/archives/C1RH7AXSS/p1513717102000279