Breaking change. Make all italic to italics.

This commit is contained in:
Dolan Miu
2018-11-18 15:22:23 +00:00
parent 2677c4a4ec
commit 4e671eb512
6 changed files with 8 additions and 8 deletions

View File

@ -233,7 +233,7 @@ class DocumentCreator {
public createRoleText(roleText: string): Paragraph { public createRoleText(roleText: string): Paragraph {
const paragraph = new Paragraph(); const paragraph = new Paragraph();
const role = new TextRun(roleText).italic(); const role = new TextRun(roleText).italics();
paragraph.addRun(role); paragraph.addRun(role);

View File

@ -16,7 +16,7 @@ paragraph2.addRun(textRun2);
doc.addParagraph(paragraph2); doc.addParagraph(paragraph2);
const paragraph3 = new Paragraph().bidirectional(); const paragraph3 = new Paragraph().bidirectional();
const textRun3 = new TextRun("שלום עולם").italic().rightToLeft(); const textRun3 = new TextRun("שלום עולם").italics().rightToLeft();
paragraph3.addRun(textRun3); paragraph3.addRun(textRun3);
doc.addParagraph(paragraph3); doc.addParagraph(paragraph3);

View File

@ -14,7 +14,7 @@ const name = new TextRun("Name:")
## Available methods ## Available methods
* For run formatting: * 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 * `.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 `#`) * `.color(color)`: Set the text color, using 6 hex characters for RRGGBB (no leading `#`)
* `.size(halfPts)`: Set the font size, measured in half-points * `.size(halfPts)`: Set the font size, measured in half-points

View File

@ -22,7 +22,7 @@ text.bold();
### Italics ### Italics
```js ```js
text.italic(); text.italics();
``` ```
### Underline ### Underline
@ -80,5 +80,5 @@ text.break();
What if you want to create a paragraph which is **_bold_** and **_italic_**? What if you want to create a paragraph which is **_bold_** and **_italic_**?
```js ```js
paragraph.bold().italic(); paragraph.bold().italics();
``` ```

View File

@ -21,9 +21,9 @@ describe("Run", () => {
}); });
}); });
describe("#italic()", () => { describe("#italics()", () => {
it("it should add italics to the properties", () => { it("it should add italics to the properties", () => {
run.italic(); run.italics();
const newJson = Utility.jsonify(run); const newJson = Utility.jsonify(run);
assert.equal(newJson.root[0].root[0].rootKey, "w:i"); assert.equal(newJson.root[0].root[0].rootKey, "w:i");
assert.equal(newJson.root[0].root[1].rootKey, "w:iCs"); assert.equal(newJson.root[0].root[1].rootKey, "w:iCs");

View File

@ -39,7 +39,7 @@ export class Run extends XmlComponent {
return this; return this;
} }
public italic(): Run { public italics(): Run {
this.properties.push(new Italics()); this.properties.push(new Italics());
this.properties.push(new ItalicsComplexScript()); this.properties.push(new ItalicsComplexScript());
return this; return this;