Skip to content

Commit

Permalink
fix(mermaid): Only switch back on failure if in preview mode
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <[email protected]>
  • Loading branch information
juliusknorr committed Oct 27, 2023
1 parent 49775e5 commit c3ca9d7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/nodes/CodeBlockView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c3ca9d7

Please sign in to comment.