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

Single paragraph with different text formatting breaks it into multiple paragraphs while pasting on image #8953

Closed
niegowski opened this issue Jan 29, 2021 · 5 comments · Fixed by #8958
Assignees
Labels
package:engine squad:core Issue to be handled by the Core team. type:bug This issue reports a buggy (incorrect) behavior.

Comments

@niegowski
Copy link
Contributor

📝 Provide detailed reproduction steps (if any)

  1. Set different text formatting on parts of a paragraph
  2. Copy content of the paragraph
  3. Paste over the image

✔️ Expected result

An image is replaced with a single paragraph that looks exactly like the original one.

❌ Actual result

📃 Other details

  • Browser: …
  • OS: …
  • First affected CKEditor version: very old bug
  • Installed CKEditor plugins: …

If you'd like to see this fixed sooner, add a 👍 reaction to this post.

@niegowski niegowski added type:bug This issue reports a buggy (incorrect) behavior. package:clipboard squad:core Issue to be handled by the Core team. labels Jan 29, 2021
@niegowski
Copy link
Contributor Author

I guess it's because of the auto paragraphing. While pasting the model.insertContent() is triggered and it internally calls model.deleteContent( selection, { doNotAutoparagraph: true } ); before inserting new content, new content (text) is not allowed in the root element so auto paragraphing kicks in.

@oleq
Copy link
Member

oleq commented Jan 29, 2021

This is ugly but it does not look like something users would come across in real-life applications. Like how often you paste text on a selected image (or an object? does it reproduce with tables?)? 

Is there any other use-case where this issue could re-appear?

@niegowski
Copy link
Contributor Author

does it reproduce with tables?

Yes, if a table is selected (not the selection inside)

@niegowski
Copy link
Contributor Author

Is there any other use-case where this issue could re-appear?

The same happens if you have some widget selected in the editor and drop some text with formatting from outside the editor

@oleq
Copy link
Member

oleq commented Jan 29, 2021

I guess it's because of the auto paragraphing. While pasting the model.insertContent() is triggered and it internally calls model.deleteContent( selection, { doNotAutoparagraph: true } ); before inserting new content, new content (text) is not allowed in the root element so auto paragraphing kicks in.

I still don't get why the result is chopped so crazy but it's likely because of some internals. Anyway, can you (roughly) estimate how much time would it take to address this?

@niegowski niegowski self-assigned this Jan 29, 2021
@niegowski niegowski added this to the iteration 40 milestone Jan 29, 2021
scofalik added a commit that referenced this issue Feb 2, 2021
Fix (engine): Pasting formatted single-line text over a widget should not split it into multiple paragraphs. Closes #8953.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:engine squad:core Issue to be handled by the Core team. type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants