diff options
| -rw-r--r-- | tests/mammoth.tests.js | 18 | ||||
| -rw-r--r-- | tests/test-data/endnotes.docx | bin | 0 -> 4253 bytes |
2 files changed, 18 insertions, 0 deletions
diff --git a/tests/mammoth.tests.js b/tests/mammoth.tests.js index 32bc281..08649f4 100644 --- a/tests/mammoth.tests.js +++ b/tests/mammoth.tests.js @@ -164,6 +164,24 @@ describe('mammoth', function() { }); }); + test('endnotes are appended to text', function() { + return; + var docxPath = path.join(__dirname, "test-data/endnotes.docx"); + var options = { + generateUniquifier: function() { return 42; } + }; + return mammoth.convertToHtml({path: docxPath}, options).then(function(result) { + var expectedOutput = '<p>Ouch' + + '<sup><a href="#endnote-42-1" id="endnote-ref-42-1">[1]</a></sup>.' + + '<sup><a href="#endnote-42-2" id="endnote-ref-42-2">[2]</a></sup></p>' + + '<ol><li id="endnote-42-1"><p> A tachyon walks into a bar. <a href="#endnote-ref-42-1">↑</a></p></li>' + + '<li id="endnote-42-2"><p> Fin. <a href="#endnote-ref-42-2">↑</a></p></li></ol>'; + assert.equal(result.value, expectedOutput); + // TODO: get rid of warnings + //~ assert.deepEqual(result.messages, []); + }); + }); + test('indentation is used if prettyPrint is true', function() { var docxPath = path.join(__dirname, "test-data/single-paragraph.docx"); return mammoth.convertToHtml({path: docxPath}, {prettyPrint: true}).then(function(result) { diff --git a/tests/test-data/endnotes.docx b/tests/test-data/endnotes.docx Binary files differnew file mode 100644 index 0000000..5ec7faf --- /dev/null +++ b/tests/test-data/endnotes.docx |
