diff options
| author | Michael Williamson <mike@zwobble.org> | 2015-06-17 15:40:21 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2015-06-17 15:40:21 +0100 |
| commit | a52d99fd85061a9f20b481535407a225d5927434 (patch) | |
| tree | 6cea0c2d11a263a959df251eb7be1af2455b6440 /tests/document-to-html.tests.js | |
| parent | dc53892204989de1788081624c65062dc283480a (diff) | |
Allow strikethrough to be configured in style mapping
Diffstat (limited to 'tests/document-to-html.tests.js')
| -rw-r--r-- | tests/document-to-html.tests.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/document-to-html.tests.js b/tests/document-to-html.tests.js index 02079cd..2088f12 100644 --- a/tests/document-to-html.tests.js +++ b/tests/document-to-html.tests.js @@ -210,6 +210,21 @@ describe('DocumentConverter', function() { }); }); + test('strikethrough runs can be configured with style mapping', function() { + var run = runOfText("Hello.", {isStrikethrough: true}); + var converter = new DocumentConverter({ + styleMap: [ + { + from: documentMatchers.strikethrough, + to: htmlPaths.elements([htmlPaths.element("del")]) + } + ] + }); + return converter.convertToHtml(run).then(function(result) { + assert.equal(result.value, "<del>Hello.</del>"); + }); + }); + test('style mapping for underline runs does not close parent elements', function() { var run = runOfText("Hello.", {isUnderline: true, isBold: true}); var converter = new DocumentConverter({ |
