Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add htmlNormalization event to ClipboardPipeline. #17696

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

Mati365
Copy link
Member

@Mati365 Mati365 commented Dec 27, 2024

Suggested merge commit message (convention)

Feature (clipboard): It's now possible to attach custom HTML serialize functions to clipboard pipeline, just before processing it into view fragment. Closes #17309
Internal (paste-from-office): Use inputHtmlNormalization clipboard event to handle HTML normalization.


Additional information

The ClipboardPipeline is performing some HTML normalization (on string) just before converting it to the view document fragment:

if ( dataTransfer.getData( 'text/html' ) ) {
contentData = normalizeClipboardHtml( dataTransfer.getData( 'text/html' ) );
} else if ( dataTransfer.getData( 'text/plain' ) ) {
contentData = plainTextToHtml( dataTransfer.getData( 'text/plain' ) );
}

~Kuba


⚠️ I'm not pretty sure if this flag is still needed: 79555ac#diff-4b980c1afbffe5148af9316676ffda4ac77a98664dc69fcf7c07ba7726d3c42cR47. It's not fully documented so I kept it in evt.return property.

@Mati365 Mati365 requested review from niegowski and arkflpc December 27, 2024 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant