aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2014-09-27 17:11:03 +0100
committerMichael Williamson <mike@zwobble.org>2014-09-27 17:11:03 +0100
commita8ea510e657bb9221ad724f9d0184b045e06fb1b (patch)
tree77cc0d11f836750081ff38187df03aac4cd428dd /tests
parent92be647aab6949d504f60a54099454e527009cf7 (diff)
Convert superscript and subscript to sup and sub elements
Diffstat (limited to 'tests')
-rw-r--r--tests/document-to-html.tests.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/document-to-html.tests.js b/tests/document-to-html.tests.js
index ddc2e17..a1c7a61 100644
--- a/tests/document-to-html.tests.js
+++ b/tests/document-to-html.tests.js
@@ -174,6 +174,26 @@ describe('DocumentConverter', function() {
});
});
+ test('superscript runs are wrapped in <sup> tags', function() {
+ var run = runOfText("Hello.", {
+ verticalAlignment: documents.verticalAlignment.superscript
+ });
+ var converter = new DocumentConverter();
+ return converter.convertToHtml(run).then(function(result) {
+ assert.equal(result.value, "<sup>Hello.</sup>");
+ });
+ });
+
+ test('subscript runs are wrapped in <sub> tags', function() {
+ var run = runOfText("Hello.", {
+ verticalAlignment: documents.verticalAlignment.subscript
+ });
+ var converter = new DocumentConverter();
+ return converter.convertToHtml(run).then(function(result) {
+ assert.equal(result.value, "<sub>Hello.</sub>");
+ });
+ });
+
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({