Skip to content

Commit 06f0fee

Browse files
committed
fix: breaking structured document node import
1 parent a005fea commit 06f0fee

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

packages/super-editor/src/core/super-converter/v2/importer/annotationImporter.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ export const handleAnnotationNode = (params) => {
5454
const allAttrs = { ...attrs, ...marksAsAttrs };
5555
if (!allAttrs.hash) allAttrs.hash = generateDocxRandomId(4);
5656

57-
if (!attrs.fieldId || !attrs.displayLabel) {
57+
// Some w:sdt nodes have attrs.fieldId (coming from GoogleDocs) so we need a secondary check
58+
// Expecting fieldType if its a field annotation
59+
if (!attrs.fieldId || !attrs.fieldType) {
5860
return { nodes: [], consumed: 0 };
5961
}
6062

0 commit comments

Comments
 (0)