#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");
|
const spy = sinon.spy(compiler["formatter"], "format");
|
||||||
|
|
||||||
compiler.compile(file);
|
compiler.compile(file);
|
||||||
expect(spy.callCount).to.equal(12);
|
expect(spy.callCount).to.equal(13);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should work with media datas", () => {
|
it("should work with media datas", () => {
|
||||||
|
@ -406,26 +406,19 @@ export class Compiler {
|
|||||||
path: "word/settings.xml",
|
path: "word/settings.xml",
|
||||||
},
|
},
|
||||||
Comments: {
|
Comments: {
|
||||||
data: (() => {
|
data: xml(
|
||||||
if (!file.Comments) {
|
this.formatter.format(file.Comments, {
|
||||||
return;
|
viewWrapper: file.Document,
|
||||||
}
|
file,
|
||||||
|
}),
|
||||||
const data = xml(
|
{
|
||||||
this.formatter.format(file.Comments, {
|
indent: prettify,
|
||||||
viewWrapper: file.Document,
|
declaration: {
|
||||||
file,
|
standalone: "yes",
|
||||||
}),
|
encoding: "UTF-8",
|
||||||
{
|
|
||||||
indent: prettify,
|
|
||||||
declaration: {
|
|
||||||
standalone: "yes",
|
|
||||||
encoding: "UTF-8",
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
);
|
},
|
||||||
return data;
|
),
|
||||||
})(),
|
|
||||||
path: "word/comments.xml",
|
path: "word/comments.xml",
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -71,10 +71,7 @@ export class File {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
if (options.comments) {
|
this.comments = new Comments(options.comments ?? { children: [] });
|
||||||
this.comments = new Comments(options.comments);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.fileRelationships = new Relationships();
|
this.fileRelationships = new Relationships();
|
||||||
this.customProperties = new CustomProperties(options.customProperties ?? []);
|
this.customProperties = new CustomProperties(options.customProperties ?? []);
|
||||||
this.appProperties = new AppProperties();
|
this.appProperties = new AppProperties();
|
||||||
|
Reference in New Issue
Block a user