Skip to content

Commit

Permalink
fix(v2): treat inline code in raw HTML as native element (#2857)
Browse files Browse the repository at this point in the history
* fix(v2): treat inline code in raw HTML as native element

* Replace indexOf with includes
  • Loading branch information
lex111 authored Jun 3, 2020
1 parent e68b81b commit 6f332f4
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ export default {
code: (props) => {
const {children} = props;
if (typeof children === 'string') {
if (!children.includes('\n')) {
return <code {...props} />;
}
return <CodeBlock {...props} />;
}
return children;
Expand Down

0 comments on commit 6f332f4

Please sign in to comment.