feat: add markdown footnote

This commit is contained in:
kangfenmao 2024-08-01 15:18:09 +08:00
parent c9a964d8f8
commit b04b0cc8a6
2 changed files with 6 additions and 3 deletions

View File

@ -25,7 +25,8 @@ const resources = {
regenerate: 'Regenerate',
provider: 'Provider',
you: 'You',
save: 'Save'
save: 'Save',
footnotes: 'Footnotes'
},
button: {
add: 'Add',
@ -209,7 +210,8 @@ const resources = {
copy: '复制',
regenerate: '重新生成',
provider: '提供商',
you: '用户'
you: '用户',
footnote: '引用内容'
},
button: {
add: '添加',

View File

@ -31,12 +31,13 @@ const Markdown: FC<Props> = ({ message }) => {
<ReactMarkdown
className="markdown"
remarkPlugins={[remarkGfm, remarkMath]}
remarkRehypeOptions={{ footnoteLabel: t('common.footnote'), footnoteLabelTagName: 'h4' }}
rehypePlugins={[rehypeKatex]}
components={{ code: CodeBlock as any, a: Link as any }}>
{getMessageContent(message)}
</ReactMarkdown>
)
}, [getMessageContent, message])
}, [getMessageContent, message, t])
}
export default Markdown