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

Divs should not be converted as <p> #24

Closed tiberiuichim closed 1 year ago

tiberiuichim commented 1 year ago

For a fragment such as <div><h2>hello</h2></div> the result should not be the equivalent of <p><h2>hello</h2></p>.

davisagli commented 1 year ago

@tiberiuichim What are the steps to reproduce? I tried posting this:

{"html": "<div><h2>hello</h2></div>"}

And got this response:

{
    "data": [
        {
            "@type": "slate",
            "value": [
                {
                    "type": "h2",
                    "children": [
                        {
                            "text": "hello"
                        }
                    ]
                }
            ],
            "plaintext": "hello"
        }
    ]
}

Which looks fine.

It's quite possible the div isn't being handled correctly in some specific context, but then we need a complete example to investigate it. I'll close this since we have an example in #27 which shows some related issues with divs.