Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/nodes/CodeBlock/CodeBlockView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
<script>
import debounce from 'debounce'
import { NodeViewWrapper, NodeViewContent } from '@tiptap/vue-2'
import { useIsDarkTheme } from '@nextcloud/vue'
import NcActions from '@nextcloud/vue/components/NcActions'
import NcActionButton from '@nextcloud/vue/components/NcActionButton'
import NcActionInput from '@nextcloud/vue/components/NcActionInput'
Expand Down Expand Up @@ -130,7 +131,9 @@ export default {
},
},
setup() {
const isDarkTheme = useIsDarkTheme()
return {
isDarkTheme,
/** The lazy loaded mermaid js module */
mermaid: null,
}
Expand Down Expand Up @@ -208,7 +211,10 @@ export default {
// lazy load mermaid on first real usage
if (this.mermaid === null) {
this.mermaid = (await import('mermaid')).default
this.mermaid.initialize({ startOnLoad: false })
this.mermaid.initialize({
startOnLoad: false,
theme: this.isDarkTheme ? 'dark' : 'default',
})
}
await this.mermaid.parse(textContent)

Expand Down
Loading