Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update inlineCode reference #34817

Merged
merged 1 commit into from Feb 25, 2022
Merged

Update inlineCode reference #34817

merged 1 commit into from Feb 25, 2022

Conversation

ahollenbach
Copy link
Contributor

@ahollenbach ahollenbach commented Feb 25, 2022

Howdy!

MDX no longer has an inlineCode component in their MDXProvider (source). They've migrated to a pre component for blocks of code and a code component for inline code snippets, so I've updated the example to reflect this.

I validated this locally with these example components:

const Code = (props) => (
  <code>
    {props.children}
  </code>
);

const Pre = (props) => (
  <pre>
    {props.children}
  </pre>
);

const components = {
  pre: Pre,
  code: Code,
  ...
};

Applied to a test mdx file:

This is an `inline` example.

~~~
<p>Test code</p>
~~~

Which generates the following html:

<p>This is an <code>inline</code> example.</p>
<pre>
  <code>&lt;p&gt;Test code&lt;/p&gt;</code>
</pre>

Documentation / Examples

  • Make sure the linting passes by running yarn lint

Copy link
Member

@styfle styfle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@kodiakhq kodiakhq bot merged commit 0ec57da into vercel:canary Feb 25, 2022
@ahollenbach ahollenbach deleted the patch-1 branch February 25, 2022 18:58
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants