fix ordering of elements in w:lvl

This commit is contained in:
Tom Hunkapiller
2021-05-20 04:20:14 +03:00
parent 798cbb8628
commit b627f0982a

View File

@ -111,33 +111,35 @@ export class LevelBase extends XmlComponent {
constructor({ level, format, text, alignment = AlignmentType.START, start = 1, style, suffix }: ILevelsOptions) {
super("w:lvl");
this.root.push(
new LevelAttributes({
ilvl: level,
tentative: 1,
}),
);
this.root.push(new Start(start));
this.root.push(new LevelJc(alignment));
if (format) {
this.root.push(new NumberFormat(format));
}
if (suffix) {
this.root.push(new Suffix(suffix));
}
if (text) {
this.root.push(new LevelText(text));
}
this.root.push(new LevelJc(alignment));
this.paragraphProperties = new ParagraphProperties(style && style.paragraph);
this.runProperties = new RunProperties(style && style.run);
this.root.push(this.paragraphProperties);
this.root.push(this.runProperties);
if (suffix) {
this.root.push(new Suffix(suffix));
}
this.root.push(
new LevelAttributes({
ilvl: level,
tentative: 1,
}),
);
}
}