plone / blocks-conversion-tool

A tool to convert HTML (as used in Plone Classic) to Blocks (as used on Volto)
7 stars 5 forks source link

Empty spans in lists break editing #20

Closed pbauer closed 1 year ago

pbauer commented 1 year ago

Give a empty span in a list: <ul><li><span>Foo</span><span></span></li></ul>

I get empty spans that can render but fail on editing with Cannot get the end point in the node at path [0] because it has no end text node.:

{
    "@type": "slate",
    "value": [
        {
            "type": "ul",
            "children": [
                {
                    "type": "li",
                    "children": [
                        {
                            "type": "span",
                            "children": [
                                {
                                    "text": "Foo"
                                }
                            ]
                        },
                        {
                            "type": "span",
                            "children": []
                        }
                    ]
                }
            ]
        }
    ],
    "plaintext": "Foo"
}