diff options
| author | Michael Williamson <mike@zwobble.org> | 2015-02-09 20:44:09 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2015-02-09 20:54:02 +0000 |
| commit | 7a7d96213635a63986b45d74cb1c25bb834f9ca8 (patch) | |
| tree | ac9cc0068fe86682b94e08f63384ecf5e922a627 /tests | |
| parent | dae5823ec141dd6e567a05f68db80efc5f728a08 (diff) | |
Include ID prefix when generating IDs for internal links
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/document-to-html.tests.js | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/document-to-html.tests.js b/tests/document-to-html.tests.js index 46f5649..cb2b3d3 100644 --- a/tests/document-to-html.tests.js +++ b/tests/document-to-html.tests.js @@ -245,9 +245,11 @@ describe('DocumentConverter', function() { [runOfText("Hello.")], {anchor: "_Peter"} ); - var converter = new DocumentConverter(); + var converter = new DocumentConverter({ + idPrefix: "doc-42" + }); return converter.convertToHtml(hyperlink).then(function(result) { - assert.equal(result.value, '<a href="#_Peter">Hello.</a>'); + assert.equal(result.value, '<a href="#doc-42-_Peter">Hello.</a>'); }); }); @@ -423,10 +425,12 @@ describe('DocumentConverter', function() { [runOfText("Hello.")], {anchor: "_Peter"} ); - var converter = new DocumentConverter(); + var converter = new DocumentConverter({ + idPrefix: "doc-42" + }); var document = new documents.Document([bookmarkStart, hyperlink]); return converter.convertToHtml(document).then(function(result) { - assert.equal(result.value, '<span id="_Peter"></span><a href="#_Peter">Hello.</a>'); + assert.equal(result.value, '<a id="doc-42-_Peter"></a><a href="#doc-42-_Peter">Hello.</a>'); }); }); }); |
