forked from thomsbg/convert-rich-text
-
Notifications
You must be signed in to change notification settings - Fork 7
/
index.js
21 lines (20 loc) · 870 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
var JSDOM = require('jsdom').JSDOM;
var toHtml = require('./lib/export/to_html');
var toInlineHtml = require('./lib/export/to_inline_html');
var toPublicHtml = require('./lib/export/to_public_html');
var toPlaintext = require('./lib/export/to_plaintext');
module.exports = {
toHtml: function(delta, formats, options) {
options = Object.assign({}, options, { document: new JSDOM().window.document });
return toHtml(delta, formats, options);
},
toInlineHtml: function(delta, formats, options) {
options = Object.assign({}, options, { document: new JSDOM().window.document });
return toInlineHtml(delta, formats, options);
},
toPublicHtml: function(delta, formats, options) {
options = Object.assign({}, options, { document: new JSDOM().window.document });
return toPublicHtml(delta, formats, options);
},
toPlaintext: toPlaintext
};