diff options
Diffstat (limited to 'lib/document-to-html.js')
| -rw-r--r-- | lib/document-to-html.js | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/document-to-html.js b/lib/document-to-html.js index 0dac05e..8d1078b 100644 --- a/lib/document-to-html.js +++ b/lib/document-to-html.js @@ -219,7 +219,17 @@ function DocumentConversion(options, comments) { return idPrefix + suffix; } + var defaultTablePath = htmlPaths.elements([ + htmlPaths.element("table", {}, {fresh: true}) + ]); + function convertTable(element, messages, options) { + return findHtmlPath(element, defaultTablePath).wrap(function() { + return convertTableChildren(element, messages, options); + }); + } + + function convertTableChildren(element, messages, options) { var bodyIndex = _.findIndex(element.children, function(child) { return !child.type === documents.types.tableRow || !child.isHeader; }); @@ -249,9 +259,7 @@ function DocumentConversion(options, comments) { Html.freshElement("tbody", {}, bodyRows) ]; } - return [ - Html.freshElement("table", {}, [Html.forceWrite].concat(children)) - ]; + return [Html.forceWrite].concat(children); } function convertTableRow(element, messages, options) { |
