diff --git a/src/nodes/CodeBlockView.vue b/src/nodes/CodeBlockView.vue index 9387540476a..ac911cc2dd8 100644 --- a/src/nodes/CodeBlockView.vue +++ b/src/nodes/CodeBlockView.vue @@ -150,7 +150,9 @@ export default { this.$refs.preview.innerHTML = svg } catch (e) { console.debug('Invalid mermaid source', e) - this.viewMode = this.isEditable ? 'side-by-side' : 'code' + if (this.viewMode === 'preview') { + this.viewMode = this.isEditable ? 'side-by-side' : 'code' + } } }, 250)