-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
Description
Chat messages with code and md formats are not that well handles. For quick fix we can use React MArkdown component...I did quick poc, this is how it looks. This will improve the user experience.
npm install react-markdown remark-gfm
tailwind css config
add require('@tailwindcss/typography')]
plugins: [require('tailwindcss-animate'), require('@tailwindcss/typography')],
globals.css (whatver css you are using) add prose
Example
.prose {
@apply max-w-none; /* Prevent Markdown from restricting width */
}
pre, code {
@apply font-sans text-sm;
}
code example
import ReactMarkdown from 'react-markdown';
import remarkGfm from 'remark-gfm';
<ReactMarkdown remarkPlugins={[remarkGfm]} className="prose text-sm">
{message.content}
</ReactMarkdown>
This should be quick one for now.