Skip to content

[bug]Empty text nodes are not allowed #216

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

Closed
jerrycompal opened this issue May 29, 2023 · 0 comments · Fixed by #229
Closed

[bug]Empty text nodes are not allowed #216

jerrycompal opened this issue May 29, 2023 · 0 comments · Fixed by #229
Assignees
Labels
bug Something isn't working

Comments

@jerrycompal
Copy link

jerrycompal commented May 29, 2023

I encountered an error when reloading saved JSON data after using shift+enter to insert a line break in the text.

Error prompt: Empty text nodes are not allowed.

The input I entered was: Test Report 2023-05-30 (use shift+enter to line break after the date)
An additional {"type":"text","text":"","styles":{}} was included, which caused the JSON to fail to load.

Here is the JSON data I received:

[{"id":"b1250752-20c3-487b-b6ce-70fbbda51673","type":"heading","props":{"textColor":"default","backgroundColor":"blue","textAlignment":"center","level":"2"},"content":[{"type":"text","text":"Test Report","styles":{}},{"type":"text","text":"","styles":{}},{"type":"text","text":"2023-05-30","styles":{}}],"children":[]},{"id":"9d682c8e-d27f-4e26-ac8a-021d852b9969","type":"paragraph","props":{"textColor":"default","backgroundColor":"default","textAlignment":"left"},"content":[],"children":[]}]

// Add a '\n' in the text {"type":"text","text":"\n","styles":{}} , it works fine .

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

Successfully merging a pull request may close this issue.

3 participants