How to override literal HTML elements with components. #1877
-
I would like to override <kbd>CTRL</kbd> <MDXComponent
components={{
kbd: (props) => <kbd className="bg-gray-300" {...props} />,
}}
/> Unfortunately this doesn't seem to work for me. I would like to keep raw This issue looks to be somewhat related but looking for the opposide behaviour. #821 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Currently not possible. #821 was the reason for the change indeed (before, everything could be changed which sometimes didn’t make sense; after, only markdown can be changed, which is sometimes not powerful enough but at least isn’t unexpected).
I’m open to solutions in |
Beta Was this translation helpful? Give feedback.
Currently not possible. #821 was the reason for the change indeed (before, everything could be changed which sometimes didn’t make sense; after, only markdown can be changed, which is sometimes not powerful enough but at least isn’t unexpected).
See also #1770.
<kbd className="bg-gray-300">
in your MDX, it should work for us and I’m assuming it works for your previewer.hast-util-select
withhast-util-classnames
)I’m open to solutions in
@mdx-js/mdx
, but I have a bad feeling about going wit…