better support code blocks
This commit is contained in:
@@ -55,23 +55,27 @@ function CodeBlock({
|
||||
if (!match) {
|
||||
return <code className={className}>{children}</code>
|
||||
}
|
||||
|
||||
return (
|
||||
<SyntaxHighlighter
|
||||
style={atomOneDark}
|
||||
language={match[1]}
|
||||
PreTag="div"
|
||||
lineNumberStyle={{ color: 'var(--sea-ink-soft)' }}
|
||||
wrapLongLines
|
||||
showLineNumbers
|
||||
customStyle={{
|
||||
width: '100%',
|
||||
background: 'var(--surface)',
|
||||
border: '1px solid var(--line)',
|
||||
borderRadius: '0.75rem',
|
||||
fontSize: '0.875rem',
|
||||
lineHeight: '1.7',
|
||||
margin: '1.5rem 0',
|
||||
padding: '1.25rem 1.5rem',
|
||||
}}
|
||||
codeTagProps={{
|
||||
style: { fontFamily: 'ui-monospace, monospace' },
|
||||
}}
|
||||
wrapLines
|
||||
>
|
||||
{String(children).replace(/\n$/, '')}
|
||||
</SyntaxHighlighter>
|
||||
|
||||
Reference in New Issue
Block a user