mirror of
https://github.com/rancher/rancher-docs.git
synced 2026-11-09 18:29:15 +00:00
14 lines
397 B
JavaScript
14 lines
397 B
JavaScript
import React, {isValidElement} from 'react';
|
|
import CodeBlock from '@theme/CodeBlock';
|
|
export default function MDXPre(props) {
|
|
return (
|
|
<CodeBlock
|
|
// If this pre is created by a ``` fenced codeblock, unwrap the children
|
|
{...(isValidElement(props.children) &&
|
|
props.children.props?.originalType === 'code'
|
|
? props.children.props
|
|
: {...props})}
|
|
/>
|
|
);
|
|
}
|