diff options
| author | Michael Williamson <mike@zwobble.org> | 2016-07-07 20:49:22 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2016-07-07 20:49:22 +0100 |
| commit | b0ff9fc6b25bbe74aaa7245d24a6476b4f5f1ec6 (patch) | |
| tree | aa60cc9d94eebbebedf6ba644eef359e9eb4e5f4 | |
| parent | baf9808eae3441de70a00cd043e10e0ebf06b7c0 (diff) | |
Test that comments are ignored by default
| -rw-r--r-- | lib/documents.js | 6 | ||||
| -rw-r--r-- | test/document-to-html.tests.js | 20 |
2 files changed, 23 insertions, 3 deletions
diff --git a/lib/documents.js b/lib/documents.js index d4a28af..9f01d88 100644 --- a/lib/documents.js +++ b/lib/documents.js @@ -181,9 +181,9 @@ function BookmarkStart(options) { }; } -exports.Document = Document; -exports.Paragraph = Paragraph; -exports.Run = Run; +exports.document = exports.Document = Document; +exports.paragraph = exports.Paragraph = Paragraph; +exports.run = exports.Run = Run; exports.Text = Text; exports.Tab = Tab; exports.Hyperlink = Hyperlink; diff --git a/test/document-to-html.tests.js b/test/document-to-html.tests.js index 0b4f905..a4678ec 100644 --- a/test/document-to-html.tests.js +++ b/test/document-to-html.tests.js @@ -486,6 +486,26 @@ describe('DocumentConverter', function() { }); }); + test('comments are ignored by default', function() { + var reference = documents.commentReference("4"); + var comment = documents.comment({ + commentId: "4", + body: [paragraphOfText("Who's there?")] + }); + var document = documents.document([ + documents.paragraph([ + runOfText("Knock knock"), + documents.run([reference]) + ]) + ], {comments: [comment]}); + + var converter = new DocumentConverter({}); + return converter.convertToHtml(document).then(function(result) { + assert.equal(result.value, '<p>Knock knock</p>'); + }); + + }); + test('images are written with data URIs', function() { var imageBuffer = new Buffer("Not an image at all!"); var image = new documents.Image({ |
