Skip to content

Commit

Permalink
fix: use async in render-after-error
Browse files Browse the repository at this point in the history
  • Loading branch information
sidharthv96 committed Oct 6, 2022
1 parent 646a96e commit d59f878
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions cypress/platform/render-after-error.html
Expand Up @@ -14,15 +14,16 @@
mermaid.init({ startOnLoad: false });

mermaid.mermaidAPI.initialize({ securityLevel: 'strict' });
(async () => {
try {
console.log('rendering');
await mermaid.mermaidAPI.render('graphDiv', `>`);
} catch (e) {}

try {
console.log('rendering');
mermaid.mermaidAPI.render('graphDiv', `>`);
} catch (e) {}

mermaid.mermaidAPI.render('graphDiv', `graph LR\n a --> b`, (html) => {
document.getElementById('graph').innerHTML = html;
});
await mermaid.mermaidAPI.render('graphDiv', `graph LR\n a --> b`, (html) => {
document.getElementById('graph').innerHTML = html;
});
})();
</script>
</body>
</html>

0 comments on commit d59f878

Please sign in to comment.