From 0ee1ecbc9fc22b63ca76fce6434f7c976fae77e1 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Mon, 6 May 2013 13:44:29 +0100 Subject: Use standardOptions if no options are specified --- lib/index.js | 4 ++-- tests/mammoth.tests.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/index.js b/lib/index.js index 8496c4c..24a0996 100644 --- a/lib/index.js +++ b/lib/index.js @@ -9,7 +9,7 @@ exports.convertToHtml = convertToHtml; exports.read = read; exports.convertDocumentToHtml = convertDocumentToHtml; exports.htmlPaths = htmlPaths; -exports.standardOptions = { +var standardOptions = exports.standardOptions = { styleMap: [ style("p.Heading1 => h1"), style("p.Heading2 => h2"), @@ -29,7 +29,7 @@ exports.standardOptions = { }; function Converter(options) { - this._options = options; + this._options = options || standardOptions; } Converter.prototype.convertToHtml = function(inputOptions) { diff --git a/tests/mammoth.tests.js b/tests/mammoth.tests.js index 6f348c2..3a7eabb 100644 --- a/tests/mammoth.tests.js +++ b/tests/mammoth.tests.js @@ -71,7 +71,7 @@ describe('mammoth', function() { }); test('simple list is converted to list elements', function() { - var converter = new mammoth.Converter(mammoth.standardOptions); + var converter = new mammoth.Converter(); var docxPath = path.join(__dirname, "test-data/simple-list.docx"); return converter.convertToHtml({path: docxPath}).then(function(result) { assert.equal(result.value, ''); -- cgit v1.2.3