Files
docx-js/src/file/paragraph/run/run-components/text.ts

14 lines
370 B
TypeScript
Raw Normal View History

import { SpaceType } from "@file/space-type";
import { XmlComponent } from "@file/xml-components";
2016-05-09 13:02:59 +01:00
2022-06-15 00:07:12 +01:00
import { TextAttributes } from "../text-attributes";
2016-05-09 13:02:59 +01:00
export class Text extends XmlComponent {
2022-08-31 07:52:27 +01:00
public constructor(text: string) {
2016-05-09 13:02:59 +01:00
super("w:t");
this.root.push(new TextAttributes({ space: SpaceType.PRESERVE }));
2019-11-21 01:02:46 +00:00
this.root.push(text);
2016-05-09 13:02:59 +01:00
}
2017-03-08 21:49:41 +00:00
}