add support for external images in chat #235

This commit is contained in:
Jon Eugster
2024-06-11 00:25:50 +02:00
parent f158250341
commit 4652f6d50f
4 changed files with 435 additions and 1 deletions
+2 -1
View File
@@ -2,6 +2,7 @@ import * as React from 'react';
import ReactMarkdown from 'react-markdown';
import remarkMath from 'remark-math'
import rehypeKatex from 'rehype-katex'
import rehypeRaw from 'rehype-raw'
import 'katex/dist/katex.min.css' // `rehype-katex` does not import the CSS for you
import gfm from "remark-gfm";
@@ -9,7 +10,7 @@ function Markdown(props) {
const newProps = {
...props,
remarkPlugins: [...props.remarkPlugins ?? [], remarkMath, gfm],
rehypePlugins: [...props.remarkPlugins ?? [], rehypeKatex],
rehypePlugins: [...props.remarkPlugins ?? [], rehypeKatex, rehypeRaw],
};
return (
<ReactMarkdown {...newProps} className="markdown" />