diff options
| author | Michael Williamson <mike@zwobble.org> | 2019-11-03 16:30:24 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2019-11-03 16:30:24 +0000 |
| commit | 6eb8f4d1dfcabcd0d1cc8dd1300f6b46b78fe8f4 (patch) | |
| tree | ea3322d266cf5d125366bb1af877865cf8ddbeca /test/document-to-html.tests.js | |
| parent | 5dd8af181474b3dc77240d1527313574f5db3196 (diff) | |
Allow hyperlinks to be collapsed
Diffstat (limited to 'test/document-to-html.tests.js')
| -rw-r--r-- | test/document-to-html.tests.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/document-to-html.tests.js b/test/document-to-html.tests.js index 8d8ae9a..6e61d45 100644 --- a/test/document-to-html.tests.js +++ b/test/document-to-html.tests.js @@ -354,6 +354,23 @@ test('docx hyperlink is converted to <a>', function() { }); }); +test('docx hyperlink can be collapsed', function() { + var hyperlink = new documents.Document([ + new documents.Hyperlink( + [runOfText("Hello ")], + {href: "http://www.example.com"} + ), + new documents.Hyperlink( + [runOfText("world")], + {href: "http://www.example.com"} + ) + ]); + var converter = new DocumentConverter(); + return converter.convertToHtml(hyperlink).then(function(result) { + assert.equal(result.value, '<a href="http://www.example.com">Hello world</a>'); + }); +}); + test('docx hyperlink with anchor is converted to <a>', function() { var hyperlink = new documents.Hyperlink( [runOfText("Hello.")], |
