This commit is contained in:
Timothy Jaeryang Baek
2025-05-17 03:14:26 +04:00
parent 424f6f71cf
commit 9801a2d23f
5 changed files with 25 additions and 23 deletions

View File

@@ -24,7 +24,7 @@
export let id = '';
export let onSave = (e) => {};
export let onCode = (e) => {};
export let onUpdate = (e) => {};
export let onPreview = (e) => {};
export let save = false;
@@ -340,6 +340,8 @@
await drawMermaidDiagram();
})();
}
onUpdate(token);
};
$: if (token) {
@@ -352,8 +354,6 @@
render();
}
$: onCode({ lang, code });
$: if (attributes) {
onAttributesUpdate();
}
@@ -386,10 +386,10 @@
onMount(async () => {
console.log('codeblock', lang, code);
if (lang) {
onCode({ lang, code });
if (token) {
onUpdate(token);
}
if (document.documentElement.classList.contains('dark')) {
mermaid.initialize({
startOnLoad: true,