feat: add markdown footnote
This commit is contained in:
parent
c9a964d8f8
commit
b04b0cc8a6
@ -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: '添加',
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user