You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current implementation filters blocks, styles, entities by type. What formats it preserves (or how well it does that) depends a lot on the specific browser + OS + copy source being used. I've done lots of testing, and started collecting unfiltered ContentStates to be able to review and unit test this further.
First test run
Editor - Browser
Chrome Windows
Chrome macOS
Firefox Windows
Firefox macOS
Edge Windows
IE11 Windows
Safari macOS
Safari iOS
Chrome Android
Word 2016
iOS11
Word 2013
N/A
N/A
N/A
N/A
N/A
Word 2010
v62, Win8.1
N/A
v57, Win8.1
N/A
Win8.1
N/A
N/A
N/A
Apple Pages
N/A
v62, macOS10.13
N/A
v62, macOS10.13
N/A
N/A
v11, macOS10.13
iOS11
N/A
Google Docs
v62, Win8.1
v62, macOS10.13
v57, Win8.1
v62, macOS10.13
v16, Win10
Win8.1
v11, macOS10.13
iOS11
Word Online
v62, Win8.1
v62, macOS10.13
v57, Win8.1
v62, macOS10.13
v16, Win10
Unsupported
v11, macOS10.13
No paste
?
Dropbox Paper
v62, Win8.1
v62, macOS10.13
v57, Win8.1
v62, macOS10.13
v16, Win10
Unsupported
v11, macOS10.13
iOS11
?
Next steps
Based on a quick review,
Drop line breaks
Drop unneeded entity data
Drop images based on criteria to be defined (data: URLs should be dropped, file: URLs should be dropped, potentially more).
Here are my detailed findings after reviewing the "Word 2010 on Chrome in Windows"
Special attention:
Preserves line breaks
Link entities have both href (source?) and url (added by Draft.js) attributes
Link target ("frame" in Word): no attribute for this
Bulleted list: unstyled preceded with small middot bullet
Nested bulleted list (1): unstyled preceded with medium empty circle bullet
Nested bulleted list (2): unstyled preceded with special symbol
Numbered list: unstyled preceded with (correct) count / letter (1., 2., a. for 1-level nesting)
Star list: image with * in alt, and src set to local file
Incorrectly retained
Outline: retained as bold
Double strikethrough: retained as strikethrough
Empty unstyled block inserted at the top
Internal document link saved as link anchor in href attribute, and added by Draft.js at the end of url to point at the current page
eg. href: '#_Inline_styles'
Comment reference text saved as [T.C1] (user initials)
Comment saved as both link anchor in href attributes with special text on comment location, and end-of-document comment body with other special link anchor in href
eg. href: '#_msocom_1' for ref, href: '#_msoanchor_1' for body
Image retained with height and width attributes (string repr of number)
Image src is a file:/// protocol URL
The text was updated successfully, but these errors were encountered:
See https://github.com/thibaudcolas/draftjs-paste for current progress. The test suite is going to be tens of MBs of JSON, and this isn't really related to Draftail, so I'm considering making a separate package.
Follow-up to #50, #9.
The current implementation filters blocks, styles, entities by type. What formats it preserves (or how well it does that) depends a lot on the specific browser + OS + copy source being used. I've done lots of testing, and started collecting unfiltered
ContentState
s to be able to review and unit test this further.First test run
Next steps
Based on a quick review,
data:
URLs should be dropped,file:
URLs should be dropped, potentially more).Here are my detailed findings after reviewing the "Word 2010 on Chrome in Windows"
Special attention:
href
(source?) andurl
(added by Draft.js) attributesCorrectly retained
title
attributeNot retained
1.
,2.
,a.
for 1-level nesting)*
in alt, andsrc
set to local fileIncorrectly retained
href
attribute, and added by Draft.js at the end ofurl
to point at the current pagehref: '#_Inline_styles'
[T.C1]
(user initials)href
attributes with special text on comment location, and end-of-document comment body with other special link anchor inhref
href: '#_msocom_1'
for ref,href: '#_msoanchor_1'
for bodyheight
andwidth
attributes (string repr of number)file:///
protocol URLThe text was updated successfully, but these errors were encountered: