fix: mermaid error on rating

This commit is contained in:
Timothy J. Baek 2024-09-03 15:39:09 +02:00
parent 1803c7adeb
commit 2cd1207e73

View File

@ -217,8 +217,10 @@ __builtins__.input = input`);
const drawMermaidDiagram = async () => {
try {
const { svg } = await mermaid.render(`mermaid-${uuidv4()}`, code);
mermaidHtml = svg;
if (await mermaid.parse(code)) {
const { svg } = await mermaid.render(`mermaid-${uuidv4()}`, code);
mermaidHtml = svg;
}
} catch (error) {
console.log('Error:', error);
}