diff --git a/packages/lb-components/package.json b/packages/lb-components/package.json index 8ca203da5..fdc34163c 100644 --- a/packages/lb-components/package.json +++ b/packages/lb-components/package.json @@ -67,6 +67,7 @@ "redux-actions": "^2.6.5", "redux-thunk": "^2.3.0", "rehype-katex": "^6.0.3", + "rehype-raw": "^7.0.0", "remark-gfm": "^3.0.1", "remark-math": "^5.1.1", "resize-observer-polyfill": "^1.5.1", diff --git a/packages/lb-components/src/components/LLMMultiWheelView/dialogView/index.tsx b/packages/lb-components/src/components/LLMMultiWheelView/dialogView/index.tsx index a9dc13b15..015f9863c 100644 --- a/packages/lb-components/src/components/LLMMultiWheelView/dialogView/index.tsx +++ b/packages/lb-components/src/components/LLMMultiWheelView/dialogView/index.tsx @@ -67,7 +67,7 @@ const DialogView = (props: IDialogViewProps) => { ) : ( - answerList.map((item: any, index: number) => { + answerList?.map((item: any, index: number) => { const order = index + 1; const answer = { ...item, order }; const isTextControl = getTextControlByConfig(answer, LLMConfig); diff --git a/packages/lb-components/src/components/LLMToolView/questionView/components/imgView/index.module.scss b/packages/lb-components/src/components/LLMToolView/questionView/components/imgView/index.module.scss index c730c218e..0de4d8da1 100644 --- a/packages/lb-components/src/components/LLMToolView/questionView/components/imgView/index.module.scss +++ b/packages/lb-components/src/components/LLMToolView/questionView/components/imgView/index.module.scss @@ -4,14 +4,10 @@ .item { margin: 0px 40px 40px 0px; - width: 400px; display: flex; - height: 300px; .image { - height: 260px; - min-width: 300px; flex: 1; background: #E9EBF1; display: flex; diff --git a/packages/lb-components/src/components/LLMToolView/questionView/components/imgView/index.tsx b/packages/lb-components/src/components/LLMToolView/questionView/components/imgView/index.tsx index 1e5db380f..b4f90d441 100644 --- a/packages/lb-components/src/components/LLMToolView/questionView/components/imgView/index.tsx +++ b/packages/lb-components/src/components/LLMToolView/questionView/components/imgView/index.tsx @@ -24,16 +24,17 @@ const ImgView = (props: IProps) => { const ImgFail = i18n.language === 'en' ? ImgFailEn : ImgFailCn; return (
- {answerList.map((i: IAnswerList, index: number) => { + {answerList?.map((i: IAnswerList, index: number) => { return ( -
+
{i?.order} -
+
diff --git a/packages/lb-components/src/components/markdownView/index.tsx b/packages/lb-components/src/components/markdownView/index.tsx index 6b512784e..44c4c3e6f 100644 --- a/packages/lb-components/src/components/markdownView/index.tsx +++ b/packages/lb-components/src/components/markdownView/index.tsx @@ -8,12 +8,14 @@ import React from 'react'; import Markdown, { Components } from 'react-markdown'; import remarkMath from 'remark-math'; import rehypeKatex from 'rehype-katex'; +import rehypeRaw from 'rehype-raw'; import SyntaxHighlighter from 'react-syntax-highlighter'; import { docco } from 'react-syntax-highlighter/dist/esm/styles/hljs'; import remarkGfm from 'remark-gfm'; import 'github-markdown-css'; import styles from './index.module.scss'; import { classnames } from '@/utils'; +import { Plugin } from 'unified'; interface IProps { value: string; @@ -56,6 +58,7 @@ const MarkdownView = (props: IProps) => { })} remarkPlugins={[remarkGfm, remarkMath]} rehypePlugins={[ + rehypeRaw as unknown as Plugin, [ rehypeKatex, {