Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/docx-io-nested-inline-formatting.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@platejs/docx-io": patch
---

Fix DOCX export losing marks on text that carries several marks (for example bold and italic) and leaking a mark onto the text that follows it
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,20 @@ describe('docx roundtrip', () => {

expect(roundtrippedNodes.length).toBeGreaterThan(0);
});

it('keeps every mark of a leaf that carries several marks', async () => {
const editor = createTestEditor();
const nodes: TNode[] = [
{
children: [{ bold: true, italic: true, text: 'bold italic' }],
type: 'p',
},
];
const roundtrippedNodes = await importDocxBuffer(
editor,
await exportNodesToDocx(nodes)
);

expect(roundtrippedNodes).toEqual(nodes);
});
});
Loading
Loading