"use client"; import type { FC } from "react"; import Markdown from "react-markdown"; import { Prism as SyntaxHighlighter } from "react-syntax-highlighter"; import { oneDark } from "react-syntax-highlighter/dist/esm/styles/prism"; import remarkGfm from "remark-gfm"; interface MarkdownContentProps { content: string; className?: string; } export const MarkdownContent: FC = ({ content, className = "", }) => { return (
{children} ); }, h2({ children, ...props }) { return (

{children}

); }, h3({ children, ...props }) { return (

{children}

); }, h4({ children, ...props }) { return (

{children}

); }, h5({ children, ...props }) { return (
{children}
); }, h6({ children, ...props }) { return (
{children}
); }, p({ children, ...props }) { return (

{children}

); }, ul({ children, ...props }) { return (
    {children}
); }, ol({ children, ...props }) { return (
    {children}
); }, li({ children, ...props }) { return (
  • {children}
  • ); }, code({ className, children, ...props }) { const match = /language-(\w+)/.exec(className || ""); const isInline = !match; if (isInline) { return ( {children} ); } return (
    {match[1]}
    {String(children).replace(/\n$/, "")}
    ); }, pre({ children, ...props }) { return
    {children}
    ; }, blockquote({ children, ...props }) { return (
    {children}
    ); }, a({ children, href, ...props }) { return ( {children} ); }, // テーブルの改善 table({ children, ...props }) { return (
    {children}
    ); }, thead({ children, ...props }) { return ( {children} ); }, th({ children, ...props }) { return ( {children} ); }, td({ children, ...props }) { return ( {children} ); }, hr({ ...props }) { return
    ; }, strong({ children, ...props }) { return ( {children} ); }, em({ children, ...props }) { return ( {children} ); }, }} > {content}
    ); };