From bf37d9d321dad98f3fa2ca99a5235d07cb66892e Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Thu, 7 Jul 2016 21:37:21 +0100 Subject: Wire up comment conversion code --- test/mammoth.tests.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'test/mammoth.tests.js') diff --git a/test/mammoth.tests.js b/test/mammoth.tests.js index 12bee96..0515b2a 100644 --- a/test/mammoth.tests.js +++ b/test/mammoth.tests.js @@ -269,6 +269,25 @@ describe('mammoth', function() { }); }); + test('when style mapping is defined for comment references then comments are included', function() { + var docxPath = path.join(__dirname, "test-data/comments.docx"); + var options = { + idPrefix: "doc-42-", + styleMap: "comment-reference => sup" + }; + return mammoth.convertToHtml({path: docxPath}, options).then(function(result) { + var expectedOutput = ( + '

Ouch' + + '[MW1].' + + '[MW2]

' + + '
Comment [MW1]

A tachyon walks into a bar. ↑

' + + '
Comment [MW2]

Fin. ↑

' + ); + assert.equal(result.value, expectedOutput); + assert.deepEqual(result.messages, []); + }); + }); + test('textboxes are read', function() { var docxPath = path.join(__dirname, "test-data/text-box.docx"); return mammoth.convertToHtml({path: docxPath}).then(function(result) { -- cgit v1.2.3