Closed jeffwillette closed 5 years ago
Describe the bug
MDXProvider used the provided component for block level code (triple backticked) but not for inline code (single backticked)
MDXProvider
To Reproduce A link to your gatsby-mdx minimal repro and Steps to reproduce the behavior:
export default class RootWrapper extends React.Component { render() { const { children } = this.props; return ( <MDXProvider components={{ h1: ({ children, ...props }) => ( <h1 {...props}>Provided: {children}</h1> ), pre: props => { console.log("pre"); return <span style={{ backgroundColor: "green" }} {...props} />; }, code: props => { console.log("code"); return <span style={{ backgroundColor: "blue" }} {...props} />; }, wrapper: "section" }} > {children} </MDXProvider> ); } }
<code>
Expected behavior
I wold expect single backticked code to use a component as well
Screenshots
In order to differentiate between the code inside pre tags and inline code there's a special inlineCode node type which you'll need to use here.
inlineCode
Ref: https://mdxjs.com/getting-started#table-of-components
🤦♂️ It's labeled wrong in the official docs. Fixing now.
Describe the bug
MDXProvider
used the provided component for block level code (triple backticked) but not for inline code (single backticked)To Reproduce A link to your gatsby-mdx minimal repro and Steps to reproduce the behavior:
<code>
tagExpected behavior
I wold expect single backticked code to use a component as well
Screenshots