From 137f9e20d36df58590dedad6f0ab885ed435e2dd Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Thu, 25 Feb 2016 19:28:11 +0000 Subject: Allow italic runs to be configured using style mapping --- tests/document-to-html.tests.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tests') diff --git a/tests/document-to-html.tests.js b/tests/document-to-html.tests.js index 779c584..2b23613 100644 --- a/tests/document-to-html.tests.js +++ b/tests/document-to-html.tests.js @@ -263,6 +263,21 @@ describe('DocumentConverter', function() { }); }); + test('italic runs can be configured with style mapping', function() { + var run = runOfText("Hello.", {isItalic: true}); + var converter = new DocumentConverter({ + styleMap: [ + { + from: documentMatchers.italic, + to: htmlPaths.elements([htmlPaths.element("strong")]) + } + ] + }); + return converter.convertToHtml(run).then(function(result) { + assert.equal(result.value, "Hello."); + }); + }); + test('run can be both bold and italic', function() { var run = runOfText("Hello.", {isBold: true, isItalic: true}); var converter = new DocumentConverter(); -- cgit v1.2.3