diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/documents.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/documents.js b/lib/documents.js index 41d49a5..88f95ba 100644 --- a/lib/documents.js +++ b/lib/documents.js @@ -11,10 +11,10 @@ exports.Text = Text; function DocumentConverter(options) { options = options || {}; - options.paragraphStyleMap = options.paragraphStyleMap || {}; var defaultParagraphStyle = options.defaultParagraphStyle || styles.topLevelElement("p"); - var paragraphStyleMap = options.paragraphStyleMap; + var paragraphStyleMap = options.paragraphStyleMap || {}; + var runStyleMap = options.runStyleMap || {}; function convertToHtml(document) { var html = new HtmlGenerator(); @@ -50,6 +50,12 @@ function DocumentConverter(options) { function convertRun(run, html) { var runHtml = new HtmlGenerator(); + if (run.properties.styleName) { + var style = runStyleMap[run.properties.styleName]; + if (style) { + runHtml.style(style); + } + } if (run.properties.isBold) { runHtml.push(styles.element("strong")); } |
