Eyas / md-heading-id

Support for Heading ID Markdown Extensions
MIT License
17 stars 2 forks source link

Using with remark-lint #3

Closed nzjoel1234 closed 1 year ago

nzjoel1234 commented 1 year ago

I am able to use your plugin with next-mdx-remote like so:

      remarkPlugins: [
        remarkGfm,
        remarkHeadingId,

This works fine and renders to HTML correctly etc.

But when trying to run with remark-lint with the following in my remarkConfig:

    "plugins": [
      "remark-gfm",
      "remark-custom-heading-id",

I am getting error Parsing error: Could not parse expression with acorn: Unexpected character '#'

nzjoel1234 commented 1 year ago

Could this problem be caused by the plugin not being the default export of the package? (i.e. other remark plugins are typically imported like this import remarkGfm from 'remark-grm' whereas this package needs to be imported like this import { remarkHeadingId } from 'remark-custom-heading-id

nzjoel1234 commented 1 year ago

I modified your code inside my node_modules folder and found that adding export default remarkHeadingId; to the end of index.js DID work.

I have not done a pull request before and am not 100% sure of the process and am wondering if I should bother for such a small change?

Are you able to make this change or would you prefer a pull request?

Thanks