diff options
| author | Michael Williamson <mike@zwobble.org> | 2015-04-08 18:15:13 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2015-04-08 18:15:13 +0100 |
| commit | 76945aec94b352d9f6b5307267f0b085996f4896 (patch) | |
| tree | 4610e468d6fe6763e57c015101922edf21735b3d /tests | |
| parent | 16ab27a56d70e84e6c029cfdf77ea822a5a78da8 (diff) | |
Make style names in style mappings case insensitive
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/document-to-html.tests.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/document-to-html.tests.js b/tests/document-to-html.tests.js index 41b8129..5a271d0 100644 --- a/tests/document-to-html.tests.js +++ b/tests/document-to-html.tests.js @@ -78,6 +78,23 @@ describe('DocumentConverter', function() { }); }); + test('mappings for style names are case insensitive', function() { + var document = new documents.Document([ + paragraphOfText("Hello.", "Heading1", "heading 1"), + ]); + var converter = new DocumentConverter({ + styleMap: [ + { + from: documentMatchers.paragraph({styleName: "Heading 1"}), + to: htmlPaths.topLevelElement("h1") + } + ] + }); + return converter.convertToHtml(document).then(function(result) { + assert.equal(result.value, "<h1>Hello.</h1>"); + }); + }); + test('can use non-default HTML element for unstyled paragraphs', function() { var document = new documents.Document([ paragraphOfText("Hello.") |
