Support QWord Heading 3 DOCX roundtrip
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user