Skip to content

Markdown Empty List Deserialization Error #4485

@davidgolden

Description

@davidgolden

Description

Deserializing an initial markdown value of

foo

*

bar

generates the Slate value of

[
{type: "p", children: [{text: "foo"}]},
{type: "ul", children: [{type: "li", children: []}]},
{type: "p", children: [{text: "bar"}]}
]

When editor receives focus, TypeError: point is undefined is thrown.

Somewhere in the deserialization process, Plate is not handling a list item with no content.

I believe the correct Slate value should be

[
{type: "p", children: [{text: "foo"}]},
{type: "ul", children: [{type: "li", children: [{type: "lic", children: []}]}]},
{type: "p", children: [{text: "bar"}]}
]

Reproduction URL

No response

Reproduction steps

1. Create a Plate editor with MarkdownPlugin and initial value from above.
2. Place focus in editor

Plate version

48.0.2 (@udecode/plate-markdown)

Slate React version

0.114.2

Screenshots

Logs

Browsers

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions