aboutsummaryrefslogtreecommitdiff
path: root/tests/document-to-html.tests.js
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2015-01-25 17:17:34 +0000
committerMichael Williamson <mike@zwobble.org>2015-01-25 17:17:34 +0000
commit52c4d01e4a0e35738e8c1db35a5a4a7ab981803d (patch)
tree0cce833e77942311d25a7c92828d7f5802be14b5 /tests/document-to-html.tests.js
parent2de4641bed73f04d0c1ac345e132c1a79fc48f14 (diff)
Use prefix to generate IDs
Diffstat (limited to 'tests/document-to-html.tests.js')
-rw-r--r--tests/document-to-html.tests.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/document-to-html.tests.js b/tests/document-to-html.tests.js
index 63b445d..17fdb27 100644
--- a/tests/document-to-html.tests.js
+++ b/tests/document-to-html.tests.js
@@ -290,10 +290,10 @@ describe('DocumentConverter', function() {
noteId: "4"
});
var converter = new DocumentConverter({
- generateUniquifier: function() { return 42; }
+ idPrefix: "doc-42"
});
return converter.convertToHtml(footnoteReference).then(function(result) {
- assert.equal(result.value, '<sup><a href="#footnote-42-4" id="footnote-ref-42-4">[1]</a></sup>');
+ assert.equal(result.value, '<sup><a href="#doc-42-footnote-4" id="doc-42-footnote-ref-4">[1]</a></sup>');
});
});
@@ -311,7 +311,7 @@ describe('DocumentConverter', function() {
notes: new documents.Notes({
4: new documents.Note({
noteType: "footnote",
- id: "4",
+ noteId: "4",
body: [paragraphOfText("Who's there?")]
})
})
@@ -319,11 +319,11 @@ describe('DocumentConverter', function() {
);
var converter = new DocumentConverter({
- generateUniquifier: function() { return 42; }
+ idPrefix: "doc-42"
});
return converter.convertToHtml(document).then(function(result) {
- var expectedOutput = '<p>Knock knock<sup><a href="#footnote-42-4" id="footnote-ref-42-4">[1]</a></sup></p>' +
- '<ol><li id="footnote-42-4"><p>Who\'s there? <a href="#footnote-ref-42-4">↑</a></p></li></ol>';
+ var expectedOutput = '<p>Knock knock<sup><a href="#doc-42-footnote-4" id="doc-42-footnote-ref-4">[1]</a></sup></p>' +
+ '<ol><li id="doc-42-footnote-4"><p>Who\'s there? <a href="#doc-42-footnote-ref-4">↑</a></p></li></ol>';
assert.equal(result.value, expectedOutput);
});
});