diff options
Diffstat (limited to 'lib/document-to-html.js')
| -rw-r--r-- | lib/document-to-html.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/document-to-html.js b/lib/document-to-html.js index b9efe0d..916eb57 100644 --- a/lib/document-to-html.js +++ b/lib/document-to-html.js @@ -42,7 +42,7 @@ function DocumentConverter(options) { function convertParagraph(element, html) { html.style(styleForParagraph(element)); - convertElements(element.children, html); + return convertElements(element.children, html); } function styleForParagraph(element) { @@ -63,9 +63,11 @@ function DocumentConverter(options) { if (run.properties.isItalic) { runHtml.push(styles.element("em")); } - convertElements(run.children, runHtml); - runHtml.closeAll(); - html.append(runHtml); + return convertElements(run.children, runHtml) + .then(function() { + runHtml.closeAll(); + html.append(runHtml); + }); } var elementConverters = { |
