Skip to content

Commit

Permalink
fix: mermaid
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdehaven committed Dec 23, 2023
1 parent a31ad06 commit c7ec43c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/MarkdownUi.vue
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,10 @@ watch(currentMode, async (mode: MarkdownMode): Promise<void> => {
destroySyncScroll()
await nextTick()
// Re-render any `.mermaid` containers
await updateMermaid()
// Re-synchronize the scroll containers
initializeSyncScroll()
})
Expand Down Expand Up @@ -265,9 +269,9 @@ const debouncedUpdateContent = debounce(async (emitEvent = true): Promise<void>
emit('update:modelValue', rawMarkdown.value)
}
// Re-render any `.mermaid` containers
await nextTick() // **MUST** await nextTick for the virtual DOM to refresh
// Re-render any `.mermaid` containers
await updateMermaid()
}, EDITOR_DEBOUNCE_TIMEOUT)
Expand Down

0 comments on commit c7ec43c

Please sign in to comment.