diff options
| -rw-r--r-- | lib/document-to-html.js | 6 | ||||
| -rw-r--r-- | lib/documents.js | 2 | ||||
| -rw-r--r-- | test/document-to-html.tests.js | 8 |
3 files changed, 15 insertions, 1 deletions
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; diff --git a/test/document-to-html.tests.js b/test/document-to-html.tests.js index 6134dd0..d21badb 100644 --- a/test/document-to-html.tests.js +++ b/test/document-to-html.tests.js @@ -442,6 +442,14 @@ test('line break is converted to <br>', function() { }); }); +test('breaks that are not line breaks are ignored', function() { + var converter = new DocumentConverter(); + + return converter.convertToHtml(documents.pageBreak).then(function(result) { + assert.equal(result.value, ""); + }); +}); + test('footnote reference is converted to superscript intra-page link', function() { var footnoteReference = new documents.NoteReference({ noteType: "footnote", |
