aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2014-07-17 19:00:01 +0100
committerMichael Williamson <mike@zwobble.org>2014-07-17 19:00:01 +0100
commit8081ee3564956e1af9ac5d93a25953633f099ef9 (patch)
tree4ba5b5b5965b03b1c18b00fe112ef384c11610fb /tests
parent4457936b892dc622030f22d70935a69456aa3eb6 (diff)
Add mammoth.transforms.paragraph
Diffstat (limited to 'tests')
-rw-r--r--tests/mammoth.tests.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/mammoth.tests.js b/tests/mammoth.tests.js
index 0fcdcf9..a14639d 100644
--- a/tests/mammoth.tests.js
+++ b/tests/mammoth.tests.js
@@ -69,6 +69,21 @@ describe('mammoth', function() {
});
});
+ test('mammoth.transforms.paragraph only transforms paragraphs', function() {
+ var docxFile = createFakeDocxFile({
+ "word/document.xml": testData("simple/word/document.xml")
+ });
+ var options = {
+ transformDocument: mammoth.transforms.paragraph(function(paragraph) {
+ paragraph.styleId = "Heading1";
+ return paragraph;
+ })
+ };
+ return mammoth.convertToHtml({file: docxFile}, options).then(function(result) {
+ assert.equal("<h1>Hello.</h1>", result.value);
+ });
+ });
+
test('inline images are included in output', function() {
var docxPath = path.join(__dirname, "test-data/tiny-picture.docx");
return mammoth.convertToHtml({path: docxPath}).then(function(result) {