Skip to content
This repository has been archived by the owner on Nov 3, 2019. It is now read-only.

Commit

Permalink
Fix match check to avoid null errors (#373)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedelgabri authored and ChristopherBiscardi committed Apr 23, 2019
1 parent a2b4b63 commit f29ae7f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/mdx-utils/index.js
Expand Up @@ -14,12 +14,12 @@ exports.preToCodeBlock = preProps => {
...props
} = preProps.children.props;

const [, match] = className.match(/language-([\0-\uFFFF]*)/);
const match = className.match(/language-([\0-\uFFFF]*)/);

return {
codeString: codeString.trim(),
className,
language: match ? match : "",
language: match != null ? match[1] : "",
...props
};
}
Expand Down

0 comments on commit f29ae7f

Please sign in to comment.