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

#2878 Provide a callback function to allow fixup model before write back #2890

Merged
merged 2 commits into from
Nov 22, 2024

Conversation

JiuqingSong
Copy link
Collaborator

Some feature has requirement that content model should satisfy some format, such as there must be an entity before / after something. We now provide a callback to allow them do those fix up work before write back to editor. To use it:

const editor = new Editor(div, {
 ...
 onFixUpModel: model => {
    ... // fix up model, for example
    model.blocks.push({ ... });
  }
});

@JiuqingSong JiuqingSong merged commit 64eb364 into master Nov 22, 2024
7 checks passed
@JiuqingSong JiuqingSong deleted the u/jisong/2878 branch November 22, 2024 19:11
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.

2 participants