Inline JSX components aren't preserving the whitespace in MDX
Hi, I have a static website that uses JSX components for inline elements. This is the HTML I'm returning:
The idea is to then use this component in an MDX file like so:
The issue here is that I can't seem to find a way to get a satisfactory spacing in both cases.
The current code seems to remove any space following the inline component, which works fine for when the
<Component>
is followed by a punctuation mark or by a plural 's', but it makes the text unreadable when its followed by actual words.
I tried adding a margin-right, or a non-breaking space, but doing that breaks the other way around (the text becomes "Don't focus the Workshop Defender s")
Does anyone have any idea on how to solve it?
1 Reply
It was an issue with rehype-minify
GitHub
GitHub - rehypejs/rehype-minify: plugins to minify HTML
plugins to minify HTML. Contribute to rehypejs/rehype-minify development by creating an account on GitHub.