#1583 Comments to always write default data

This commit is contained in:
Dolan Miu
2022-07-12 16:57:25 +01:00
parent f183d38bb3
commit a7d55a52f3
3 changed files with 14 additions and 24 deletions

View File

@ -111,7 +111,7 @@ describe("Compiler", () => {
const spy = sinon.spy(compiler["formatter"], "format");
compiler.compile(file);
expect(spy.callCount).to.equal(12);
expect(spy.callCount).to.equal(13);
});
it("should work with media datas", () => {

View File

@ -406,12 +406,7 @@ export class Compiler {
path: "word/settings.xml",
},
Comments: {
data: (() => {
if (!file.Comments) {
return;
}
const data = xml(
data: xml(
this.formatter.format(file.Comments, {
viewWrapper: file.Document,
file,
@ -423,9 +418,7 @@ export class Compiler {
encoding: "UTF-8",
},
},
);
return data;
})(),
),
path: "word/comments.xml",
},
};

View File

@ -71,10 +71,7 @@ export class File {
},
);
if (options.comments) {
this.comments = new Comments(options.comments);
}
this.comments = new Comments(options.comments ?? { children: [] });
this.fileRelationships = new Relationships();
this.customProperties = new CustomProperties(options.customProperties ?? []);
this.appProperties = new AppProperties();