diff --git a/src/app/globals.css b/src/app/globals.css index 6a04c30..90a82fa 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -694,4 +694,24 @@ .scrollbar-none::-webkit-scrollbar { display: none; } +} + +/* 行内代码样式 */ +.inline-code::before, +.inline-code::after { + content: none !important; +} + +.inline-code { + font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; + font-size: 0.9em; + background: rgba(0, 0, 0, 0.05); + padding: 0.2em 0.4em; + border-radius: 3px; + margin: 0 0.2em; +} + +/* 暗色主题支持 */ +.dark .inline-code { + background: rgba(255, 255, 255, 0.1); } \ No newline at end of file diff --git a/src/lib/markdown/renderer.ts b/src/lib/markdown/renderer.ts index 2393a59..1c6c0e4 100644 --- a/src/lib/markdown/renderer.ts +++ b/src/lib/markdown/renderer.ts @@ -224,7 +224,7 @@ export class MarkdownRenderer { this.renderer.codespan = ({ text }: Tokens.Codespan) => { const codespanStyle = (this.options.inline?.codespan || {}) const styleStr = cssPropertiesToString(codespanStyle) - return `${text}` + return `${text}` } // 重写 em 方法