diff --git a/ts/docx/paragraph/index.ts b/ts/docx/paragraph/index.ts index 66449451ee..de48cd7115 100644 --- a/ts/docx/paragraph/index.ts +++ b/ts/docx/paragraph/index.ts @@ -103,7 +103,7 @@ export class Paragraph extends XmlComponent { } public pageBreak(): Paragraph { - this.properties.push(new PageBreak()); + this.root.push(new PageBreak()); return this; } diff --git a/ts/tests/docx/paragraph/paragraphTests.ts b/ts/tests/docx/paragraph/paragraphTests.ts index 1209fecea1..1b103a5a8f 100644 --- a/ts/tests/docx/paragraph/paragraphTests.ts +++ b/ts/tests/docx/paragraph/paragraphTests.ts @@ -144,12 +144,10 @@ describe("Paragraph", () => { const tree = new Formatter().format(paragraph); expect(tree).to.deep.equal({ "w:p": [{ - "w:pPr": [{ - "w:r": [ - {"w:rPr": []}, - {"w:br": [{_attr: {"w:type": "page"}}]}, - ], - }], + "w:r": [ + {"w:rPr": []}, + {"w:br": [{_attr: {"w:type": "page"}}]}, + ], }], }); });