aboutsummaryrefslogtreecommitdiff
path: root/test/document-to-html.tests.js
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2017-07-21 12:05:29 +0100
committerGitHub <noreply@github.com>2017-07-21 12:05:29 +0100
commit2107916e9f5ac9288f69f09048cb992ec7ab92b4 (patch)
tree40b6f218fbbac7782effb8b0ab1255b3e773a315 /test/document-to-html.tests.js
parent534f62e0684af52766adf82b8fd5dbf796e018db (diff)
parent33f089bb9f1d8fa599fe10ba1ddead6c10dbd4b4 (diff)
Merge pull request #124 from vgmoose/master
Add style mapping for small caps
Diffstat (limited to 'test/document-to-html.tests.js')
-rw-r--r--test/document-to-html.tests.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/document-to-html.tests.js b/test/document-to-html.tests.js
index bf6631f..861033b 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('small caps runs are ignored by default', function() {
+ var run = runOfText("Hello.", {isSmallCaps: true});
+ var converter = new DocumentConverter();
+ return converter.convertToHtml(run).then(function(result) {
+ assert.equal(result.value, "Hello.");
+ });
+});
+
+test('small caps runs can be configured with style mapping', function() {
+ var run = runOfText("Hello.", {isSmallCaps: true});
+ var converter = new DocumentConverter({
+ styleMap: [
+ {
+ from: documentMatchers.smallCaps,
+ to: htmlPaths.elements([htmlPaths.element("span")])
+ }
+ ]
+ });
+ return converter.convertToHtml(run).then(function(result) {
+ assert.equal(result.value, "<span>Hello.</span>");
+ });
+});
+
+
test('run styles are converted to HTML if mapping exists', function() {
var run = runOfText("Hello.", {styleId: "Heading1Char", styleName: "Heading 1 Char"});
var converter = new DocumentConverter({