Preserve QWord DOCX font size
This commit is contained in:
@@ -40,4 +40,21 @@ describe("wordOffice DOCX import", () => {
|
||||
{ type: "paragraph", text: "Justified", runs: [{ text: "Justified" }], alignment: "both" }
|
||||
]);
|
||||
});
|
||||
|
||||
it("imports DOCX font size from OOXML", async () => {
|
||||
const blob = await exportDocxBlob("FontSize.docx", '<p><span style="font-size: 18pt;">Large text</span></p>');
|
||||
const file = new File([blob], "FontSize.docx", {
|
||||
type: "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
|
||||
});
|
||||
const imported = await importDocxFile(file);
|
||||
|
||||
expect(imported.html).toContain("font-size: 18pt;");
|
||||
expect(htmlToWordBlocks(imported.html)).toEqual([
|
||||
{
|
||||
type: "paragraph",
|
||||
text: "Large text",
|
||||
runs: [{ text: "Large text", fontSize: 18 }]
|
||||
}
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user