-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Labels
package:clipboardpackage:paste-from-officestatus:in-progressSet automatically when an issue lands in the "In progress" column. We are working on it.Set automatically when an issue lands in the "In progress" column. We are working on it.support:2An issue reported by a commercially licensed client.An issue reported by a commercially licensed client.type:featureThis issue reports a feature request (an idea for a new functionality or a missing option).This issue reports a feature request (an idea for a new functionality or a missing option).
Description
📝 Provide a description of the new feature
The ClipboardPipeline is performing some HTML normalization (on string) just before converting it to the view document fragment:
ckeditor5/packages/ckeditor5-clipboard/src/clipboardpipeline.ts
Lines 229 to 233 in d874050
| if ( dataTransfer.getData( 'text/html' ) ) { | |
| contentData = normalizeClipboardHtml( dataTransfer.getData( 'text/html' ) ); | |
| } else if ( dataTransfer.getData( 'text/plain' ) ) { | |
| contentData = plainTextToHtml( dataTransfer.getData( 'text/plain' ) ); | |
| } |
- There is no easy extension point to add additional normalizers.
- The
PasteFromOfficeis ignoring the prepared view document fragment and is performing a separate normalization on the data transfer payload:
const htmlString = data.dataTransfer.getData( 'text/html' );
data._parsedData = parseHtml( htmlString, viewDocument.stylesProcessor );
Those cases could be unified as an extension point in the ClipboardPipeline so non-parsed data could be processed before conversion to the view document fragment.
If you'd like to see this feature implemented, add a 👍 reaction to this post.
jbalinski, scotteuser, dalin-, olstjos and lkmorlan
Metadata
Metadata
Assignees
Labels
package:clipboardpackage:paste-from-officestatus:in-progressSet automatically when an issue lands in the "In progress" column. We are working on it.Set automatically when an issue lands in the "In progress" column. We are working on it.support:2An issue reported by a commercially licensed client.An issue reported by a commercially licensed client.type:featureThis issue reports a feature request (an idea for a new functionality or a missing option).This issue reports a feature request (an idea for a new functionality or a missing option).