chore: super conversion wrap nodes in paragraph if requires parent

This commit is contained in:
Aman Harwara
2023-09-06 15:54:25 +05:30
parent 59130e8d85
commit 8d42e8bde3

View File

@@ -111,7 +111,13 @@ export class HeadlessSuperConverter implements SuperConverterServiceInterface {
// Wrap text & link nodes with paragraph since they can't
// be top-level nodes in Super
if (type === 'text' || type === 'link' || type === 'unencrypted-image' || type === 'inline-file') {
if (
type === 'text' ||
type === 'link' ||
type === 'unencrypted-image' ||
type === 'inline-file' ||
node.isParentRequired()
) {
const paragraphNode = $createParagraphNode()
paragraphNode.append(node)
nodesToInsert.push(paragraphNode)