Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/super-editor/src/core/DocxZipper.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,9 @@ class DocxZipper {
}

Object.keys(docx.files).forEach((name) => {
if (!name.includes('header') && !name.includes('footer')) return;
// Important: We need to filter out .rels files - they should not be included in content types
// Otherwise this generates MS word validation error
if (name.includes('.rels') || (!name.includes('header') && !name.includes('footer'))) return;
const hasExtensible = types.elements?.some(
(el) => el.name === 'Override' && el.attributes.PartName === `/${name}`,
);
Expand Down
9 changes: 8 additions & 1 deletion packages/super-editor/src/core/super-converter/exporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -1922,6 +1922,13 @@ function translateImageNode(params, imageSize) {
name: 'wp:wrapTopAndBottom',
});
}

// Important: wp:anchor will break if no wrapping is specified. We need to use wrapNone.
if (attrs.isAnchor && !wrapProp.length) {
wrapProp.push({
name: 'wp:wrapNone',
});
}
}

const drawingXmlns = 'http://schemas.openxmlformats.org/drawingml/2006/main';
Expand Down Expand Up @@ -2070,7 +2077,7 @@ function translateImageNode(params, imageSize) {
},
[],
);

return textNode;
}

Expand Down
Loading