Merge pull request #41 from jacwright/patch-1

Fix page/thematic breaks
This commit is contained in:
Dolan
2017-09-15 15:57:22 +01:00
committed by GitHub
2 changed files with 5 additions and 7 deletions

View File

@ -103,7 +103,7 @@ export class Paragraph extends XmlComponent {
} }
public pageBreak(): Paragraph { public pageBreak(): Paragraph {
this.properties.push(new PageBreak()); this.root.push(new PageBreak());
return this; return this;
} }

View File

@ -144,13 +144,11 @@ describe("Paragraph", () => {
const tree = new Formatter().format(paragraph); const tree = new Formatter().format(paragraph);
expect(tree).to.deep.equal({ expect(tree).to.deep.equal({
"w:p": [{ "w:p": [{
"w:pPr": [{
"w:r": [ "w:r": [
{"w:rPr": []}, {"w:rPr": []},
{"w:br": [{_attr: {"w:type": "page"}}]}, {"w:br": [{_attr: {"w:type": "page"}}]},
], ],
}], }],
}],
}); });
}); });
}); });