From c0654e048359aa7dfbc9d4be4527b9bed3a4447a Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sat, 5 Jul 2014 19:56:43 +0100 Subject: Always write out table cells, even when empty --- lib/document-to-html.js | 2 +- lib/html-generator.js | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/document-to-html.js b/lib/document-to-html.js index 6c954e6..ad76eff 100644 --- a/lib/document-to-html.js +++ b/lib/document-to-html.js @@ -238,7 +238,7 @@ function DocumentConversion(options) { }); }, "tableCell": function(element, html, messages, callback) { - html.open(htmlPaths.element("td")); + html.open(htmlPaths.element("td"), {alwaysWrite: true}); async.map(element.children, function(child, callback) { var cellHtml = new HtmlGenerator(); diff --git a/lib/html-generator.js b/lib/html-generator.js index de0749c..ef0c544 100644 --- a/lib/html-generator.js +++ b/lib/html-generator.js @@ -49,10 +49,13 @@ function HtmlGenerator(options) { return stackElement && stylePart.matchesElement(stackElement); } - function open(htmlPathElement) { + function open(htmlPathElement, options) { var stackElement = Object.create(htmlPathElement); stackElement.written = false; stack.push(stackElement); + if (options && options.alwaysWrite) { + writeAll(); + } } function close() { -- cgit v1.2.3