summaryrefslogtreecommitdiffstats
path: root/lib/plugin.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2015-01-29 14:09:27 +0100
committerSamy Pessé <samypesse@gmail.com>2015-01-29 14:09:27 +0100
commit2bec7c5e10274b260faea3e007b056c19760cc6e (patch)
tree7c16616115430b151093e634afe3e66b8341ffe1 /lib/plugin.js
parent907ce6dbcdbebd59f4ce5a43073b0dd68056d6c2 (diff)
downloadgitbook-2bec7c5e10274b260faea3e007b056c19760cc6e.zip
gitbook-2bec7c5e10274b260faea3e007b056c19760cc6e.tar.gz
gitbook-2bec7c5e10274b260faea3e007b056c19760cc6e.tar.bz2
Add option to block to not parse output
Diffstat (limited to 'lib/plugin.js')
-rw-r--r--lib/plugin.js31
1 files changed, 1 insertions, 30 deletions
diff --git a/lib/plugin.js b/lib/plugin.js
index 2af81c6..995385a 100644
--- a/lib/plugin.js
+++ b/lib/plugin.js
@@ -103,36 +103,7 @@ Plugin.prototype.getResources = function(base) {
// Normalize filters and return them
Plugin.prototype.getFilters = function() {
- var that = this;
-
- return _.chain(this.infos.filters || {})
- .map(function(func, key) {
- if (!_.isString(key)) {
- that.book.log.warn.ln("Invalid filter '"+key+"' in plugin '"+that.name+"'");
- return null;
- }
-
- return [
- key,
- function() {
- var ctx = {
- ctx: this.ctx,
- book: that.book
- };
- var args = Array.prototype.slice.apply(arguments);
- var callback = _.last(args);
-
- Q()
- .then(function() {
- return func.apply(ctx, args.slice(0, -1));
- })
- .nodeify(callback);
- }
- ];
- })
- .compact()
- .object()
- .value();
+ return this.infos.filters || {};
};
// Normalize blocks and return them