You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
1.3 KiB
41 lines
1.3 KiB
// Generated by CoffeeScript 1.4.0
|
|
var __hasProp = {}.hasOwnProperty,
|
|
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
|
|
|
|
module.exports = function(BasePlugin) {
|
|
var MarkedPlugin;
|
|
return MarkedPlugin = (function(_super) {
|
|
|
|
__extends(MarkedPlugin, _super);
|
|
|
|
function MarkedPlugin() {
|
|
return MarkedPlugin.__super__.constructor.apply(this, arguments);
|
|
}
|
|
|
|
MarkedPlugin.prototype.name = 'marked';
|
|
|
|
MarkedPlugin.prototype.config = {
|
|
markedOptions: {
|
|
pedantic: false,
|
|
gfm: true,
|
|
sanitize: false,
|
|
highlight: null
|
|
}
|
|
};
|
|
|
|
MarkedPlugin.prototype.render = function(opts, next) {
|
|
var config, inExtension, marked, outExtension;
|
|
config = this.config;
|
|
inExtension = opts.inExtension, outExtension = opts.outExtension;
|
|
if ((inExtension === 'md' || inExtension === 'markdown') && (outExtension === null || outExtension === 'html')) {
|
|
marked = require('marked');
|
|
marked.setOptions(config.markedOptions);
|
|
opts.content = marked(opts.content);
|
|
}
|
|
return next();
|
|
};
|
|
|
|
return MarkedPlugin;
|
|
|
|
})(BasePlugin);
|
|
};
|