Skip to content

Commit

Permalink
Enable loading plugins from .posthtmlrc
Browse files Browse the repository at this point in the history
  • Loading branch information
nsrosenqvist committed Feb 14, 2022
1 parent 2bf4e5c commit cd8bb5d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -45,6 +45,11 @@ module.exports = options => {

// Add plugins to markdownParser
for (const plugin of settings.plugins) {
if (typeof plugin.plugin === 'string') {
let loaded = require(plugin.plugin)
plugin.plugin = loaded.default || loaded;
}

md.use(plugin.plugin, plugin.options || {})
}

0 comments on commit cd8bb5d

Please sign in to comment.