mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-16 20:07:49 +01:00
refac
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user