mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-06 10:20:09 +02:00
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:
parent
e68b81bc33
commit
6f332f4345
1 changed files with 3 additions and 0 deletions
|
@ -16,6 +16,9 @@ export default {
|
||||||
code: (props) => {
|
code: (props) => {
|
||||||
const {children} = props;
|
const {children} = props;
|
||||||
if (typeof children === 'string') {
|
if (typeof children === 'string') {
|
||||||
|
if (!children.includes('\n')) {
|
||||||
|
return <code {...props} />;
|
||||||
|
}
|
||||||
return <CodeBlock {...props} />;
|
return <CodeBlock {...props} />;
|
||||||
}
|
}
|
||||||
return children;
|
return children;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue