diff options
Diffstat (limited to 'lib/document-to-html.js')
| -rw-r--r-- | lib/document-to-html.js | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/document-to-html.js b/lib/document-to-html.js index 220ae2b..264f7c9 100644 --- a/lib/document-to-html.js +++ b/lib/document-to-html.js @@ -122,8 +122,8 @@ function DocumentConversion(options) { if (run.verticalAlignment === documents.verticalAlignment.subscript) { runHtml.open(htmlPaths.element("sub")); } - if (run.isUnderline && options.convertUnderline) { - options.convertUnderline(runHtml); + if (run.isUnderline) { + convertUnderline(runHtml); } convertElements(run.children, runHtml, messages, function(err) { if (err) { @@ -136,6 +136,17 @@ function DocumentConversion(options) { }); } + function convertUnderline(runHtml) { + (options.convertUnderline || defaultConvertUnderline)(runHtml); + } + + function defaultConvertUnderline(runHtml) { + var style = findStyle({type: "underline"}); + if (style) { + runHtml.appendPath(style.to); + } + } + function findStyle(element) { for (var i = 0; i < styleMap.length; i++) { if (styleMap[i].from.matches(element)) { |
