-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Convert view to model using positions #4225
Comments
This has a huge 👍 from me. And the order of text conversion and attribute application which you described is an assumption which I made when implementing the new Schema. Its Since I removed the support for fake contexts (which are bad because they are fake so they don't carry all the information) I now need to fully depend on the passed node. Unfortunately, right now the conversion first try to apply the attribute (on a Once the conversion will first insert the text node to the model and then trigger attribute application, this will work perfectly fine with the new Schema. But for now, I need to comment this test out because I can't make it pass easily: PS. This is only one reason why I like the idea to use positions. The other one is – it's just so much easier to think this way ;) |
Feature: Convert view to model using position. Closes #1213. Closes #1250. BREAKING CHANGE: `DataController#parse`, `DataController#toModel`, `ViewConversionDispatcher#convert` gets `SchemaContextDefinition` as a contex instead of `String`. BREAKING CHANGE: `ViewConversionApi#splitToAllowedParent` has been introduced. BREAKING CHANGE: `ViewConversionApi#storage` has been introduced. BREAKING CHANGE: `ViewConsumable` has been merged to `ViewConversionApi`. BREAKING CHANGE: Format od data object passed across conversion callback has been changed. Feature: `Schema#findAllowedParent` has been introduced. Feature: `SchemaContext#concat` has been introduced.
Internal: Simplified autoparagraphing after engine view -> model conversion refactoring. Closes https://github.com/ckeditor/ckeditor5-engine/issues/1213.
Congrats guys! Amazing job :) |
Context: view to model conversion.
Right now converters build nodes which are passed to the parent converters which build parent element with children it gets as an array of elements. There are couple problems with this:
After closing https://github.com/ckeditor/ckeditor5-engine/issues/858 we should try to fix it.
Parent converter should pass to the child converter position which is the conversion context. Child converter should return the range with the converted fragment. Parent converter can execute its action before or after child converters.
Consider an example:
<p><b>foo</b></p>
<p>
converter creates<paragraph>
and pass the position inside it to<b>
converter (<paragraph>^</paragraph>
),<b>
converter callfoo
converter first and pass the position it gets from<p>
converter,foo
converter insert text on the position and returns range with inserted element (<paragraph>[foo]</paragraph>
),<b>
will add attribute to the range.The text was updated successfully, but these errors were encountered: