:feat: support emphasis mark

This commit is contained in:
wangfengming
2020-05-22 12:22:45 +08:00
parent 2654799822
commit 120c3a7bbe
15 changed files with 371 additions and 15 deletions

View File

@ -6,6 +6,7 @@ import { FootnoteReferenceRun } from "file/footnotes/footnote/run/reference-run"
import { FieldInstruction } from "file/table-of-contents/field-instruction";
import { Break } from "./break";
import { Caps, SmallCaps } from "./caps";
import { EmphasisMark, EmphasisMarkType } from "./emphasis-mark";
import { Begin, End, Separate } from "./field";
import {
Bold,
@ -38,6 +39,9 @@ export interface IRunOptions {
readonly color?: string;
readonly type?: UnderlineType;
};
readonly emphasisMark?: {
readonly type?: EmphasisMarkType;
};
readonly color?: string;
readonly size?: number;
readonly rightToLeft?: boolean;
@ -90,6 +94,10 @@ export class Run extends XmlComponent {
this.properties.push(new Underline(options.underline.type, options.underline.color));
}
if (options.emphasisMark) {
this.properties.push(new EmphasisMark(options.emphasisMark.type));
}
if (options.color) {
this.properties.push(new Color(options.color));
}