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

Language not registered error #73

Open
adamyonk opened this issue Jan 3, 2025 · 2 comments
Open

Language not registered error #73

adamyonk opened this issue Jan 3, 2025 · 2 comments

Comments

@adamyonk
Copy link

adamyonk commented Jan 3, 2025

I'm trying to use in a chain like:

export default async function markdownToHtml(markdown: string) {
  const result = await unified()
    .use(remarkParse)
    .use(remarkRehype, { allowDangerousHtml: true })
    .use(rehypeRaw)
    .use(rehypePrismPlus)
    .use(rehypeStringify)
    .process(markdown);
  return result.toString();
}

And I'm getting an error: Unknown language: `html` is not registered, even though it's in the list of default refractor languages. Am I doing something wrong?

@timlrx
Copy link
Owner

timlrx commented Jan 5, 2025

It should work. I have tested it with my simple test set up - https://github.com/timlrx/rehype-prism-plus/blob/main/test.js#L35-L44 and my blog config.

@hashirshoaeb
Copy link

I'm getting same error when i run my application with npm run dev.
But when i use launch.json to run the app. it somehow doesnot throw error and renders properly.

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

3 participants