diff --git a/ts/docx/paragraph/index.ts b/ts/docx/paragraph/index.ts index 51815ec904..de48cd7115 100644 --- a/ts/docx/paragraph/index.ts +++ b/ts/docx/paragraph/index.ts @@ -98,7 +98,7 @@ export class Paragraph extends XmlComponent { } public thematicBreak(): Paragraph { - this.root.push(new ThematicBreak()); + this.properties.push(new ThematicBreak()); 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"}}]}, + ], }], }); });