fix ordering of elements in w:lvl
This commit is contained in:
@ -111,33 +111,35 @@ export class LevelBase extends XmlComponent {
|
|||||||
|
|
||||||
constructor({ level, format, text, alignment = AlignmentType.START, start = 1, style, suffix }: ILevelsOptions) {
|
constructor({ level, format, text, alignment = AlignmentType.START, start = 1, style, suffix }: ILevelsOptions) {
|
||||||
super("w:lvl");
|
super("w:lvl");
|
||||||
this.root.push(
|
|
||||||
new LevelAttributes({
|
|
||||||
ilvl: level,
|
|
||||||
tentative: 1,
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
|
|
||||||
this.root.push(new Start(start));
|
this.root.push(new Start(start));
|
||||||
this.root.push(new LevelJc(alignment));
|
|
||||||
|
|
||||||
if (format) {
|
if (format) {
|
||||||
this.root.push(new NumberFormat(format));
|
this.root.push(new NumberFormat(format));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (suffix) {
|
||||||
|
this.root.push(new Suffix(suffix));
|
||||||
|
}
|
||||||
|
|
||||||
if (text) {
|
if (text) {
|
||||||
this.root.push(new LevelText(text));
|
this.root.push(new LevelText(text));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.root.push(new LevelJc(alignment));
|
||||||
|
|
||||||
this.paragraphProperties = new ParagraphProperties(style && style.paragraph);
|
this.paragraphProperties = new ParagraphProperties(style && style.paragraph);
|
||||||
this.runProperties = new RunProperties(style && style.run);
|
this.runProperties = new RunProperties(style && style.run);
|
||||||
|
|
||||||
this.root.push(this.paragraphProperties);
|
this.root.push(this.paragraphProperties);
|
||||||
this.root.push(this.runProperties);
|
this.root.push(this.runProperties);
|
||||||
|
|
||||||
if (suffix) {
|
this.root.push(
|
||||||
this.root.push(new Suffix(suffix));
|
new LevelAttributes({
|
||||||
}
|
ilvl: level,
|
||||||
|
tentative: 1,
|
||||||
|
}),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user