Preserve QWord quote style in DOCX

This commit is contained in:
Курнат Андрей
2026-06-02 06:49:30 +03:00
parent c75efaa766
commit 68e0678ca6
4 changed files with 60 additions and 9 deletions
+16
View File
@@ -22,6 +22,22 @@ describe("wordOffice DOCX import", () => {
]);
});
it("imports DOCX Quote style as blockquote", async () => {
const blob = await exportDocxBlob("Quote.docx", "<blockquote>Quoted fragment</blockquote>");
const file = new File([blob], "Quote.docx", { type: "application/vnd.openxmlformats-officedocument.wordprocessingml.document" });
const imported = await importDocxFile(file);
expect(imported.html).toContain("<blockquote>Quoted fragment</blockquote>");
expect(htmlToWordBlocks(imported.html)).toEqual([
{
type: "paragraph",
text: "Quoted fragment",
runs: [{ text: "Quoted fragment" }],
quote: true
}
]);
});
it("imports DOCX text color and highlight from OOXML", async () => {
const blob = await exportDocxBlob(
"Color.docx",