Closed zoubingwu closed 3 years ago
Thanks for the extensive explanation.
For rendering in MDX, use the wrapFragments
option which will use <div class="shiki-twoslash-fragment">
as wrapper instead of undefined
. You can then set your renderer to replace that div with a React.Fragment
during runtime if you will. It is, in fact, how it's done in the Docusaurus plugin. The tests are fine, but yes I agree we might want to add that to the documentation.
@frencojobs
Cool! Yeah didn't see any docs about wrapFragments
option until now ššš should have checked the typing of options at first but indeed it would be better to add it in documentation.
Thanks for your quick reply! I'll leave this issue here in case any one else having the same problem but feel free to close it as my problem already solved.
just change transpile option in
test/mdx.test.ts
to multiple themestry log one of the result and re-run test
the output:
you can find that those content in two themes wrapped by
pre
tag are inside anundefined
tag, it won't cause any problem affecting the user but react dev tool will throw an error aboutThe tag <undefined> is unrecognized in this browser