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

empty list item will crash slate #42

Closed
stefanprobst opened this issue Mar 16, 2021 · 3 comments · Fixed by #43
Closed

empty list item will crash slate #42

stefanprobst opened this issue Mar 16, 2021 · 3 comments · Fixed by #43

Comments

@stefanprobst
Copy link

When converting markdown with an empty list item to slate ast, this will crash slate with "Cannot get the end point in the node at path [9,0] because it has no end text node."

To reproduce

  1. Add an empty list item to the article.md fixture (see here)
  2. npm run storybook and see the crash

Possible solution

I'm not yet very familiar with slate, but it seems that guarding against empty children in convertNodes could work, see here.

Thanks!

@inokawa
Copy link
Owner

inokawa commented Mar 16, 2021

Hi, thank you for the report.

As described here, slate requires at least one Text descendant.
So I think your suggestion works and I'll fix it soon.

@stefanprobst
Copy link
Author

thanks for the super quick fix!

@inokawa
Copy link
Owner

inokawa commented Mar 16, 2021

@stefanprobst
Pubished in 0.3.0. Thanks!

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 a pull request may close this issue.

2 participants