mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-04 11:52:39 +02:00
22 lines
591 B
JavaScript
22 lines
591 B
JavaScript
/**
|
|
* Copyright (c) 2017-present, Facebook, Inc.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
import React from 'react';
|
|
import Link from '@docusaurus/Link';
|
|
import CodeBlock from '@theme/CodeBlock';
|
|
import styles from './styles.module.css';
|
|
|
|
export default {
|
|
code: props => {
|
|
const {children} = props;
|
|
if (typeof children === 'string') {
|
|
return <CodeBlock {...props} />;
|
|
}
|
|
return children;
|
|
},
|
|
a: Link,
|
|
pre: props => <pre className={styles.mdxCodeBlock} {...props} />,
|
|
};
|