#1324 Fixes Bi-directional re-factor issue
This commit is contained in:
@ -91,5 +91,31 @@ describe("ParagraphProperties", () => {
|
|||||||
],
|
],
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("should create with bidirectional", () => {
|
||||||
|
const properties = new ParagraphProperties({
|
||||||
|
bidirectional: true,
|
||||||
|
});
|
||||||
|
const tree = new Formatter().format(properties, {
|
||||||
|
// tslint:disable-next-line: no-object-literal-type-assertion
|
||||||
|
file: {
|
||||||
|
Numbering: {
|
||||||
|
createConcreteNumberingInstance: (_: string, __: number) => {
|
||||||
|
return;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
} as File,
|
||||||
|
// tslint:disable-next-line: no-object-literal-type-assertion
|
||||||
|
viewWrapper: new DocumentWrapper({ background: {} }),
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(tree).to.deep.equal({
|
||||||
|
"w:pPr": [
|
||||||
|
{
|
||||||
|
"w:bidi": {},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -146,7 +146,7 @@ export class ParagraphProperties extends IgnoreIfEmptyXmlComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (options.bidirectional !== undefined) {
|
if (options.bidirectional !== undefined) {
|
||||||
this.push(new OnOffElement("w:bidi", options.contextualSpacing));
|
this.push(new OnOffElement("w:bidi", options.bidirectional));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.spacing) {
|
if (options.spacing) {
|
||||||
|
Reference in New Issue
Block a user