Skip to content
This repository has been archived by the owner on Oct 25, 2022. It is now read-only.

Compress Slate values before saving #147

Open
tiberiuichim opened this issue Sep 6, 2021 · 0 comments
Open

Compress Slate values before saving #147

tiberiuichim opened this issue Sep 6, 2021 · 0 comments

Comments

@tiberiuichim
Copy link
Member

I propose that we do a denormalization on save and a normalization on "load" of values. The normalization algoritm is the one in this function:

const normalizeToSlate = (editor, nodes) => {

The denormalization algorithm would be the "reverse" algorithm, it would remove the empty {text: ''} placeholders so that the JSON value is compressed before save. These placeholder nodes only make sense for SlateJS internals, they shouldn't have been exposed "to the world".

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

No branches or pull requests

1 participant