cryptpad/www/code/export.js

18 lines
533 B
JavaScript
Raw Normal View History

2018-10-18 16:50:38 +00:00
// This file is used when a user tries to export the entire CryptDrive.
// Pads from the code app will be exported using this format instead of plain text.
define([
'/common/sframe-common-codemirror.js',
], function (SFCodeMirror) {
var module = {};
module.main = function (userDoc, cb) {
var mode = userDoc.highlightMode || 'gfm';
var content = userDoc.content;
module.ext = SFCodeMirror.getContentExtension(mode);
2018-10-18 16:50:38 +00:00
cb(SFCodeMirror.fileExporter(content));
};
return module;
});