Thank you for the explanation, @jearle! Iāll bring up the <del>
vs <s>
situation with the devs and see if they have any thoughts. I canāt promise that weāll support importing <del>
after thatā¦ probably depends on what they think of the <ins>
situation. But Iāll let you know as soon as I hear back!
For your use case, it might be good to not only handle the <del>
tag but also have the importer check for any other unsupported tags?
In general though, I should probably clarify something:
HTML and Structured Text are not really meant to be direct equivalents (thatās why there is a HTML field type), and conversions between them will be lossy more often than not. Structured Text is neither a subset nor superset of HTML, but its own thing, that just happens to share some overlap with simpler HTML constructs like paragraphs, headings, etc. Itās kinda like Markdown in that regard; thereās not necessarily a 1:1 equivalence except in the simplest cases.
There are many situations where going from one to the other will result in lossy conversions. Some random examples:
- There are many common HTML tags that it doesnāt support (details, divs, definitions, buttons, forms, etc.). Thatās where the custom handlers come in.
- Structured Text doesnāt support HTML tables, either in import or export
- Embedded blocks or related records inside Structured Text will require you to define how to render them in the frontend, either as React components or raw HTML that you devise
Not saying this to be pedantic, but to clarify that, by design, itās not a 100%-fidelity HTML import or export. Itās its own format meant to encapsulate some basic rich text, yes, but also more complex relationships expressed in a CMS that HTML doesnāt readily handle.
Itās expected that different users will write their own handlers to define the imported schema and output behavior that they want (such as importing into custom blocks and out as custom node renderers).
In your case, during this transition period, it might be helpful to have two fields inside each DatoCMS record: one field can be the āwork in progressā Structured Text that your input converter creates, and another can be the ābackupā raw HTML from your original CMS, just in case there are any other unaccounted-for tags you need to fix in the future.
In any case, thank you again for this clarification, and Iāll let the devs know about the <del>
situation!