fix: footnote style

This commit is contained in:
kangfenmao 2024-08-02 11:30:06 +08:00
parent 2969a05f10
commit 911c2d0202
5 changed files with 57 additions and 6 deletions

View File

@ -180,4 +180,51 @@
sub { sub {
bottom: -0.25em; bottom: -0.25em;
} }
.footnote-ref {
font-size: 0.8em;
vertical-align: super;
line-height: 0;
margin: 0 2px;
color: var(--color-primary);
text-decoration: none;
&:hover {
text-decoration: underline;
}
}
.footnotes {
margin-top: 1em;
padding-top: 1em;
border-top: 1px solid var(--color-border);
ol {
padding-left: 1em;
}
li {
font-size: 0.9em;
margin-bottom: 0.5em;
color: var(--color-text-light);
p {
display: inline;
margin: 0;
}
}
.footnote-backref {
font-size: 0.8em;
vertical-align: super;
line-height: 0;
margin-left: 5px;
color: var(--color-primary);
text-decoration: none;
&:hover {
text-decoration: underline;
}
}
}
} }

View File

@ -25,7 +25,7 @@ const resources = {
provider: 'Provider', provider: 'Provider',
you: 'You', you: 'You',
save: 'Save', save: 'Save',
footnotes: 'Footnotes' footnotes: 'References'
}, },
button: { button: {
add: 'Add', add: 'Add',

View File

@ -86,7 +86,7 @@ const Suggestions: FC<Props> = ({ assistant, messages, lastMessage }) => {
const Container = styled.div` const Container = styled.div`
display: flex; display: flex;
flex-direction: column; flex-direction: column;
padding: 10px 10px 20px 55px; padding: 10px 10px 20px 65px;
display: flex; display: flex;
width: 100%; width: 100%;
flex-direction: row; flex-direction: row;

View File

@ -32,14 +32,18 @@ const Markdown: FC<Props> = ({ message }) => {
return ( return (
<ReactMarkdown <ReactMarkdown
className="markdown" className="markdown"
remarkPlugins={[remarkGfm, remarkMath]} remarkPlugins={[[remarkMath, { singleDollarTextMath: false }], remarkGfm]}
remarkRehypeOptions={{ footnoteLabel: ' ', footnoteLabelTagName: 'h4' }} remarkRehypeOptions={{
footnoteLabel: t('common.footnotes'),
footnoteLabelTagName: 'h4',
footnoteBackContent: ' '
}}
rehypePlugins={[rehypeKatex]} rehypePlugins={[rehypeKatex]}
components={{ code: CodeBlock as any, a: Link as any }}> components={{ code: CodeBlock as any, a: Link as any }}>
{getMessageContent(message)} {getMessageContent(message)}
</ReactMarkdown> </ReactMarkdown>
) )
}, [getMessageContent, message]) }, [getMessageContent, message, t])
} }
export default Markdown export default Markdown

View File

@ -140,7 +140,7 @@ const Container = styled.div`
` `
const TopicListItem = styled.div` const TopicListItem = styled.div`
padding: 8px 10px; padding: 7px 10px;
cursor: pointer; cursor: pointer;
border-radius: 8px; border-radius: 8px;
font-size: 14px; font-size: 14px;