added #thematicBreak method to paragraph styles

This commit is contained in:
felipe
2017-03-12 21:58:12 +01:00
parent df8ba1e8b8
commit 6689f76c28
2 changed files with 25 additions and 0 deletions

View File

@ -156,6 +156,11 @@ export class ParagraphStyle extends Style {
return this; return this;
} }
public thematicBreak(): ParagraphStyle {
this.addParagraphProperty(new paragraph.ThematicBreak());
return this;
}
public indent(left: number, hanging?: number): ParagraphStyle { public indent(left: number, hanging?: number): ParagraphStyle {
this.addParagraphProperty(new paragraph.Indent(left, hanging)); this.addParagraphProperty(new paragraph.Indent(left, hanging));
return this; return this;

View File

@ -272,6 +272,26 @@ describe("ParagraphStyle", () => {
], ],
}); });
}); });
it("#thematicBreak", () => {
const style = new ParagraphStyle("myStyleId")
.thematicBreak();
const tree = new Formatter().format(style);
expect(tree).to.deep.equal({
"w:style": [
{_attr: {"w:type": "paragraph", "w:styleId": "myStyleId"}},
{"w:pPr": [
{"w:pBdr": [{"w:bottom": [{_attr: {
"w:color": "auto",
"w:space": "1",
"w:val": "single",
"w:sz": "6",
}}]}]},
]},
{"w:rPr": []},
],
});
});
}); });
describe("formatting methods: run properties", () => { describe("formatting methods: run properties", () => {