From 53e9f9200a781e488830c3c01ff58f50d667a812 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Mon, 6 Jan 2014 22:42:12 +0000 Subject: Allow style map to be an array of styles --- lib/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/index.js b/lib/index.js index 0f45501..bec626c 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1,10 +1,12 @@ var extend = require("xtend"); +var _ = require("underscore"); var docxReader = require("./docx-reader"); var DocumentConverter = require("./document-to-html").DocumentConverter; var style = require("./style-reader").readStyle; exports.convertToHtml = convertToHtml; +exports.style = style; var standardOptions = { styleMap: [ style("p.Heading1 => h1:fresh"), @@ -26,7 +28,7 @@ var standardOptions = { function convertToHtml(input, options) { options = options || {}; - if (options.styleMap) { + if (options.styleMap && _.isString(options.styleMap)) { options.styleMap = options.styleMap.split("\n").map(function(line) { return style(line.trim()); }); -- cgit v1.2.3