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

Support for using processors #17

Closed
wooorm opened this issue Oct 2, 2016 · 0 comments
Closed

Support for using processors #17

wooorm opened this issue Oct 2, 2016 · 0 comments
Labels
🗄 area/interface This affects the public interface 💪 phase/solved Post is done 🧒 semver/minor This is backwards-compatible change 🦋 type/enhancement This is great to have

Comments

@wooorm
Copy link
Member

wooorm commented Oct 2, 2016

Take the following example:

var prose = unified()
  .use(retextParse)
  .use(equality)
  .use(quotes)

var html = unified()
  .use(minify)
  .use(rehypeStringify)

var markdown = unified()
  .use(remarkParse)
  .use(remark2retext, prose)
  .use(lint, {rules: {/*...*/}})
  .use(remark2rehype)
  .use(html)

Currently, the last line doesn’t work, we have to replace it with:

  .use(minify)
  .use(rehypeStringify)

...which is okay for two lines but when using many plugins it becomes
cumbersome, and hampers reusability.

If passing a processor to use would be supported we walk into a new
problem though: the given processor, if it has a parser or compiler,
would overwrite the origin parser/compiler with them. That’s OK for
the compiler (I think?) but not for the parser.

@wooorm wooorm added 🦋 type/enhancement This is great to have 🙉 open/needs-info This needs some more info labels Oct 2, 2016
@wooorm wooorm closed this as completed in 39fa4b5 Oct 10, 2016
@wooorm wooorm added ⛵️ status/released 🗄 area/interface This affects the public interface 🧒 semver/minor This is backwards-compatible change and removed 🙉 open/needs-info This needs some more info labels Aug 10, 2019
@wooorm wooorm added the 💪 phase/solved Post is done label May 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🗄 area/interface This affects the public interface 💪 phase/solved Post is done 🧒 semver/minor This is backwards-compatible change 🦋 type/enhancement This is great to have
Development

No branches or pull requests

1 participant