first simple version of TOC working

This commit is contained in:
Sergio Mendonça
2018-09-03 11:20:36 -03:00
parent a367951d07
commit b1711ae293
3 changed files with 53 additions and 3 deletions

View File

@ -0,0 +1,13 @@
import { XmlAttributeComponent, XmlComponent } from "file/xml-components";
class TextAttributes extends XmlAttributeComponent<{ space: "default" | "preserve" }> {
protected xmlKeys = { space: "xml:space" };
}
export class TableOfContentsInstruction extends XmlComponent {
constructor() {
super("w:instrText");
this.root.push(new TextAttributes({ space: "preserve" }));
this.root.push("TOC");
}
}