fix: Mermaid syntax error diagram sometimes displayed at side of document
ref https://github.com/outline/outline/discussions/5834
This commit is contained in:
@@ -62,14 +62,17 @@ function getNewState({
|
||||
theme: pluginState.isDark ? "dark" : "default",
|
||||
fontFamily: "inherit",
|
||||
});
|
||||
|
||||
try {
|
||||
module.default.render(
|
||||
"mermaid-diagram-" + diagramId,
|
||||
block.node.textContent,
|
||||
(svgCode) => {
|
||||
(svgCode, bindFunctions) => {
|
||||
element.classList.remove("parse-error", "empty");
|
||||
element.innerHTML = svgCode;
|
||||
}
|
||||
bindFunctions?.(element);
|
||||
},
|
||||
element
|
||||
);
|
||||
} catch (error) {
|
||||
const isEmpty = block.node.textContent.trim().length === 0;
|
||||
|
||||
Reference in New Issue
Block a user