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

Editor value is not preserved after serializing to HTML #1474

Closed
LaurelOlson opened this issue Apr 5, 2022 · 1 comment · Fixed by #1633
Closed

Editor value is not preserved after serializing to HTML #1474

LaurelOlson opened this issue Apr 5, 2022 · 1 comment · Fixed by #1633
Labels
bug Something isn't working plugin:serialize-html

Comments

@LaurelOlson
Copy link

Description

The following elements are not preserved when serializing editor state into HTML and then back into editor state:

  • new lines in blockquotes
  • new lines in codeblocks
  • mentions

Steps

To reproduce:

  • enter a multi-line blockquote and/or codeblock into sandbox along with a mention
  • click "serialize"
  • see the (1) serialized HTML and the (2) serialized HTML deserialized back into editor state

Sandbox

https://codesandbox.io/s/plate-playground-forked-rwfznn

Expectation

The editor value should be preserved when serialized to HTML and then deserialized back into editor state.

Environment

  • slate: 0.76
  • slate-react: 0.76
  • browser: chrome
@LaurelOlson LaurelOlson added the bug Something isn't working label Apr 5, 2022
@LaurelOlson
Copy link
Author

update: newlines in blockquotes are preserved if stripWhitespace: false is passed to serializeHtml and deserializeHtml (codesandbox updated). Newlines in code blocks and mentions are still not serialized properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working plugin:serialize-html
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants