first simple version of TOC working
This commit is contained in:
@ -9,9 +9,39 @@ const DEFAULT_TOC = {
|
||||
"w:pPr": [],
|
||||
},
|
||||
{
|
||||
"w:r": [
|
||||
"w:fldChar": [
|
||||
{
|
||||
"w:fldChar": [],
|
||||
_attr: {
|
||||
"w:fldCharType": "begin",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
"w:fldChar": [
|
||||
{
|
||||
_attr: {
|
||||
"w:fldCharType": "separate",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
"w:instrText": [
|
||||
{
|
||||
_attr: {
|
||||
"xml:space": "preserve",
|
||||
},
|
||||
},
|
||||
"TOC",
|
||||
],
|
||||
},
|
||||
{
|
||||
"w:fldChar": [
|
||||
{
|
||||
_attr: {
|
||||
"w:fldCharType": "end",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
@ -23,6 +53,7 @@ describe("Table of Contents", () => {
|
||||
it("should construct a TOC with default options", () => {
|
||||
const toc = new TableOfContents();
|
||||
const tree = new Formatter().format(toc);
|
||||
// console.log(JSON.stringify(tree, null, 2));
|
||||
expect(tree).to.be.deep.equal(DEFAULT_TOC);
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user