修复行内代码样式多``的问题
This commit is contained in:
parent
6daab5d790
commit
6b8e81a849
@ -694,4 +694,24 @@
|
|||||||
.scrollbar-none::-webkit-scrollbar {
|
.scrollbar-none::-webkit-scrollbar {
|
||||||
display: none;
|
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);
|
||||||
}
|
}
|
@ -224,7 +224,7 @@ export class MarkdownRenderer {
|
|||||||
this.renderer.codespan = ({ text }: Tokens.Codespan) => {
|
this.renderer.codespan = ({ text }: Tokens.Codespan) => {
|
||||||
const codespanStyle = (this.options.inline?.codespan || {})
|
const codespanStyle = (this.options.inline?.codespan || {})
|
||||||
const styleStr = cssPropertiesToString(codespanStyle)
|
const styleStr = cssPropertiesToString(codespanStyle)
|
||||||
return `<code${styleStr ? ` style="${styleStr}"` : ''}>${text}</code>`
|
return `<code class="inline-code"${styleStr ? ` style="${styleStr}"` : ''}>${text}</code>`
|
||||||
}
|
}
|
||||||
|
|
||||||
// 重写 em 方法
|
// 重写 em 方法
|
||||||
|
Loading…
Reference in New Issue
Block a user