feat(v2): allow specifying of remark and rehype plugins before default plugins (#2689)

* feat(v2): swap order of markdown plugins

* feat(v2): remark/rehype plugins can override default plugins
This commit is contained in:
Kasper Bøgebjerg Pedersen 2020-05-23 00:07:01 +02:00 committed by GitHub
parent 0ff6dd31f4
commit 0e61da8f69
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -27,10 +27,12 @@ module.exports = async function (fileString) {
const options = {
...reqOptions,
remarkPlugins: [
...(reqOptions.beforeDefaultRemarkPlugins || []),
...DEFAULT_OPTIONS.remarkPlugins,
...(reqOptions.remarkPlugins || []),
],
rehypePlugins: [
...(reqOptions.beforeDefaultRehypePlugins || []),
...DEFAULT_OPTIONS.rehypePlugins,
...(reqOptions.rehypePlugins || []),
],