Merge pull request #1861 from dolanmiu/hot-fix/return-constructor-value

Hot fix/return constructor value
This commit is contained in:
Dolan
2022-12-30 16:40:35 +00:00
committed by GitHub
3 changed files with 5 additions and 5 deletions

View File

@ -23,11 +23,11 @@ export class Text extends XmlComponent {
if (typeof options === "string") {
this.root.push(new TextAttributes({ space: SpaceType.PRESERVE }));
this.root.push(options);
return;
return this;
} else {
this.root.push(new TextAttributes({ space: options.space ?? SpaceType.DEFAULT }));
this.root.push(options.text);
return;
return this;
}
}
}