import React from 'react';
import ReactMarkdown from 'react-markdown';
import rehypeKatex from 'rehype-katex';
import rehypeHighlight from 'rehype-highlight';
import remarkMath from 'remark-math';
import remarkGfm from 'remark-gfm';
import rehypeRaw from 'rehype-raw'
import CodeBlock from './CodeBlock';
import { langSubset } from '~/utils/languages';
const Content = React.memo(({ content }) => {
let rehypePlugins = [
[rehypeKatex, { output: 'mathml' }],
[
rehypeHighlight,
{
detect: true,
ignoreMissing: true,
subset: langSubset
}
],
[rehypeRaw],
];
return (
{children};
} else {
return (
{props?.children}
; }); // const blinker = ({ node }) => { // if (node.type === 'text' && node.value === '█') { // return {node.value}; // } // return null; // }; // const em = React.memo(({ node, ...props }) => { // if ( // props.children[0] && // typeof props.children[0] === 'string' && // props.children[0].startsWith('^') // ) { // return {props.children[0].substring(1)}; // } // if ( // props.children[0] && // typeof props.children[0] === 'string' && // props.children[0].startsWith('~') // ) { // return {props.children[0].substring(1)}; // } // return ; // }); export default Content;