We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi, I'm dealing with a strange behavior: if I set a shortcode like this:
const shortcodes = { "cc-image": Image, } <MDXProvider components={shortcodes}> <MDXRenderer>{data.post.body}</MDXRenderer> </MDXProvider>
and I use it self-closed
# Title Paragraph <cc-image />
the rendered html is like:
<h1>Title</h1> <p>Paragraph</p> <div class='image'></div>
if I use the same component but not self-closed, the final html include an extra wrapper paragraph for the component itself:
# Title Paragraph <cc-image></cc-image>
<h1>Title</h1> <p>Paragraph</p> <p> <div class='image'></div> </p>
Even if not self-closed the component must not be wrapped in an extra paragraph.
I don't know why but it happens only if the shortcoded tag includes an hyphen :-/
The text was updated successfully, but these errors were encountered:
Thanks for reporting! This looks like a bug in the remark tokenization.
Sorry, something went wrong.
Also, strangely enough, if there's a newline between the open and close tag it is parsed they way we'd expect:
# Title Paragraph <cc-image> </cc-image>
Weird indeed! This will be fixed in 2.0.0 as we’re rewriting the parser to solve amongst other things, this problem!
I’ve confirmed this is indeed fixed in the v2 prerelease, so going to go ahead and close this.
If you want to give it a shot now: @mdx-js/mdx@next.
@mdx-js/mdx@next
Successfully merging a pull request may close this issue.
Subject of the issue
Hi, I'm dealing with a strange behavior: if I set a shortcode like this:
and I use it self-closed
the rendered html is like:
if I use the same component but not self-closed, the final html include an extra wrapper paragraph for the component itself:
the rendered html is like:
Expected behaviour
Even if not self-closed the component must not be wrapped in an extra paragraph.
I don't know why but it happens only if the shortcoded tag includes an hyphen :-/
The text was updated successfully, but these errors were encountered: