How to get something like remark-attr or rehype-attr to add props to md components like lists? #2144
-
background: I am combining mdx with astro and reveal.js and would now like to have a way to add props to the markdown components. One usecase is adding the class Importantly, these are attributes which are individual to a single list/code-block, etc., so nothing which I would like to define for all lists, all code-blocks, etc., but really something which should be defined locally. I found remark-attr and rehype-attr but it seems both aren't supported with mdx, because mdx blocks both the curly syntax from remark-attr as well as the html-comment syntax from rehype-attr. Is there another way to add props (attributes) to markdown components in mdx? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 8 replies
-
Use markdown for the common things: `code` Use JSX for the exceptions: <code className="special">code</code> |
Beta Was this translation helpful? Give feedback.
Use markdown for the common things:
Use JSX for the exceptions: