UPD: Add Validators & Error Toast for Mermaid & Vega diagrams
### UPD: Feat: Add Validators & Error Toast for Mermaid & Vega diagrams Description: As many time the diagrams generated or entered have syntax errors the diagrams are not rendered due to that errors, but as there isn't any notification is difficult to know what happend. This PR add validator and toast notification when error on Mermaid and Vega/Vega-Lite diagrams, helping the user to fix its.
This commit is contained in:
@@ -326,12 +326,12 @@
|
||||
const render = async () => {
|
||||
onUpdate(token);
|
||||
if (lang === 'mermaid' && (token?.raw ?? '').slice(-4).includes('```')) {
|
||||
mermaidHtml = await renderMermaidDiagram(code);
|
||||
mermaidHtml = await renderMermaidDiagram(code, $i18n);
|
||||
} else if (
|
||||
(lang === 'vega' || lang === 'vega-lite') &&
|
||||
(token?.raw ?? '').slice(-4).includes('```')
|
||||
) {
|
||||
vegaHtml = await renderVegaVisualization(code);
|
||||
vegaHtml = await renderVegaVisualization(code, $i18n);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user