Replies: 4 comments 4 replies
-
Beta Was this translation helpful? Give feedback.
-
@1chooo Thank you for the detailed description and reproduction I first thought the problem might be the combination of Rehype-raw with the alerts plugin, so I removed it from your example but the class was still missing, then I removed your configuration and the title class was back, that's when I noticed that one of your MDX components was removing paragraphs around images, and that code did not give the paragraph its props back: p: (props) => {
const { node, children, ...rest } = props;
const hasImage = node && node.children && node.children.some(isImageNode);
if (hasImage) {
return <>{children}</>;
}
return <p {...rest}>{children}</p>;
}, if you change the code to something like this, where the "rest" props get passed back to the parapraph, then your problem should be fixed |
Beta Was this translation helpful? Give feedback.
-
Hi @chrisweb Thank you so much for your help with this bug! This issue was caused by the logic I previously wrote for rendering. I've now implemented a solution, and I'd like to credit your efforts in this commit. Could you share your GitHub username and the email associated with your account? Thanks again for all your support—it means a lot! |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
My Setting:
And also paste the css code from your post GitHub-like alerts using the rehype-github-alerts plugin#styling-rehype-github-alerts
Here is my
next.config.mjs
:Screenshots
Here is the rendered
HTML
:We can find that
markdown-alert-title
is loss; therefore, it didn't render the color.Expected:
We should find that
markdown-alert-title
is contain in themarkdown-alert markdown-alert-note
, or maybe we don't contain<p>
under themarkdown-alert markdown-alert-note
Beta Was this translation helpful? Give feedback.
All reactions