From 6eb8f4d1dfcabcd0d1cc8dd1300f6b46b78fe8f4 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sun, 3 Nov 2019 16:30:24 +0000 Subject: Allow hyperlinks to be collapsed --- test/document-to-html.tests.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'test/document-to-html.tests.js') 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 ', 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, 'Hello world'); + }); +}); + test('docx hyperlink with anchor is converted to ', function() { var hyperlink = new documents.Hyperlink( [runOfText("Hello.")], -- cgit v1.2.3