Skip to content

Commit

Permalink
Merge pull request #17 from OpportunityLiu/patch-1
Browse files Browse the repository at this point in the history
Update renderer.js
  • Loading branch information
CHENXCHEN authored Aug 27, 2018
2 parents e1f7dc6 + 37cd3b4 commit 72bd987
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,11 @@ module.exports = function(data, options) {
return md.use(require('./markdown-it-toc-and-anchor/index.js').default, pugs.options);
}
else {
if(pugs.options) return md.use(require(pugs.name), pugs.options);
else return md.use(require(pugs.name));
let plugin = require(pugs.name);
if(typeof plugin !== 'function' && typeof plugin.default === 'function')
plugin = plugin.default;
if(pugs.options) return md.use(plugin, pugs.options);
else return md.use(plugin);
}
}
else return md;
Expand Down

0 comments on commit 72bd987

Please sign in to comment.