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

The ClipboardPipeline and PasteFromOffice should allow for common HTML string normalisation before conversion to view #17309

Open
niegowski opened this issue Oct 23, 2024 · 1 comment · May be fixed by #17696
Assignees
Labels
package:clipboard package:paste-from-office status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. support:2 An issue reported by a commercially licensed client. type:feature This issue reports a feature request (an idea for a new functionality or a missing option).

Comments

@niegowski
Copy link
Contributor

📝 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:

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

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.

@niegowski niegowski added the type:feature This issue reports a feature request (an idea for a new functionality or a missing option). label Oct 23, 2024
@aldonace-wu aldonace-wu added the support:2 An issue reported by a commercially licensed client. label Oct 23, 2024
@scotteuser
Copy link

I'm thinking this is probably why in our Drupal Footnotes module when trying to update data.content in the input transformation step like this:

  • LibreOffice paste: works fine
  • Word paste: has no effect.

Does that sound right? Or I am misunderstanding the suggested feature here? (Sorry not too experienced with CKE code)

For now the only way we can get this to update the editor is to use the writer and stop the event this like but this stops other plugins from kicking in and doing their thing (like setting anchors, stripping gunk from word).

@Mati365 Mati365 self-assigned this Dec 24, 2024
@Mati365 Mati365 linked a pull request Dec 27, 2024 that will close this issue
@CKEditorBot CKEditorBot added the status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. label Dec 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:clipboard package:paste-from-office status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. support:2 An issue reported by a commercially licensed client. type:feature This issue reports a feature request (an idea for a new functionality or a missing option).
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants