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

Call normalize after load document. #53

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ulion
Copy link
Contributor

@ulion ulion commented Jan 22, 2021

Sometimes a doc is just broken and need fix. current load document code does not call normalization after load doc. This PR add a force normalization after code load, then call the onChange to prevent from some crash due to invalid doc structure.

But, I am not sure whether this is a common good implement since it fix the doc structure without warning or logging, client code has no chance to involve this. on the other hand, without this change, it probably just crash due to the onChange call finally do some batch before render work in Slate.

So, this is just the my current workaround for broken doc, maybe not a perfect PR for general cases.

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.

None yet

1 participant