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

Link conversion #7

Closed ionlizarazu closed 2 years ago

ionlizarazu commented 2 years ago

Volto configuration:

Converter:

HTML content:

<p><a href="https://plone.org" target="_blank" rel="noopener noreferrer">Converted link.</a></p>

I get the following JSON result and volto-slate does not render any link:

"43c7fb68-d334-40ab-99f3-e5dc5c569c23": {
        "@type": "slate",
        "plaintext": "Converted link.",
        "value": [{
            "children": [{
                "children": [{
                    "text": "Converted link."
                }],
                "data": {
                    "target": "_blank",
                    "title": null,
                    "url": "https://plone.org"
                },
                "type": "link"
            }],
            "type": "p"
        }]
    }

If I add a new external link with volto-slate editor, the generated JSON is this:

"d67f2b93-8e9f-4760-b08e-35579e4a0802": {
        "@type": "slate",
        "value": [{
            "type": "p",
            "children": [{
                "text": ""
            }, {
                "type": "a",
                "data": {
                    "link": {
                        "external": {
                            "external_link": "https://plone.org",
                            "target": "_blank"
                        }
                    }
                },
                "children": [{
                    "text": "Manually added."
                }]
            }, {
                "text": ""
            }]
        }],
        "plaintext": " Manually added. "
    }

As you can see, what my volto-slate expects as a link is quite different. Have I a wrong volto-slate configuration or am I doing a incorrect request?

ionlizarazu commented 2 years ago

I've tested with "volto-slate:minimalDefault,simpleLink,tableButton" configuration after @sneridagh suggestion and it works. Rendering and editing part are OK.

This should be reflected in the README