diff options
| author | Michael Williamson <mike@zwobble.org> | 2013-03-29 21:04:09 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2013-03-29 21:04:09 +0000 |
| commit | 0f90a6de310fd86472c29e945f06fe94c666fa2c (patch) | |
| tree | 1005bc92e87240fe4e6be5235bad494a9f09ac44 /tests/documents.tests.js | |
| parent | 33c8de2a7b6162e6e0dac8c4d5888317776c7ecf (diff) | |
Add styles with nested elements
Diffstat (limited to 'tests/documents.tests.js')
| -rw-r--r-- | tests/documents.tests.js | 14 |
1 files changed, 14 insertions, 0 deletions
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("<h1>Hello.</h1>", 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("<h1><span>Hello.</span></h1>", result.html); + }); + }); }); function paragraphOfText(text, styleName) { |
