Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use plugins key recursively in mdastrc(5) #99

Closed
iamstarkov opened this issue Dec 1, 2015 · 4 comments
Closed

Cannot use plugins key recursively in mdastrc(5) #99

iamstarkov opened this issue Dec 1, 2015 · 4 comments

Comments

@iamstarkov
Copy link

so basically if mdast plugin also has plugins=["foo", "bar"] option, then merge function and check for PLUGIN_KEY=plugins will turn them to plugins={ foo: null, bar: null }

.mdastrc:

{
    "plugins": {
        "mdast-demo": {
            "plugins": [ "foo", "bar" ], 
            "plugins2": [ "foo", "bar" ]
        }
    }
}

mdast-demo:

module.exports = function attacher(processor, options) {
  return function transformer(ast) {
    console.log('plugins', options.plugins);
    console.log('plugins2', options.plugins2);
  };
};

log:

plugins { foo: null, bar: null }
plugins2 [ 'foo', 'bar' ]
@iamstarkov
Copy link
Author

I found this bug while was debugging mdast-textr in the pl repo

@iamstarkov
Copy link
Author

I tried to fix it on my own, but merge is too complicated for me, sorry(

@wooorm
Copy link
Member

wooorm commented Dec 1, 2015

Thanks for raising the issue, @iamstarkov!

@iamstarkov
Copy link
Author

no problem =)

@wooorm wooorm changed the title problems with check for PLUGIN_KEY in merge in lib/cli/configuration.js Cannot use plugins key recursively in mdastrc(5) Dec 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants