added #thematicBreak method to paragraph styles
This commit is contained in:
@ -156,6 +156,11 @@ export class ParagraphStyle extends Style {
|
||||
return this;
|
||||
}
|
||||
|
||||
public thematicBreak(): ParagraphStyle {
|
||||
this.addParagraphProperty(new paragraph.ThematicBreak());
|
||||
return this;
|
||||
}
|
||||
|
||||
public indent(left: number, hanging?: number): ParagraphStyle {
|
||||
this.addParagraphProperty(new paragraph.Indent(left, hanging));
|
||||
return this;
|
||||
|
@ -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", () => {
|
||||
|
Reference in New Issue
Block a user