From 0f90a6de310fd86472c29e945f06fe94c666fa2c Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Fri, 29 Mar 2013 21:04:09 +0000 Subject: Add styles with nested elements --- tests/documents.tests.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tests/documents.tests.js') diff --git a/tests/documents.tests.js b/tests/documents.tests.js index b9fe15a..629e0da 100644 --- a/tests/documents.tests.js +++ b/tests/documents.tests.js @@ -51,6 +51,20 @@ describe('DocumentConverter', function() { assert.equal("

Hello.

", result.html); }); }); + + test('can use stacked styles to generate nested HTML elements', function() { + var document = new documents.Document([ + paragraphOfText("Hello.", "Heading1") + ]); + var converter = new DocumentConverter({ + paragraphStyleMap: { + "Heading1": styles.elements(["h1", "span"]) + } + }); + return converter.convertToHtml(document).then(function(result) { + assert.equal("

Hello.

", result.html); + }); + }); }); function paragraphOfText(text, styleName) { -- cgit v1.2.3