diff --git a/src/renderer/src/pages/home/Markdown/CodeBlock.tsx b/src/renderer/src/pages/home/Markdown/CodeBlock.tsx index 04de256b..d5024467 100644 --- a/src/renderer/src/pages/home/Markdown/CodeBlock.tsx +++ b/src/renderer/src/pages/home/Markdown/CodeBlock.tsx @@ -22,7 +22,7 @@ interface CodeBlockProps { const CodeBlock: React.FC = ({ children, className }) => { const match = /language-(\w+)/.exec(className || '') const showFooterCopyButton = children && children.length > 500 - const { codeShowLineNumbers } = useSettings() + const { codeShowLineNumbers, fontSize } = useSettings() const { theme } = useTheme() const language = match?.[1] @@ -46,7 +46,8 @@ const CodeBlock: React.FC = ({ children, className }) => { border: '0.5px solid var(--color-code-background)', borderTopLeftRadius: 0, borderTopRightRadius: 0, - marginTop: 0 + marginTop: 0, + fontSize }}> {String(children).replace(/\n$/, '')} @@ -88,7 +89,7 @@ const CodeHeader = styled.div` font-size: 14px; font-weight: bold; /* background-color: var(--color-code-background); */ - height: 36px; + height: 34px; padding: 0 10px; border-top-left-radius: 8px; border-top-right-radius: 8px;