diff --git a/ts/docx/paragraph.ts b/ts/docx/paragraph.ts index 308aaecf66..56997fc125 100644 --- a/ts/docx/paragraph.ts +++ b/ts/docx/paragraph.ts @@ -1,4 +1,5 @@ import {P, Attributes, ParagraphProperties, Run} from "./xml-components"; +import {ThematicBreak} from "./border"; class Style { private pStyle: Array
; @@ -88,4 +89,9 @@ export class Paragraph { this.properties.push(new Alignment("both")); return this; } + + pageBreak() { + this.properties.push(new ThematicBreak()); + return this; + } } \ No newline at end of file diff --git a/ts/tests/paragraphTest.ts b/ts/tests/paragraphTest.ts index f7d3966b3d..bf9383c95d 100644 --- a/ts/tests/paragraphTest.ts +++ b/ts/tests/paragraphTest.ts @@ -76,4 +76,13 @@ describe('Paragraph', () => { assert(newJson.p[1].pPr[1].jc[0]._attrs.val === "center"); }); }); + + describe("#pageBreak()", () => { + it("should add thematic break to JSON", () => { + paragraph.pageBreak(); + var newJson = jsonify(paragraph); + + assert.isDefined(newJson.p[1].pPr[1].pBdr); + }); + }); }); \ No newline at end of file