#1529 Add word break feature

This commit is contained in:
Dolan
2022-06-15 00:07:12 +01:00
parent bdbd15e7d9
commit f414b4ee9a
13 changed files with 87 additions and 34 deletions

View File

@ -3,11 +3,13 @@ import { XmlComponent } from "file/xml-components";
import { FootnoteReferenceRun } from "file/footnotes/footnote/run/reference-run";
import { FieldInstruction } from "file/table-of-contents/field-instruction";
import { Break } from "./break";
import { Begin, End, Separate } from "./field";
import { NumberOfPages, NumberOfPagesSection, Page } from "./page-number";
import { IRunPropertiesOptions, RunProperties } from "./properties";
import { Text } from "./run-components/text";
import { TextAttributes } from "./text-attributes";
export interface IRunOptions extends IRunPropertiesOptions {
readonly children?: (Begin | FieldInstruction | Separate | End | PageNumber | FootnoteReferenceRun | string)[];
@ -35,6 +37,10 @@ export class Run extends XmlComponent {
}
}
if (options.space) {
this.root.push(new TextAttributes({ space: options.space }));
}
if (options.children) {
for (const child of options.children) {
if (typeof child === "string") {