diff options
| author | Michael Williamson <mike@zwobble.org> | 2014-04-10 14:26:32 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2014-04-10 14:26:32 +0100 |
| commit | 8fcdf02810e5880fe58d1308c80142cbc936c9e3 (patch) | |
| tree | 85e19a1f3985b21661c8af657e2d1c7521ad4891 /tests | |
| parent | dee75b1261646edb99ae01a231036fd9c468fe83 (diff) | |
Indent text with newlines inside indented elements
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/html-writer.tests.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/html-writer.tests.js b/tests/html-writer.tests.js index 2a22caf..dc6cb1c 100644 --- a/tests/html-writer.tests.js +++ b/tests/html-writer.tests.js @@ -50,4 +50,12 @@ describe('html-writer', function() { writer.close("div"); return assert.equal(writer.asString(), "<div>\n <div>\n <div>\n Hello\n </div>\n </div>\n</div>"); }); + + test('newlines in text are indented', function() { + var writer = htmlWriter.writer({prettyPrint: true}); + writer.open("p"); + writer.text("One\nTwo"); + writer.close("p"); + return assert.equal(writer.asString(), "<p>\n One\n Two\n</p>"); + }); }) |
