-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Implement rename operation #3675
Comments
The problem is implementing such delta using existing operations will break the reference to the element. Now we can insert, move children, set attributes and remove, so if user keep the reference to the object he will still have original object, but in graveyard. We could implement new operation type which simply change the tag name, what seems to be the cleanest solution. But them the change is deeper, beside OT for operations, converters have to handle new change type. |
Couldn't the dispatcher trigger rename operation as insert+move+remove? |
Yes, this is the handling I was thinking about. |
OK, another argument for doing this as an operation is live position. If I have a live position inside a an element that I'm renaming it may end up in a graveyard rather than in the new element. |
I'll implement the first part of this ticket in ckeditor/ckeditor5-engine#368. |
Renaming appears to be more tricky than I thought. We have to consider few things if go with We could "close" the case right in The drawback is that if big element gets changed or many element get changed, we re-render a lot of stuff. There is also a problem with any embeded content, like MathJax or anything we use iframes for, because they will be reloaded. So next idea was to do Another idea was to implement Another problem is schema corectness. Model has to be always correct according to schema. So I propose that
So that would sum up some problems with rename operation. I think that I will try to come up with an approach that does not re-render children of renamed element. It will be probably some variation of solution with |
This has been resolvedi n ckeditor/ckeditor5-engine#584 by introducing |
BTW, OT for the delta will be added in a separate issue ckeditor/ckeditor5-engine#582. |
Renaming is already handled by |
Needed for cases like:
It could be done in two steps:
Cons:
Pros:
The text was updated successfully, but these errors were encountered: