fix(v2): treat inline code in raw HTML as native element (#2857)

* fix(v2): treat inline code in raw HTML as native element

* Replace indexOf with includes
This commit is contained in:
Alexey Pyltsyn 2020-06-03 11:34:25 +03:00 committed by GitHub
parent e68b81bc33
commit 6f332f4345
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;