diff options
| -rw-r--r-- | lib/document-to-html.js | 6 | ||||
| -rw-r--r-- | tests/document-to-html.tests.js | 9 |
2 files changed, 14 insertions, 1 deletions
diff --git a/lib/document-to-html.js b/lib/document-to-html.js index d5be742..9c1e5af 100644 --- a/lib/document-to-html.js +++ b/lib/document-to-html.js @@ -263,7 +263,11 @@ function DocumentConversion(options) { "image": options.convertImage || defaultConvertImage, "table": convertTable, "tableRow": convertTableRow, - "tableCell": convertTableCell + "tableCell": convertTableCell, + "lineBreak": function(element, html, messages, callback) { + html.selfClosing(htmlPaths.element("br")); + callback(); + } }; return { convertToHtml: convertToHtml diff --git a/tests/document-to-html.tests.js b/tests/document-to-html.tests.js index 4bdc43c..a1bed41 100644 --- a/tests/document-to-html.tests.js +++ b/tests/document-to-html.tests.js @@ -255,6 +255,15 @@ describe('DocumentConverter', function() { }); }); + test('line break is converted to <br>', function() { + var lineBreak = new documents.LineBreak(); + var converter = new DocumentConverter(); + + return converter.convertToHtml(lineBreak).then(function(result) { + assert.equal(result.value, "<br />"); + }); + }); + test('footnote reference is converted to superscript intra-page link', function() { var footnoteReference = new documents.FootnoteReference({ footnoteId: "4", |
