From d1044d262e5265f0258247317358bcdbcf8b47cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Mendon=C3=A7a?= Date: Fri, 31 Aug 2018 10:22:40 -0300 Subject: [PATCH] table of contents extending paragraph --- .../table-of-contents/table-of-contents.spec.ts | 12 ++++-------- src/file/table-of-contents/table-of-contents.ts | 15 +++++++-------- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/src/file/table-of-contents/table-of-contents.spec.ts b/src/file/table-of-contents/table-of-contents.spec.ts index 9e22af0ca9..b437656c48 100644 --- a/src/file/table-of-contents/table-of-contents.spec.ts +++ b/src/file/table-of-contents/table-of-contents.spec.ts @@ -4,15 +4,11 @@ import { Formatter } from "../../export/formatter"; import { TableOfContents } from "./"; const DEFAULT_TOC = { - "w:std": { - "w:sdtPr": {}, - "w:sdtEndPr": {}, - "w:sdtContent": { - "w:p": { - "w:pPr": {}, - }, + "w:p": [ + { + "w:pPr": [], }, - }, + ], }; describe("Table of Contents", () => { diff --git a/src/file/table-of-contents/table-of-contents.ts b/src/file/table-of-contents/table-of-contents.ts index a04c94042a..d7cee3cc75 100644 --- a/src/file/table-of-contents/table-of-contents.ts +++ b/src/file/table-of-contents/table-of-contents.ts @@ -1,12 +1,11 @@ -import { XmlComponent } from "file/xml-components"; +// import { TableOfContentsProperties } from "./properties"; +import { Paragraph } from "../paragraph"; -import { TableOfContentsProperties } from "./properties"; +export class TableOfContents extends Paragraph { + // private readonly tocProperties: TableOfContentsProperties; -export class TableOfContents extends XmlComponent { - private readonly properties: TableOfContentsProperties; - - constructor(properties?: TableOfContentsProperties) { - super("w:std"); - this.properties = properties || new TableOfContentsProperties(); + constructor(/*tocProperties?: TableOfContentsProperties*/) { + super(); + // this.tocProperties = tocProperties || new TableOfContentsProperties(); } }