Skip to content

Commit

Permalink
prevent error when no mdx language is defined
Browse files Browse the repository at this point in the history
  • Loading branch information
jurajk committed Mar 3, 2020
1 parent 1f19f89 commit 15758b3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/styleguide/src/components/MDX/MDX.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ export const MDXComponents = {
a: props => <Link {...props} />,
inlineCode: props => <Code {...props} />,
code: props => (
<CodeBlock language={props.className.replace(/language-/, '')} {...props} />
<CodeBlock
language={props.className && props.className.replace(/language-/, '')}
{...props}
/>
),
};

Expand Down

0 comments on commit 15758b3

Please sign in to comment.