feat(comments): Support comment pictures (#3032)

* feat(comments): Support comment pictures

* fix(demo): Fix the image path to load the image correctly

* fix(test): Update the number of files asserted in the compiler test case

* feat(comments): Support comment pictures

* fix(demo): Fix the image path to load the image correctly

* fix(test): Update the number of files asserted in the compiler test case

* style(src): Format the code and remove extra blank lines

---------

Co-authored-by: Dolan <dolan_miu@hotmail.com>
This commit is contained in:
Terry Sargent
2025-04-16 15:45:36 +08:00
committed by GitHub
parent 5af1045a59
commit b19025881b
4 changed files with 77 additions and 19 deletions

View File

@ -1,4 +1,5 @@
import { FileChild } from "@file/file-child";
import { Relationships } from "@file/relationships";
import { XmlAttributeComponent, XmlComponent } from "@file/xml-components";
export type ICommentOptions = {
@ -136,6 +137,8 @@ export class Comment extends XmlComponent {
}
}
export class Comments extends XmlComponent {
private readonly relationships: Relationships;
public constructor({ children }: ICommentsOptions) {
super("w:comments");
@ -178,5 +181,11 @@ export class Comments extends XmlComponent {
for (const child of children) {
this.root.push(new Comment(child));
}
this.relationships = new Relationships();
}
public get Relationships(): Relationships {
return this.relationships;
}
}