#1583 Comments to always write default data
This commit is contained in:
@ -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", () => {
|
||||
|
@ -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",
|
||||
},
|
||||
};
|
||||
|
@ -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();
|
||||
|
Reference in New Issue
Block a user