fix(client): return an empty string for empty sections
This commit is contained in:
@ -62,7 +62,12 @@ function textToData(sectionIds) {
|
||||
}
|
||||
}
|
||||
});
|
||||
const textArray = toHTML({ ...node, children: newChildren });
|
||||
const hasData = newChildren.some(
|
||||
node => node.type !== 'text' || !/^\s*$/.test(node.value)
|
||||
);
|
||||
const textArray = hasData
|
||||
? toHTML({ ...node, children: newChildren })
|
||||
: '';
|
||||
file.data = {
|
||||
...file.data,
|
||||
[sectionId]: textArray
|
||||
|
Reference in New Issue
Block a user