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 checks don't try to match entire paths #3918

Closed
Reinmar opened this issue Dec 18, 2016 · 1 comment · Fixed by ckeditor/ckeditor5-engine#733
Closed

Schema checks don't try to match entire paths #3918

Reinmar opened this issue Dec 18, 2016 · 1 comment · Fixed by ckeditor/ckeditor5-engine#733
Assignees
Labels
package:engine type:bug This issue reports a buggy (incorrect) behavior.
Milestone

Comments

@Reinmar
Copy link
Member

Reinmar commented Dec 18, 2016

it( 'should return false if given element is allowed in root but not deeper', () => {
	schema.registerItem( 'paragraph', '$block' );

	expect( schema.check( { name: 'paragraph', inside: [ '$root', 'paragraph' ] } ) ).to.be.false;
} );

This test fails because the matching algorithm allow ignoring "inside" items which are not matching items from the paths where the element being checked is allowed. This is fine when the left side is ignored (e.g. so you can do inside: [ 'paragraph' ], without specifying $root), but the right sides should always match.

@Reinmar Reinmar self-assigned this Dec 18, 2016
@Reinmar
Copy link
Member Author

Reinmar commented Dec 18, 2016

While working on this I found quite a lot of tests which do not set the schema correctly. AFAICT now, these are mostly mistakes, some missing schema configurations, so we should be fine. I think that, in practice, this change in schema check algorithm will be ok.

@mlewand mlewand transferred this issue from ckeditor/ckeditor5-engine Oct 9, 2019
@mlewand mlewand added this to the iteration 6 milestone Oct 9, 2019
@mlewand mlewand added status:confirmed type:bug This issue reports a buggy (incorrect) behavior. 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:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants