Add ability to add multiple text runs to a bookmark

This commit is contained in:
Dolan
2020-01-01 22:54:42 +00:00
parent 9c11653313
commit db7c4da609
7 changed files with 44 additions and 13 deletions

View File

@ -8,6 +8,7 @@ import { EMPTY_OBJECT } from "file/xml-components";
import { AlignmentType, HeadingLevel, LeaderType, PageBreak, TabStopPosition, TabStopType } from "./formatting";
import { Bookmark } from "./links";
import { Paragraph } from "./paragraph";
import { TextRun } from "./run";
describe("Paragraph", () => {
describe("#constructor()", () => {
@ -646,7 +647,12 @@ describe("Paragraph", () => {
return "test-unique-id";
});
const paragraph = new Paragraph({
children: [new Bookmark("test-id", "test")],
children: [
new Bookmark({
id: "test-id",
children: [new TextRun("test")],
}),
],
});
const tree = new Formatter().format(paragraph);
expect(tree).to.deep.equal({