aboutsummaryrefslogtreecommitdiff
path: root/lib/document-to-html.js
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2016-05-02 11:41:09 +0100
committerMichael Williamson <mike@zwobble.org>2016-05-02 11:41:09 +0100
commit245082a0c52ffcab818823ef4e33b89841fbf46d (patch)
treef45cde8ba2be07495831c85021c57480440f15fb /lib/document-to-html.js
parent1b54156c52caf3f2e9fe7eef29ba5ce6bd098ded (diff)
Add support for table cells spanning multiple columns
Diffstat (limited to 'lib/document-to-html.js')
-rw-r--r--lib/document-to-html.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/document-to-html.js b/lib/document-to-html.js
index c084403..81a887e 100644
--- a/lib/document-to-html.js
+++ b/lib/document-to-html.js
@@ -201,7 +201,13 @@ function DocumentConversion(options) {
}
function convertTableCell(element, messages, callback) {
- wrapChildrenInFreshElement(element, "td", messages, callback);
+ convertElements(element.children, messages, function(error, children) {
+ var attributes = element.colSpan === 1 ? {} : {colspan: element.colSpan.toString()};
+
+ callback(null, Html.freshElement("td", attributes, [
+ Html.forceWrite,
+ Html.fragment(children)]));
+ });
}
function wrapChildrenInFreshElement(element, wrapElementName, messages, callback) {