aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2016-02-25 19:28:11 +0000
committerMichael Williamson <mike@zwobble.org>2016-02-25 19:28:11 +0000
commit137f9e20d36df58590dedad6f0ab885ed435e2dd (patch)
tree7d333ed45fd5a60d2f8837bf32561aecc07ca714 /tests
parent63dff589c822e8256ff8e6b38f78e696ba734c44 (diff)
Allow italic runs to be configured using style mapping
Diffstat (limited to 'tests')
-rw-r--r--tests/document-to-html.tests.js15
1 files changed, 15 insertions, 0 deletions
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, "<strong>Hello.</strong>");
+ });
+ });
+
test('run can be both bold and italic', function() {
var run = runOfText("Hello.", {isBold: true, isItalic: true});
var converter = new DocumentConverter();