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.
@@ -7942,9 +7942,18 @@ async function render_pumlText(text2, div) {
7942
7942
  return div;
7943
7943
  }
7944
7944
  let mermaid = null;
7945
- function getID(length = 16) {
7946
- return Number(Math.random().toString().substr(3, length) + Date.now()).toString(36);
7947
- }
7945
+ (async () => {
7946
+ if (ABCSetting.env !== "obsidian" || true) return;
7947
+ const { default: mermaid_ } = await import("mermaid");
7948
+ const { default: mindmap } = await import("@mermaid-js/mermaid-mindmap");
7949
+ mermaid = mermaid_;
7950
+ mermaid.registerExternalDiagrams([mindmap]);
7951
+ const isDarkTheme = document.body.classList.contains("theme-dark");
7952
+ const theme = isDarkTheme ? "dark" : "light";
7953
+ mermaid.initialize({
7954
+ theme
7955
+ });
7956
+ })();
7948
7957
  ABConvert.factory({
7949
7958
  id: "title2mindmap",
7950
7959
  name: "标题到脑图",
@@ -8115,9 +8124,7 @@ async function data2mindmap(list_itemInfo, div) {
8115
8124
  }
8116
8125
  async function render_mermaidText(mermaidText, div) {
8117
8126
  if (ABCSetting.env == "obsidian") {
8118
- await init_mermaid();
8119
- const { svg } = await mermaid?.render("ab-mermaid-" + getID(), mermaidText);
8120
- div.innerHTML = svg;
8127
+ console.error("缺少 mermaid 环境");
8121
8128
  } else if (ABCSetting.env == "obsidian-min") {
8122
8129
  ABConvertManager.getInstance().m_renderMarkdownFn("```mermaid\n" + mermaidText + "\n```", div);
8123
8130
  } else {
@@ -8126,19 +8133,6 @@ async function render_mermaidText(mermaidText, div) {
8126
8133
  }
8127
8134
  return div;
8128
8135
  }
8129
- async function init_mermaid() {
8130
- if (mermaid != null) return;
8131
- if (ABCSetting.env !== "obsidian") return;
8132
- const { default: mermaid_ } = await import("mermaid");
8133
- const { default: mindmap } = await import("@mermaid-js/mermaid-mindmap");
8134
- mermaid = mermaid_;
8135
- mermaid.registerExternalDiagrams([mindmap]);
8136
- const isDarkTheme = document.body.classList.contains("theme-dark");
8137
- const theme = isDarkTheme ? "dark" : "light";
8138
- mermaid.initialize({
8139
- theme
8140
- });
8141
- }
8142
8136
  function abConvertEvent(d, isCycle = false) {
8143
8137
  if (d.querySelector(".ab-super-width")) {
8144
8138
  const els_note = d.querySelectorAll(".ab-note");