From dc53892204989de1788081624c65062dc283480a Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Wed, 17 Jun 2015 15:32:53 +0100 Subject: Add support for strikethrough --- lib/document-to-html.js | 3 +++ lib/documents.js | 1 + lib/docx/document-xml-reader.js | 1 + 3 files changed, 5 insertions(+) (limited to 'lib') diff --git a/lib/document-to-html.js b/lib/document-to-html.js index 264f7c9..f424acf 100644 --- a/lib/document-to-html.js +++ b/lib/document-to-html.js @@ -125,6 +125,9 @@ function DocumentConversion(options) { if (run.isUnderline) { convertUnderline(runHtml); } + if (run.isStrikethrough) { + runHtml.open(htmlPaths.element("s")); + } convertElements(run.children, runHtml, messages, function(err) { if (err) { callback(err); diff --git a/lib/documents.js b/lib/documents.js index 10d8646..4e4211b 100644 --- a/lib/documents.js +++ b/lib/documents.js @@ -48,6 +48,7 @@ function Run(children, properties) { isBold: properties.isBold, isUnderline: properties.isUnderline, isItalic: properties.isItalic, + isStrikethrough: properties.isStrikethrough, verticalAlignment: properties.verticalAlignment || verticalAlignment.baseline }; } diff --git a/lib/docx/document-xml-reader.js b/lib/docx/document-xml-reader.js index 8bdb8cc..1d36d91 100644 --- a/lib/docx/document-xml-reader.js +++ b/lib/docx/document-xml-reader.js @@ -75,6 +75,7 @@ function DocumentXmlReader(options) { properties.isBold = !!element.first("w:b"); properties.isUnderline = !!element.first("w:u"); properties.isItalic = !!element.first("w:i"); + properties.isStrikethrough = !!element.first("w:strike"); return elementResult(properties); } -- cgit v1.2.3