aboutsummaryrefslogtreecommitdiff
path: root/tests/document-to-html.tests.js
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2014-06-11 14:48:39 +0100
committerMichael Williamson <mike@zwobble.org>2014-06-11 14:48:39 +0100
commitb4e617af3d447f7addd2901d9abaaceb1f9b1d9a (patch)
tree1d705bbf7776ad547b475e43c52611bfc07d4696 /tests/document-to-html.tests.js
parent0af8351be2b11f5f912ef091c4ce0f117171d5d5 (diff)
Add uniquifier to footnote IDs
Diffstat (limited to 'tests/document-to-html.tests.js')
-rw-r--r--tests/document-to-html.tests.js14
1 files changed, 9 insertions, 5 deletions
diff --git a/tests/document-to-html.tests.js b/tests/document-to-html.tests.js
index a8cf0ab..51ee625 100644
--- a/tests/document-to-html.tests.js
+++ b/tests/document-to-html.tests.js
@@ -202,9 +202,11 @@ describe('DocumentConverter', function() {
footnoteId: "4",
body: paragraphOfText("Who's there?")
});
- var converter = new DocumentConverter();
+ var converter = new DocumentConverter({
+ generateUniquifier: function() { return 42; }
+ });
return converter.convertToHtml(footnoteReference).then(function(result) {
- assert.equal(result.value, '<sup><a href="#footnote-4">[1]</a></sup>');
+ assert.equal(result.value, '<sup><a href="#footnote-42-4">[1]</a></sup>');
});
});
@@ -227,10 +229,12 @@ describe('DocumentConverter', function() {
}
);
- var converter = new DocumentConverter();
+ var converter = new DocumentConverter({
+ generateUniquifier: function() { return 42; }
+ });
return converter.convertToHtml(document).then(function(result) {
- var expectedOutput = '<p>Knock knock<sup><a href="#footnote-4">[1]</a></sup></p>' +
- '<ol><li id="footnote-4"><p>Who\'s there?</p></li></ol>';
+ var expectedOutput = '<p>Knock knock<sup><a href="#footnote-42-4">[1]</a></sup></p>' +
+ '<ol><li id="footnote-42-4"><p>Who\'s there?</p></li></ol>';
assert.equal(result.value, expectedOutput);
});
});