From a52d99fd85061a9f20b481535407a225d5927434 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Wed, 17 Jun 2015 15:40:21 +0100 Subject: Allow strikethrough to be configured in style mapping --- lib/document-to-html.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'lib/document-to-html.js') diff --git a/lib/document-to-html.js b/lib/document-to-html.js index f424acf..907d62c 100644 --- a/lib/document-to-html.js +++ b/lib/document-to-html.js @@ -126,7 +126,7 @@ function DocumentConversion(options) { convertUnderline(runHtml); } if (run.isStrikethrough) { - runHtml.open(htmlPaths.element("s")); + convertStrikethrough(runHtml); } convertElements(run.children, runHtml, messages, function(err) { if (err) { @@ -143,6 +143,15 @@ function DocumentConversion(options) { (options.convertUnderline || defaultConvertUnderline)(runHtml); } + function convertStrikethrough(runHtml) { + var style = findStyle({type: "strikethrough"}); + if (style) { + runHtml.appendPath(style.to); + } else { + runHtml.open(htmlPaths.element("s")); + } + } + function defaultConvertUnderline(runHtml) { var style = findStyle({type: "underline"}); if (style) { -- cgit v1.2.3