From eb7facff4a57dcf6c6818eeeb47580a83a7cbdcc Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Wed, 11 Jun 2014 15:44:44 +0100 Subject: Move jump back into last footnote paragraph --- lib/document-to-html.js | 7 +++---- tests/document-to-html.tests.js | 2 +- tests/mammoth.tests.js | 4 ++-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/document-to-html.js b/lib/document-to-html.js index faae02b..fe601bd 100644 --- a/lib/document-to-html.js +++ b/lib/document-to-html.js @@ -203,12 +203,11 @@ function DocumentConversion(options) { if (err) { callback(err); } else { + footnoteHtml.text(" "); + footnoteHtml.open(htmlPaths.element("a", {href: "#footnote-ref-" + uid})); + footnoteHtml.text("↑"); footnoteHtml.closeAll(); html.append(footnoteHtml); - html.text(" "); - html.open(htmlPaths.element("a", {href: "#footnote-ref-" + uid})); - html.text("↑"); - html.close(); html.close(); callback(); } diff --git a/tests/document-to-html.tests.js b/tests/document-to-html.tests.js index cf6fa5b..cfd1c20 100644 --- a/tests/document-to-html.tests.js +++ b/tests/document-to-html.tests.js @@ -234,7 +234,7 @@ describe('DocumentConverter', function() { }); return converter.convertToHtml(document).then(function(result) { var expectedOutput = '

Knock knock[1]

' + - '
  1. Who\'s there?

    ↑
'; + '
  1. Who\'s there? ↑

'; assert.equal(result.value, expectedOutput); }); }); diff --git a/tests/mammoth.tests.js b/tests/mammoth.tests.js index 7b502a4..1fc278e 100644 --- a/tests/mammoth.tests.js +++ b/tests/mammoth.tests.js @@ -98,8 +98,8 @@ describe('mammoth', function() { var expectedOutput = '

Ouch' + '[1].' + '[2]

' + - '
  1. A tachyon walks into a bar.

    ↑
  2. ' + - '
  3. Fin.

    ↑
' + '
  1. A tachyon walks into a bar. ↑

  2. ' + + '
  3. Fin. ↑

' assert.equal(result.value, expectedOutput); // TODO: get rid of warnings //~ assert.deepEqual(result.messages, []); -- cgit v1.2.3