SayItalic.ts 461 B

1234567891011121314
  1. /// <reference path="../Say.ts" />
  2. class SayItalic extends Say {
  3. public async getPureElements () : Promise<Array<Element | Text>> {
  4. let paragraphs = await this.getParagraphs();
  5. let elements = paragraphs.length == 1 ? paragraphs[0] : Array.prototype.concat.apply([], paragraphs);
  6. let b = document.createElement("i");
  7. elements.forEach((element) => {
  8. b.appendChild(element);
  9. });
  10. return [b];
  11. }
  12. }