From 8081ee3564956e1af9ac5d93a25953633f099ef9 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Thu, 17 Jul 2014 19:00:01 +0100 Subject: Add mammoth.transforms.paragraph --- tests/mammoth.tests.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tests') 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("

Hello.

", 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) { -- cgit v1.2.3