From 3433c9bfcc62c095d96af81df9a742e98b582715 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sat, 2 Apr 2016 17:56:07 +0100 Subject: Change document transforms to create copies of elements --- tests/mammoth.tests.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/mammoth.tests.js b/tests/mammoth.tests.js index 801bb02..ad71539 100644 --- a/tests/mammoth.tests.js +++ b/tests/mammoth.tests.js @@ -1,6 +1,7 @@ var assert = require("assert"); var path = require("path"); var fs = require("fs"); +var _ = require("underscore"); var mammoth = require("../"); var promises = require("../lib/promises"); @@ -156,8 +157,7 @@ describe('mammoth', function() { }); var options = { transformDocument: mammoth.transforms.paragraph(function(paragraph) { - paragraph.styleId = "Heading1"; - return paragraph; + return _.extend(paragraph, {styleId: "Heading1"}); }) }; return mammoth.convertToHtml({file: docxFile}, options).then(function(result) { -- cgit v1.2.3