Closed stereobooster closed 2 months ago
I've sent a fix for this, however there's a bug in @beoe/rehype-mermaid
that is injecting root hast nodes inside a tree, which is incorrect following the spec:
Root can be used as the root of a tree, or as a value of the content field on a 'template' Element, never as a child.
And it trips up the MDX optimization as it didn't expect this case. However, since MDX still handles fine with it, I fixed it anyway to not cause any inconsistencies.
Still, it would be best if you update your plugin to not inject the root node. You can take its children and inject that instead. I tested with the main rehype-mermaid
package and it didn't have this issue.
Root can be used as the root of a tree, or as a value of the content field on a 'template' https://github.com/withastro/astro/issues/11971#element, never as a child.
Makes sense. Thanks for pointing out this issue - I will fix it
Astro Info
If this issue only occurs in one browser, which browser is a problem?
n/a
Describe the Bug
When mdx optimization turned on (default in starlight 0.23+) it seems it doesn't correctly render tag in MDX
I know that documentation says that it may break behavior of custom tags. But I think in this specific case this is a bug - all html is there, it just "forgot" to move content from
set:html
inside the tagRelated https://github.com/stereobooster/beoe/issues/2
What's the expected result?
So it would actually output contents from
set:html
inside the tagLink to Minimal Reproducible Example
https://github.com/jarodtaylor/starlight-mermaid
Participation