Add zenuml support to mermaid

https://github.com/cryptpad/cryptpad/issues/1132
This commit is contained in:
Wolfgang Ginolas 2023-07-27 08:39:12 +02:00
parent 444d4da08f
commit 737e3ee6ff
3 changed files with 28980 additions and 2 deletions

View File

@ -36,7 +36,8 @@ define([
init: function () {
require([
'mermaid',
], function (_Mermaid) {
'/lib/mermaid/mermaid-zenuml.esm.min.js',
], function (_Mermaid, zenuml) {
console.debug("loaded mermaid");
if (Mermaid.__stubbed) {
Mermaid = _Mermaid;
@ -48,7 +49,7 @@ define([
});
}
pluginLoaded.fire();
Mermaid.registerExternalDiagrams([zenuml]).then(() => pluginLoaded.fire());
});
}
};

View File

@ -0,0 +1,11 @@
define(function(){
const n = "zenuml", e = /^\s*zenuml/, o = (t) => t.match(e) !== null, r = async () => {
const { diagram: t } = await import("./zenuml-definition-b4b159b2.js");
return { id: n, diagram: t };
}, a = {
id: n,
detector: o,
loader: r
};
return a;
});

File diff suppressed because one or more lines are too long