diff options
| author | Michael Williamson <mike@zwobble.org> | 2013-05-06 13:44:29 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2013-05-06 13:44:29 +0100 |
| commit | 0ee1ecbc9fc22b63ca76fce6434f7c976fae77e1 (patch) | |
| tree | 1bcd7a47892ecead15abd1da2f5d7c4e956471bd | |
| parent | 4ef34968c720c58c419ee18f0897645049175d7c (diff) | |
Use standardOptions if no options are specified
| -rw-r--r-- | lib/index.js | 4 | ||||
| -rw-r--r-- | 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, '<ul><li>Apple</li><li>Banana</li></ul>'); |
