优化 Mermaid 流程图的支持

This commit is contained in:
tianyaxiang 2025-02-02 18:29:03 +08:00
parent 589370e456
commit 0bce491e86

View File

@ -58,7 +58,7 @@ export class MarkdownRenderer {
...latexStyle, ...latexStyle,
display: 'block', display: 'block',
margin: '1em 0', margin: '1em 0',
textAlign: 'center' textAlign: 'center' as const
} }
const styleStr = cssPropertiesToString(style) const styleStr = cssPropertiesToString(style)
const rendered = katex.renderToString(token.text, { const rendered = katex.renderToString(token.text, {
@ -114,8 +114,8 @@ export class MarkdownRenderer {
...mermaidStyle, ...mermaidStyle,
display: 'block', display: 'block',
margin: '1em 0', margin: '1em 0',
textAlign: 'center', textAlign: 'center' as const,
background: 'transparent' // 确保背景透明以适应主题 background: 'transparent'
} }
const styleStr = cssPropertiesToString(style) const styleStr = cssPropertiesToString(style)