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

Inline styling (bold, italic, link) is lost on paste #477

Closed
Reinmar opened this issue Jun 22, 2017 · 3 comments
Closed

Inline styling (bold, italic, link) is lost on paste #477

Reinmar opened this issue Jun 22, 2017 · 3 comments
Assignees
Labels
package:clipboard type:bug This issue reports a buggy (incorrect) behavior.
Milestone

Comments

@Reinmar
Copy link
Member

Reinmar commented Jun 22, 2017

  1. Open http://localhost:8125/ckeditor5-presets/tests/manual/article.html
  2. Copy the entire "Bold Italic Link" line (but do not leave the paragraph).
  3. Paste it somewhere in this sample.

The styling is lost.

It's a regression introduced in 0.10.0.

It's either in the clipboard (handling disallowed content) or in schema rules which we changed then.

@Reinmar Reinmar added candidate:1.0.0 package:clipboard type:bug This issue reports a buggy (incorrect) behavior. labels Jun 22, 2017
@Reinmar Reinmar self-assigned this Jun 22, 2017
@Reinmar Reinmar added this to the iteration 11 milestone Jun 22, 2017
@Reinmar Reinmar changed the title Inline styling (bold, italic, link) are lost on paste Inline styling (bold, italic, link) is lost on paste Jun 22, 2017
@Reinmar
Copy link
Member Author

Reinmar commented Jun 22, 2017

Nooooo... This is the schema again.

The issue was introduced by https://github.com/ckeditor/ckeditor5-basic-styles/issues/40. With this limitation, the content cannot be processed inside $clipboardHolder even though it allows $text inside. It inherits from $root (to allow all that the root allows) but we also allowed text inside. But it's not a $block so it all blows up.

What I'd need to do is to be able to say that $cliboardHolder should allow everything which $root and $block do. Or to tell that a certain attribute is allowed on $text wherever text is allowed. Either way, we need to rewrite Schema (https://github.com/ckeditor/ckeditor5-engine/issues/532).

The only workaround is to specifically allow bold, italic, links, etc in $clipboardHolder. But this is extremely ugly.

@Reinmar
Copy link
Member Author

Reinmar commented Jun 22, 2017

I'll go with the workaround now but it'll mess our code even more and will solve only this specific issue. I think that pasting e.g. a <blockquote>text<b>text</b></blockquote> from some website will still fail because blockQuote doesn't inherit from $block too and I can't hardcode allowing these attributes in the block quotes because it's just plain wrong and have hard to predict results.

Reinmar added a commit to ckeditor/ckeditor5-clipboard that referenced this issue Jun 23, 2017
Reinmar added a commit to ckeditor/ckeditor5-basic-styles that referenced this issue Jun 23, 2017
Reinmar added a commit to ckeditor/ckeditor5-link that referenced this issue Jun 23, 2017
@Reinmar
Copy link
Member Author

Reinmar commented Jun 23, 2017

I pushed commits to 3 repos (listed above). The issue is gone... for a while.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:clipboard type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
Development

No branches or pull requests

1 participant