Preserve QWord strikethrough formatting

This commit is contained in:
Курнат Андрей
2026-06-01 07:14:24 +03:00
parent 5a968dea72
commit ea26f5c55d
5 changed files with 63 additions and 3 deletions
+17
View File
@@ -74,4 +74,21 @@ describe("wordOffice DOCX import", () => {
}
]);
});
it("imports DOCX strikethrough from OOXML", async () => {
const blob = await exportDocxBlob("Strike.docx", "<p><s>Deleted text</s></p>");
const file = new File([blob], "Strike.docx", {
type: "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
});
const imported = await importDocxFile(file);
expect(imported.html).toContain("<s>Deleted text</s>");
expect(htmlToWordBlocks(imported.html)).toEqual([
{
type: "paragraph",
text: "Deleted text",
runs: [{ text: "Deleted text", strike: true }]
}
]);
});
});