From 4e671eb512e9ce8de1d83a655479e49d53929cc2 Mon Sep 17 00:00:00 2001 From: Dolan Miu Date: Sun, 18 Nov 2018 15:22:23 +0000 Subject: [PATCH] Breaking change. Make all italic to italics. --- demo/demo10.ts | 2 +- demo/demo22.ts | 2 +- docs/usage/styling-with-js.md | 2 +- docs/usage/text.md | 4 ++-- src/file/paragraph/run/run.spec.ts | 4 ++-- src/file/paragraph/run/run.ts | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/demo/demo10.ts b/demo/demo10.ts index 84713e777f..5d207d5783 100644 --- a/demo/demo10.ts +++ b/demo/demo10.ts @@ -233,7 +233,7 @@ class DocumentCreator { public createRoleText(roleText: string): Paragraph { const paragraph = new Paragraph(); - const role = new TextRun(roleText).italic(); + const role = new TextRun(roleText).italics(); paragraph.addRun(role); diff --git a/demo/demo22.ts b/demo/demo22.ts index c5051ab019..6f5baa970c 100644 --- a/demo/demo22.ts +++ b/demo/demo22.ts @@ -16,7 +16,7 @@ paragraph2.addRun(textRun2); doc.addParagraph(paragraph2); const paragraph3 = new Paragraph().bidirectional(); -const textRun3 = new TextRun("שלום עולם").italic().rightToLeft(); +const textRun3 = new TextRun("שלום עולם").italics().rightToLeft(); paragraph3.addRun(textRun3); doc.addParagraph(paragraph3); diff --git a/docs/usage/styling-with-js.md b/docs/usage/styling-with-js.md index 4f362192af..f1f043cb1b 100644 --- a/docs/usage/styling-with-js.md +++ b/docs/usage/styling-with-js.md @@ -14,7 +14,7 @@ const name = new TextRun("Name:") ## Available methods * For run formatting: - * `.bold()`, `.italic()`, `.smallCaps()`, `.allCaps()`, `.strike()`, `.doubleStrike()`, `.subScript()`, `.superScript()`: Set the formatting property to true + * `.bold()`, `.italics()`, `.smallCaps()`, `.allCaps()`, `.strike()`, `.doubleStrike()`, `.subScript()`, `.superScript()`: Set the formatting property to true * `.underline(style="single", color=null)`: Set the underline style and color * `.color(color)`: Set the text color, using 6 hex characters for RRGGBB (no leading `#`) * `.size(halfPts)`: Set the font size, measured in half-points diff --git a/docs/usage/text.md b/docs/usage/text.md index 3ca98804bb..faa2bdf2d5 100644 --- a/docs/usage/text.md +++ b/docs/usage/text.md @@ -22,7 +22,7 @@ text.bold(); ### Italics ```js -text.italic(); +text.italics(); ``` ### Underline @@ -80,5 +80,5 @@ text.break(); What if you want to create a paragraph which is **_bold_** and **_italic_**? ```js -paragraph.bold().italic(); +paragraph.bold().italics(); ``` diff --git a/src/file/paragraph/run/run.spec.ts b/src/file/paragraph/run/run.spec.ts index c4ff3e8b70..bd9f3bf778 100644 --- a/src/file/paragraph/run/run.spec.ts +++ b/src/file/paragraph/run/run.spec.ts @@ -21,9 +21,9 @@ describe("Run", () => { }); }); - describe("#italic()", () => { + describe("#italics()", () => { it("it should add italics to the properties", () => { - run.italic(); + run.italics(); const newJson = Utility.jsonify(run); assert.equal(newJson.root[0].root[0].rootKey, "w:i"); assert.equal(newJson.root[0].root[1].rootKey, "w:iCs"); diff --git a/src/file/paragraph/run/run.ts b/src/file/paragraph/run/run.ts index 74e011b402..c03ed8d78e 100644 --- a/src/file/paragraph/run/run.ts +++ b/src/file/paragraph/run/run.ts @@ -39,7 +39,7 @@ export class Run extends XmlComponent { return this; } - public italic(): Run { + public italics(): Run { this.properties.push(new Italics()); this.properties.push(new ItalicsComplexScript()); return this;