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

styleOfPermalinks is not a function #96

Closed
AleksandrHovhannisyan opened this issue Jun 23, 2021 · 2 comments
Closed

styleOfPermalinks is not a function #96

AleksandrHovhannisyan opened this issue Jun 23, 2021 · 2 comments

Comments

@AleksandrHovhannisyan
Copy link

The documentation here:

https://github.com/valeriangalliat/markdown-it-anchor/#permalinks

Says that you can do this:

const anchor = require('markdown-it-anchor')
const md = require('markdown-it')()

md.use(anchor, {
  permalink: anchor.permalink.styleOfPermalink(permalinkOpts)
})

But this throws an error. Is styleOfPermalink not an actual method we can invoke? If not, what is the correct syntax?

Thanks!

@valeriangalliat
Copy link
Owner

Ah yeah I meant styleOfPermalink as a placeholder for any of the permalink methods documented below, but that's not necessarily obvious.

I modified the example to have anchor.permalink[styleOfPermalink](permalinkOpts) to make it more clear that it's a variable, and I added a paragraph below saying it needs to be one of the styles documented afterwards.

Let me know if that heps! Cheers :)

@AleksandrHovhannisyan
Copy link
Author

Ah, that makes sense, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants