From 76945aec94b352d9f6b5307267f0b085996f4896 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Wed, 8 Apr 2015 18:15:13 +0100 Subject: Make style names in style mappings case insensitive --- tests/document-to-html.tests.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'tests') 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, "

Hello.

"); + }); + }); + test('can use non-default HTML element for unstyled paragraphs', function() { var document = new documents.Document([ paragraphOfText("Hello.") -- cgit v1.2.3