From 712450d7179233fd4e4cdc0bf233320d49ae15aa Mon Sep 17 00:00:00 2001 From: Dolan Date: Tue, 25 Oct 2022 21:29:22 +0100 Subject: [PATCH] Character style example for underline and strike --- demo/2-declaritive-styles.ts | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/demo/2-declaritive-styles.ts b/demo/2-declaritive-styles.ts index f57251c7e6..67c338364a 100644 --- a/demo/2-declaritive-styles.ts +++ b/demo/2-declaritive-styles.ts @@ -95,6 +95,20 @@ const doc = new Document({ }, }, ], + characterStyles: [ + { + id: "strikeUnderlineCharacter", + name: "Strike Underline", + basedOn: "Normal", + quickFormat: true, + run: { + strike: true, + underline: { + type: UnderlineType.SINGLE, + }, + }, + }, + ], }, numbering: { config: [ @@ -202,6 +216,20 @@ const doc = new Document({ }), ], }), + new Paragraph({ + children: [ + new TextRun({ + text: "Hello World ", + }), + new TextRun({ + style: "strikeUnderlineCharacter", + text: "Underline and Strike", + }), + new TextRun({ + text: " Another Hello World", + }), + ], + }), ], }, ],