Merge branch 'main' of https://github.com/Yidadaa/ChatGPT-Next-Web into multi-arch-docker-build

This commit is contained in:
hibobmaster 2023-03-30 15:53:44 +08:00
commit 852f8b8aa5
3 changed files with 4 additions and 1 deletions

View File

@ -439,6 +439,7 @@ export function Chat(props: {
className="markdown-body" className="markdown-body"
style={{ fontSize: `${fontSize}px` }} style={{ fontSize: `${fontSize}px` }}
onContextMenu={(e) => onRightClick(e, message)} onContextMenu={(e) => onRightClick(e, message)}
onDoubleClickCapture={() => setUserInput(message.content)}
> >
<Markdown content={message.content} /> <Markdown content={message.content} />
</div> </div>

View File

@ -1,6 +1,7 @@
import ReactMarkdown from "react-markdown"; import ReactMarkdown from "react-markdown";
import "katex/dist/katex.min.css"; import "katex/dist/katex.min.css";
import RemarkMath from "remark-math"; import RemarkMath from "remark-math";
import RemarkBreaks from "remark-breaks";
import RehypeKatex from "rehype-katex"; import RehypeKatex from "rehype-katex";
import RemarkGfm from "remark-gfm"; import RemarkGfm from "remark-gfm";
import RehypePrsim from "rehype-prism-plus"; import RehypePrsim from "rehype-prism-plus";
@ -29,7 +30,7 @@ export function PreCode(props: { children: any }) {
export function Markdown(props: { content: string }) { export function Markdown(props: { content: string }) {
return ( return (
<ReactMarkdown <ReactMarkdown
remarkPlugins={[RemarkMath, RemarkGfm]} remarkPlugins={[RemarkMath, RemarkGfm, RemarkBreaks]}
rehypePlugins={[RehypeKatex, [RehypePrsim, { ignoreMissing: true }]]} rehypePlugins={[RehypeKatex, [RehypePrsim, { ignoreMissing: true }]]}
components={{ components={{
pre: PreCode, pre: PreCode,

View File

@ -23,6 +23,7 @@
"react": "^18.2.0", "react": "^18.2.0",
"react-dom": "^18.2.0", "react-dom": "^18.2.0",
"react-markdown": "^8.0.5", "react-markdown": "^8.0.5",
"remark-breaks": "^3.0.2",
"rehype-katex": "^6.0.2", "rehype-katex": "^6.0.2",
"rehype-prism-plus": "^1.5.1", "rehype-prism-plus": "^1.5.1",
"remark-gfm": "^3.0.1", "remark-gfm": "^3.0.1",