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

Schema should skip checking attributes stored by DocumentSelection #4176

Closed
scofalik opened this issue Sep 6, 2017 · 0 comments · Fixed by ckeditor/ckeditor5-engine#1128
Closed
Assignees
Labels
package:engine type:improvement This issue reports a possible enhancement of an existing feature.
Milestone

Comments

@scofalik
Copy link
Contributor

scofalik commented Sep 6, 2017

As we all know, Schema is not perfect.

There's no use doing big changes or refactoring if we plan to write it from scratch and we haven't really make any decision how it will look.

However, there is one improvement needed right one. If DocumentSelection stores an attribute in an element, that element will not be allowed anywhere, unless we explicitly call Schema.allow().

This is a problem, because a paragraph element with selection:bold attribute is suddenly not allowed in blockquote.

To make it all more managable, the skip would only be implemented in "allow" part of algorithm. That is, you won't have to write things like

schema.allow( { name: '$block', attributes: [ 'selection:bold' ], inside: 'blockquote' } )

but you will be able to do

schema.disallow( { name: '$block', attributes: [ 'selection:bold' ], inside: 'blockquote' } );

It is better and easier to disallow one specific thing than writing all allow rules that would grow bigger with every added feature.

@scofalik scofalik self-assigned this Sep 6, 2017
Reinmar referenced this issue in ckeditor/ckeditor5-engine Sep 6, 2017
Fix: Fixed a bug when a block quote could not be applied to an empty paragraph with a basic style (bold, etc.) active in it. Closes #1127.
@mlewand mlewand transferred this issue from ckeditor/ckeditor5-engine Oct 9, 2019
@mlewand mlewand added this to the iteration 12 milestone Oct 9, 2019
@mlewand mlewand added module:model type:improvement This issue reports a possible enhancement of an existing feature. package:engine labels Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:engine type:improvement This issue reports a possible enhancement of an existing feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants