markdown-it-any-block 3.2.10-beta1 → 3.2.10-beta3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7966,9 +7966,18 @@ async function render_pumlText(text2, div) {
7966
7966
  return div;
7967
7967
  }
7968
7968
  let mermaid = null;
7969
- function getID(length = 16) {
7970
- return Number(Math.random().toString().substr(3, length) + Date.now()).toString(36);
7971
- }
7969
+ (async () => {
7970
+ if (ABCSetting.env !== "obsidian" || true) return;
7971
+ const { default: mermaid_ } = await import("mermaid");
7972
+ const { default: mindmap } = await import("@mermaid-js/mermaid-mindmap");
7973
+ mermaid = mermaid_;
7974
+ mermaid.registerExternalDiagrams([mindmap]);
7975
+ const isDarkTheme = document.body.classList.contains("theme-dark");
7976
+ const theme = isDarkTheme ? "dark" : "light";
7977
+ mermaid.initialize({
7978
+ theme
7979
+ });
7980
+ })();
7972
7981
  ABConvert.factory({
7973
7982
  id: "title2mindmap",
7974
7983
  name: "标题到脑图",
@@ -8139,9 +8148,7 @@ async function data2mindmap(list_itemInfo, div) {
8139
8148
  }
8140
8149
  async function render_mermaidText(mermaidText, div) {
8141
8150
  if (ABCSetting.env == "obsidian") {
8142
- await init_mermaid();
8143
- const { svg } = await mermaid?.render("ab-mermaid-" + getID(), mermaidText);
8144
- div.innerHTML = svg;
8151
+ console.error("缺少 mermaid 环境");
8145
8152
  } else if (ABCSetting.env == "obsidian-min") {
8146
8153
  ABConvertManager.getInstance().m_renderMarkdownFn("```mermaid\n" + mermaidText + "\n```", div);
8147
8154
  } else {
@@ -8150,19 +8157,6 @@ async function render_mermaidText(mermaidText, div) {
8150
8157
  }
8151
8158
  return div;
8152
8159
  }
8153
- async function init_mermaid() {
8154
- if (mermaid != null) return;
8155
- if (ABCSetting.env !== "obsidian") return;
8156
- const { default: mermaid_ } = await import("mermaid");
8157
- const { default: mindmap } = await import("@mermaid-js/mermaid-mindmap");
8158
- mermaid = mermaid_;
8159
- mermaid.registerExternalDiagrams([mindmap]);
8160
- const isDarkTheme = document.body.classList.contains("theme-dark");
8161
- const theme = isDarkTheme ? "dark" : "light";
8162
- mermaid.initialize({
8163
- theme
8164
- });
8165
- }
8166
8160
  function abConvertEvent(d, isCycle = false) {
8167
8161
  if (d.querySelector(".ab-super-width")) {
8168
8162
  const els_note = d.querySelectorAll(".ab-note");