There was an error while loading. Please reload this page.
1 parent a4b6370 commit 6f35e25Copy full SHA for 6f35e25
1 file changed
src/nodes/CodeBlockView.vue
@@ -131,7 +131,9 @@ export default {
131
},
132
133
setup() {
134
+ const isDarkTheme = useIsDarkTheme()
135
return {
136
+ isDarkTheme,
137
/** The lazy loaded mermaid js module */
138
mermaid: null,
139
}
@@ -209,7 +211,10 @@ export default {
209
211
// lazy load mermaid on first real usage
210
212
if (this.mermaid === null) {
213
this.mermaid = (await import('mermaid')).default
- this.mermaid.initialize({ startOnLoad: false })
214
+ this.mermaid.initialize({
215
+ startOnLoad: false,
216
+ theme: this.isDarkTheme ? 'dark' : 'default',
217
+ })
218
219
await this.mermaid.parse(textContent)
220
0 commit comments