Skip to content

Commit

Permalink
Support Firefox
Browse files Browse the repository at this point in the history
  • Loading branch information
sidharthv96 committed Mar 11, 2024
1 parent 3134a87 commit 33287a6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/mermaid/src/docs/.vitepress/theme/Mermaid.vue
Expand Up @@ -4,7 +4,7 @@
<div class="language-mermaid">
<button class="copy"></button>
<span class="lang">mermaid</span>
<pre><code contenteditable="plaintext-only" @input="updateCode" @keydown.meta.enter="renderChart" @keydown.ctrl.enter="renderChart" ref="editableContent" class="editable-code"></code></pre>
<pre><code :contenteditable="contentEditable" @input="updateCode" @keydown.meta.enter="renderChart" @keydown.ctrl.enter="renderChart" ref="editableContent" class="editable-code"></code></pre>
<div class="buttons-container">
<span>{{ ctrlSymbol }} + Enter</span><span>|</span>
<button @click="renderChart">Run ▶</button>
Expand Down Expand Up @@ -37,6 +37,8 @@ const svg = ref('');
const code = ref(decodeURIComponent(props.graph));
const ctrlSymbol = ref(navigator.platform.includes('Mac') ? '' : 'Ctrl');
const editableContent = ref(null);
const isFirefox = navigator.userAgent.toLowerCase().includes('firefox');
const contentEditable = ref(isFirefox ? 'true' : 'plaintext-only');
let mut = null;
Expand Down

0 comments on commit 33287a6

Please sign in to comment.