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

#2855 Add a parameter for formatContentModel to allow auto detection of new/removed entities #2887

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JiuqingSong
Copy link
Collaborator

Now we can let editor (EntityPlugin) to auto detect changed entity (added, removed) during formatContentModel.

To do this, set context.autoDetectChangedEntities to be true:

editor.formatContentModel((model, context)=>{
 ... // add or remove entities
 context.autoDetectChangedEntities = true;

 return true;
});

Then there will be code to search all changed entities and trigger entityOperation event for each of them.

But if possible, you can still use context.newEntities and context.deletedEntities to manually specify changed entities since they have better performance. Once autoDetectChangedEntities is set to true, context.newEntities and context.deletedEntities will be ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant