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

TypeError: c.attrGet is not a function #122

Open
NigelvanDuijvendijk opened this issue Jan 23, 2023 · 1 comment
Open

TypeError: c.attrGet is not a function #122

NigelvanDuijvendijk opened this issue Jan 23, 2023 · 1 comment

Comments

@NigelvanDuijvendijk
Copy link

NigelvanDuijvendijk commented Jan 23, 2023

Im trying to use markdown-it-anchor in a typescript react application but im getting the following error:
TypeError: c.attrGet is not a function

Im using it as followed:

const mdParser = MarkdownIt().use(markdownItAnchor, {
		permalink: true,
		permalinkBefore: true,
		permalinkSymbol: "", // §
	});

This error only pops up when there is a heading in the markdown.
image

@valeriangalliat
Copy link
Owner

Hey! If you still have this issue, it would help me to debug if you could come up with a runnable example that reproduces the problem :)

Here's what I tried so far:

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

const md = mdit().use(anchor, {
  permalink: true,
  permalinkBefore: true,
  permalinkSymbol: "",
})

console.log(md.render('# foo'))
{
  "dependencies": {
    "markdown-it": "^13.0.1",
    "markdown-it-anchor": "^8.6.6"
  }
}

But this code returns the HTML without exception

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