From aca5099d62e225610b1484be7417ccf4c53b9d26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Wed, 18 Oct 2023 12:14:34 +0200 Subject: [PATCH] fix(mermaid): Only switch back on failure if in preview mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- src/nodes/CodeBlockView.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/nodes/CodeBlockView.vue b/src/nodes/CodeBlockView.vue index 72914b7975c..87770b8100d 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)