You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given this has, Shiki replaces the pre element with a newly generated pre element. In this process the node’s data and properties are lost. It would be nice if Shiki keeps this information, so that other rehype plugins, such as rehype-mdx-code-props can use it. Likewise it could even be useful to preserve positional information, which is used for example by React devtools.
Clear and concise description of the problem
With
remark-rehype
/ MDX, the following markdown:generates the following hast:
Given this has, Shiki replaces the
pre
element with a newly generatedpre
element. In this process the node’sdata
andproperties
are lost. It would be nice if Shiki keeps this information, so that other rehype plugins, such asrehype-mdx-code-props
can use it. Likewise it could even be useful to preserve positional information, which is used for example by React devtools.Suggested solution
It looks like some logic is needed in https://github.com/shikijs/shiki/blob/main/packages/core/src/code-to-hast.ts to be able to handle an existing
pre
andcode
element.Alternative
No response
Additional context
No response
Validations
Contributes
The text was updated successfully, but these errors were encountered: