Compare commits

...
Author SHA1 Message Date
Sidharth VinodandGitHub cc2b574a6f Merge branch 'develop' into sidv/fixErrorDiagram 2024-06-16 20:09:53 +05:30
Sidharth Vinod e530b3e35f Merge branch 'develop' into sidv/fixErrorDiagram
* develop:
  build: update Browserslist db
  Fix tests
  fix cypress
  chore(deps): update all non-major dependencies
  chore(deps): update all non-major dependencies
  Group mermaid release separately
  chore(deps): update all non-major dependencies
  build: update Browserslist db
  build: update Browserslist db
  Bump @adobe/css-tools from 4.3.0 to 4.3.1
  fix: add missing and remove duplicate keywords in pie
2023-09-15 10:36:37 +05:30
Sidharth Vinod 6334d4ab84 fix: Error diagram rendering 2023-08-17 14:26:04 +05:30
+13 -1
View File
@@ -13,7 +13,19 @@ export const render = async (
// Should be able to call this multiple times without any issues.
mermaid.initialize(config);
return await mermaid.render(id, code);
try {
const result = await mermaid.render(id, code);
return result;
} catch {
const errorDiv = document.querySelector(`#d${id}`);
const svg = errorDiv?.innerHTML ?? '';
errorDiv?.remove();
return {
svg,
bindFunctions: undefined
};
}
};
export const parse = async (code: string): Promise<unknown> => {