diff options
| author | Michael Williamson <mike@zwobble.org> | 2014-06-11 14:48:39 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2014-06-11 14:48:39 +0100 |
| commit | b4e617af3d447f7addd2901d9abaaceb1f9b1d9a (patch) | |
| tree | 1d705bbf7776ad547b475e43c52611bfc07d4696 /tests/mammoth.tests.js | |
| parent | 0af8351be2b11f5f912ef091c4ce0f117171d5d5 (diff) | |
Add uniquifier to footnote IDs
Diffstat (limited to 'tests/mammoth.tests.js')
| -rw-r--r-- | tests/mammoth.tests.js | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/mammoth.tests.js b/tests/mammoth.tests.js index 30fba34..b1bb04e 100644 --- a/tests/mammoth.tests.js +++ b/tests/mammoth.tests.js @@ -93,10 +93,13 @@ describe('mammoth', function() { // TODO: generate links back to main body // TODO: don't duplicate footnotes with multiple references var docxPath = path.join(__dirname, "test-data/footnotes.docx"); - return mammoth.convertToHtml({path: docxPath}).then(function(result) { - var expectedOutput = '<p>Ouch<sup><a href="#footnote-1">[1]</a></sup>.<sup><a href="#footnote-2">[2]</a></sup></p>' + - '<ol><li id="footnote-1"><p> A tachyon walks into a bar.</p></li>' + - '<li id="footnote-2"><p> Fin.</p></li></ol>' + var options = { + generateUniquifier: function() { return 42; } + }; + return mammoth.convertToHtml({path: docxPath}, options).then(function(result) { + var expectedOutput = '<p>Ouch<sup><a href="#footnote-42-1">[1]</a></sup>.<sup><a href="#footnote-42-2">[2]</a></sup></p>' + + '<ol><li id="footnote-42-1"><p> A tachyon walks into a bar.</p></li>' + + '<li id="footnote-42-2"><p> Fin.</p></li></ol>' assert.equal(result.value, expectedOutput); // TODO: get rid of warnings //~ assert.deepEqual(result.messages, []); |
