Skip to content

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.

1 participant