Row of `language-*` on a single `code` element
piscopancer opened this issue · comments
piscopancer commented
Validations
- Follow our Code of Conduct
- Read the Contributing Guide.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Describe the bug
shiki is used on the server as a rehype plugin
my config
export const rehypeShikiOptions = {
themes: { light: theme },
langs,
addLanguageClass: true,
} satisfies RehypeShikiOptions
then it is used in MDX remote server component
import { rehypeShikiOptions } from '@/app/shiki'
import shiki from '@shikijs/rehype'
import { MDXRemote } from 'next-mdx-remote/rsc'
import remarkGfm from 'remark-gfm'
import remarkUnwrapImages from 'remark-unwrap-images'
import { components } from '.'
export function ServerMDX(props: { text: string }) {
return (
<MDXRemote
source={props.text}
options={{
mdxOptions: {
remarkPlugins: [remarkGfm, remarkUnwrapImages],
rehypePlugins: [[shiki, rehypeShikiOptions]],
},
}}
components={components}
/>
)
}
I did not do any sort of modifications, however when there are more than 1 code blocks in my md/mdx, shiki decides to apply multiple languages to a single code
element
Reproduction
Contributes
- I am willing to submit a PR to fix this issue
- I am willing to submit a PR with failing tests
Anthony Fu commented
We temporarily closed this due to the lack of enough information. We could not identify whether it was a bug or a userland misconfiguration with the given info.
Please provide a minimal reproduction to reopen the issue.
Thanks.