-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
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
Custom Elements / Web Components with specific attributes cause the markdown renderer to break #9717
Comments
Here's a minimal reproduction that doesn't require starlight: https://stackblitz.com/edit/github-qdnomy?file=src%2Fpages%2Findex.md |
Custom elements are not required here, was able to reduce down to just this:
|
There's an underlying issue with the rehype stack: syntax-tree/hast-util-raw#22 Will need to see if I can fix this there. |
There's another discussion about this same bug here: syntax-tree/hastscript#21 |
@matthewp thanks for digging in! much appreciated. Are there any workarounds for this? Such as modifying the AST directly in a remark plugin or something? EDIT: on second look, it appears I may just |
Yeah, that's what i would do if it's urgent. Another would be to add a script to dynamically add the |
Underlying issue was fixed in syntax-tree/hastscript@8a5f97e released as a major so I think we need to do some upgrading to see it here, in Astro. |
@matthewp thanks for the help! |
hastscript has been updated, but the parent modules that depend on it have not, so we cannot yet upgrade. Since we have automation for upgrading packages I'm going to close this issue as its now out of our hands. |
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
When you use a custom element that looks like this:
EDIT: specifically this seems to be the problem:
inside of a
.md
file, the markdown rendering pipeline results in a unhandled rejection.Stack Trace:
What's the expected result?
I expect Astro to handle custom elements and render them as normal HTML and not error.
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-rfy1xs-ea1byz?file=src%2Fcontent%2Fdocs%2Findex.md
Participation
The text was updated successfully, but these errors were encountered: