From df82069bad335654187f51496ab16311fd5e2c51 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sat, 4 Jul 2015 13:01:17 +0100 Subject: Add links in footnote test --- tests/mammoth.tests.js | 15 +++++++++++++++ tests/test-data/footnote-hyperlink.docx | Bin 0 -> 16271 bytes 2 files changed, 15 insertions(+) create mode 100755 tests/test-data/footnote-hyperlink.docx 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 = + '

[1]

' + + '
  1. Example ↑

'; + 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 new file mode 100755 index 0000000..208f3dc Binary files /dev/null and b/tests/test-data/footnote-hyperlink.docx differ -- cgit v1.2.3