fix: [gui] table formatting (#1497)

This commit is contained in:
Michael Neale
2025-03-04 17:32:52 +11:00
committed by GitHub
parent cd4d6c4a28
commit 5e5c9c8713
5 changed files with 475 additions and 7 deletions
@@ -1,5 +1,7 @@
import React, { useState } from 'react';
import ReactMarkdown from 'react-markdown';
import remarkGfm from 'remark-gfm';
import rehypeRaw from 'rehype-raw';
import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter';
import { oneDark } from 'react-syntax-highlighter/dist/esm/styles/prism';
import { oneLight } from 'react-syntax-highlighter/dist/cjs/styles/prism';
@@ -82,10 +84,15 @@ export default function MarkdownContent({ content, className = '' }: MarkdownCon
return (
<div className="w-full overflow-x-hidden">
<ReactMarkdown
rehypePlugins={[rehypeinlineCodeProperty]}
remarkPlugins={[remarkGfm]}
rehypePlugins={[rehypeinlineCodeProperty, rehypeRaw]}
className={`prose prose-xs dark:prose-invert w-full max-w-full break-words
prose-pre:p-0 prose-pre:m-0 !p-0
prose-code:break-all prose-code:whitespace-pre-wrap
prose-table:table prose-table:w-full
prose-td:border prose-td:border-borderSubtle prose-td:p-2
prose-th:border prose-th:border-borderSubtle prose-th:p-2
prose-thead:bg-bgSubtle
${className}`}
components={{
...UrlTransform,