From cdfeaf4b15e7161a0eae4bcb3df868d709db10ad Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Mon, 28 Nov 2016 18:01:35 +0000 Subject: Only convert line breaks to br elements --- lib/document-to-html.js | 6 +++++- lib/documents.js | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/document-to-html.js b/lib/document-to-html.js index 2591e4f..a51afd0 100644 --- a/lib/document-to-html.js +++ b/lib/document-to-html.js @@ -350,7 +350,11 @@ function DocumentConversion(options, comments) { "tableRow": convertTableRow, "tableCell": convertTableCell, "break": function(element, messages) { - return [Html.freshElement("br")]; + if (element.breakType === "line") { + return [Html.freshElement("br")]; + } else { + return []; + } } }; return { diff --git a/lib/documents.js b/lib/documents.js index cb62939..cf56174 100644 --- a/lib/documents.js +++ b/lib/documents.js @@ -200,6 +200,8 @@ exports.Table = Table; exports.TableRow = TableRow; exports.TableCell = TableCell; exports.lineBreak = Break("line"); +exports.pageBreak = Break("page"); +exports.columnBreak = Break("column"); exports.BookmarkStart = BookmarkStart; exports.verticalAlignment = verticalAlignment; -- cgit v1.2.3