diff options
author | Samy Pessé <samypesse@gmail.com> | 2016-02-22 15:34:35 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-02-22 15:34:35 +0100 |
commit | 6653307fda137253cd10d4d4f6d2e010c1c0f604 (patch) | |
tree | 754d73e1dadc19e692bfce468e674cd66eff8a0a /lib/plugins/plugin.js | |
parent | 642ba72a1d0680107357083a79560c2ccc931457 (diff) | |
download | gitbook-6653307fda137253cd10d4d4f6d2e010c1c0f604.zip gitbook-6653307fda137253cd10d4d4f6d2e010c1c0f604.tar.gz gitbook-6653307fda137253cd10d4d4f6d2e010c1c0f604.tar.bz2 |
Add tests for context of filters
Diffstat (limited to 'lib/plugins/plugin.js')
-rw-r--r-- | lib/plugins/plugin.js | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/lib/plugins/plugin.js b/lib/plugins/plugin.js index 0fbbab1..4901579 100644 --- a/lib/plugins/plugin.js +++ b/lib/plugins/plugin.js @@ -270,10 +270,7 @@ BookPlugin.prototype.getFilters = function() { return _.mapValues(this.content.filters || {}, function(fn, filter) { return function() { - var ctx = _.extend( - this, - pluginCtx(that) - ); + var ctx = _.extend(pluginCtx(that), this); return fn.apply(ctx, arguments); }; @@ -289,10 +286,7 @@ BookPlugin.prototype.getBlocks = function() { var fn = block.exec; block.exec = function() { - var ctx = _.extend( - this, - pluginCtx(that) - ); + var ctx = _.extend(pluginCtx(that), this); return fn.apply(ctx, arguments); }; |