diff options
| author | Michael Williamson <mike@zwobble.org> | 2015-07-04 13:01:17 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2015-07-04 13:01:17 +0100 |
| commit | df82069bad335654187f51496ab16311fd5e2c51 (patch) | |
| tree | d83f0e3d6d9f8a3bb9ed175d46f9218b1af418f2 | |
| parent | 0e21b260368229a12fd1fdec32840437c5eb0691 (diff) | |
Add links in footnote test
| -rw-r--r-- | tests/mammoth.tests.js | 15 | ||||
| -rwxr-xr-x | tests/test-data/footnote-hyperlink.docx | bin | 0 -> 16271 bytes |
2 files changed, 15 insertions, 0 deletions
diff --git a/tests/mammoth.tests.js b/tests/mammoth.tests.js index d4d7ef4..9b88fd3 100644 --- a/tests/mammoth.tests.js +++ b/tests/mammoth.tests.js @@ -195,6 +195,21 @@ describe('mammoth', function() { }); }); + test('relationships are handled properly in footnotes', function() { + // TODO: don't duplicate footnotes with multiple references + var docxPath = path.join(__dirname, "test-data/footnote-hyperlink.docx"); + var options = { + idPrefix: "doc-42" + }; + return mammoth.convertToHtml({path: docxPath}, options).then(function(result) { + var expectedOutput = + '<p><sup><a href="#doc-42-footnote-1" id="doc-42-footnote-ref-1">[1]</a></sup></p>' + + '<ol><li id="doc-42-footnote-1"><p> <a href="http://www.example.com">Example</a> <a href="#doc-42-footnote-ref-1">↑</a></p></li></ol>'; + 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) { diff --git a/tests/test-data/footnote-hyperlink.docx b/tests/test-data/footnote-hyperlink.docx Binary files differnew file mode 100755 index 0000000..208f3dc --- /dev/null +++ b/tests/test-data/footnote-hyperlink.docx |
