diff options
| author | Michael Williamson <mike@zwobble.org> | 2020-11-05 19:35:33 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2020-11-05 19:35:33 +0000 |
| commit | f7cfac642bf63fac77c99d4cc30601ded8b2c107 (patch) | |
| tree | 771fee9fc5c43e54f94a4f6bb7475edec50cda8e /test/document-to-html.tests.js | |
| parent | e832f604e34d344d996f8101023b6272085f934c (diff) | |
Add style mapping for all caps
Diffstat (limited to 'test/document-to-html.tests.js')
| -rw-r--r-- | test/document-to-html.tests.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/document-to-html.tests.js b/test/document-to-html.tests.js index 6e61d45..4283e86 100644 --- a/test/document-to-html.tests.js +++ b/test/document-to-html.tests.js @@ -296,6 +296,30 @@ test('subscript runs are wrapped in <sub> tags', function() { }); }); +test('all caps runs are ignored by default', function() { + var run = runOfText("Hello.", {isAllCaps: true}); + var converter = new DocumentConverter(); + return converter.convertToHtml(run).then(function(result) { + assert.equal(result.value, "Hello."); + }); +}); + +test('all caps runs can be configured with style mapping', function() { + var run = runOfText("Hello.", {isAllCaps: true}); + var converter = new DocumentConverter({ + styleMap: [ + { + from: documentMatchers.allCaps, + to: htmlPaths.elements([htmlPaths.element("span")]) + } + ] + }); + return converter.convertToHtml(run).then(function(result) { + assert.equal(result.value, "<span>Hello.</span>"); + }); +}); + + test('small caps runs are ignored by default', function() { var run = runOfText("Hello.", {isSmallCaps: true}); var converter = new DocumentConverter(); |
