"use client"; import ReactMarkdown from "react-markdown"; export function Markdown({ children }: { children: string }) { // Fix markdown tables that arrive as a single line (common with LLM output) // "| col | col | | :--- |" → split rows at "| |" boundary const processed = children.replace(/\| \|/g, '|\n|'); return (
( {children}
), thead: ({ children }) => ( {children} ), tbody: ({ children }) => ( {children} ), tr: ({ children }) => ( {children} ), th: ({ children }) => ( {children} ), td: ({ children }) => ( {children} ), }} > {processed}
); }