-
-
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
7336: ConversionAPI update #7652
Conversation
…of the `conversionApi.convertChildren()`.
# Conflicts: # packages/ckeditor5-engine/src/conversion/upcasthelpers.js
// Otherwise continue conversion after the last list item. | ||
data.modelCursor = data.modelRange.end; | ||
} | ||
conversionApi.updateConversionResult( listItem, data ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check if modelCursor can be cached before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't make it work without full copy-pate of the updateConversionResult()
so 🤷♂️ dunno we might live with that if()
inside it.
@niegowski Please make a review for this PR. We've looked at this with @Reinmar and the whole idea and change looks OK. A conversation on a solution starts here: #7336 (comment). |
@Reinmar I've updated the conversion deep-dive guide if you wish to check it - if not please just mark this PR as ✔️ to not block @niegowski with eventual merge. |
...ages/ckeditor5-engine/docs/_snippets/framework/extending-content-custom-element-converter.js
Show resolved
Hide resolved
@Reinmar as @niegowski is off today:
So IMO it is good to merge. |
I scanned all the code and I now work on the guide. I want to extend it a bit with some more context. But I may be stuck for a while on how to incorporate it into the existing guides. If you'll see that it may cause problems with maintaining this branch if it takes me 1-2 days, I can merge it as it is. |
I'd go with a follow-up as it is only a guide update. |
I pushed guide improvements. Could you scan them, @jodator? |
OK, that's all for my review. I pushed some more changes to the API docs. Please take a look at them and if I didn't make some bigger mistakes, you can merge this PR. |
Co-authored-by: Kuba Niegowski <1232187+niegowski@users.noreply.github.com>
@Reinmar - nice update :) and @niegowski good catch with that typo. As from me the PR is OK now, so you can merge. |
Suggested merge commit message (convention)
Feature (engine): Introduced new upcast
ConversionApi
helper methods -conversionApi.safeInsert()
andconversionApi.updateConversionResult()
. New methods are intended to simplify writing event based element-to-element converters. Closes #7336.MAJOR BREAKING CHANGE (engine): The
config.view
parameter for upcast element-to-element conversion helpers configurations is again mandatory. You can retain previous "catch-all" behavior for upcast converter usingconfig.view = /[\s\S]+/
.Additional information
In addition to changes described previously under the ticket (#7336 (comment)):
modelRange
if it was defined already (we might skip that change).tests are still to be written (as the previous point might change implementation).donegetSplitParts()
andsplitToAllowedParent()
are not used anymore - might be dropped.TODO:
getSplitParts()
andsplitToAllowedParent()
are not used anymore - might be dropped - let's keep it for a while.modelRange
is to be preserved (I couldn't find another way for that).