Support QWord Heading 3 DOCX roundtrip

This commit is contained in:
Курнат Андрей
2026-06-02 06:37:49 +03:00
parent c4fd683ef3
commit 1c03ec168c
5 changed files with 46 additions and 6 deletions
+9
View File
@@ -5,6 +5,15 @@ const tinyPngBase64 = "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42
const tinyPngDataUri = `data:image/png;base64,${tinyPngBase64}`;
describe("wordOffice DOCX import", () => {
it("imports DOCX Heading 3 as h3", async () => {
const blob = await exportDocxBlob("Heading3.docx", "<h3>Quality gate</h3>");
const file = new File([blob], "Heading3.docx", { type: "application/vnd.openxmlformats-officedocument.wordprocessingml.document" });
const imported = await importDocxFile(file);
expect(imported.html).toContain("<h3>Quality gate</h3>");
expect(htmlToWordBlocks(imported.html)).toEqual([{ type: "heading", level: 3, text: "Quality gate", runs: [{ text: "Quality gate" }] }]);
});
it("imports DOCX text color and highlight from OOXML", async () => {
const blob = await exportDocxBlob(
"Color.docx",