diff --git a/MystEditor.js b/MystEditor.js index 5d037cc..9f8b692 100644 --- a/MystEditor.js +++ b/MystEditor.js @@ -47960,46 +47960,45 @@ js-yaml/dist/js-yaml.mjs: (*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT *) */ const dY = /* @__PURE__ */ new Map(), pY = 42, gY = /* @__PURE__ */ new Map(), k_t = (t, { - preview: e, - lineMap: r, - parent: n + lineMap: e, + parent: r }) => { fY.initialize({ theme: "neutral", suppressErrorRendering: !0 }); - const i = t.renderer.rules.fence || function(s, a, o, l, u) { - return u.renderToken(s, a, o); + const n = t.renderer.rules.fence || function(i, s, a, o, l) { + return l.renderToken(i, s, a); }; - t.renderer.rules.fence = (s, a, o, l, u) => { - var m; - const h = s[a]; - if (h.info !== "mermaid") - return i(s, a, o, l, u); - const f = h.content.trim(), d = wT(r.current, h.attrGet("data-line-id")); - let p = dY.get(d); - p || (p = gY.get(new y8(f, pY).result())); - const g = Math.random().toString().replace(".", ""); - if (h.attrSet("id", `mermaid-${g}`), p && h.attrSet("class", "mermaid"), !p || p.code !== f) { - const v = document.createElement("div"); - v.style.position = "fixed", v.style.visibility = "none", document.body.appendChild(v), eie(e.current, `mermaid-${g}`).then((y) => { - fY.render(`mermaid-${g}`, f, v).then(({ - svg: b + t.renderer.rules.fence = (i, s, a, o, l) => { + var g; + const u = i[s]; + if (u.info !== "mermaid") + return n(i, s, a, o, l); + const h = u.content.trim(), f = wT(e.current, u.attrGet("data-line-id")); + let d = dY.get(f); + d || (d = gY.get(new y8(h, pY).result())); + const p = Math.random().toString().replace(".", ""); + if (u.attrSet("id", `mermaid-${p}`), d && u.attrSet("class", "mermaid"), !d || d.code !== h) { + const m = document.createElement("div"); + m.style.position = "fixed", m.style.visibility = "none", document.body.appendChild(m), eie(r, `mermaid-${p}`).then((v) => { + fY.render(`mermaid-${p}`, h, m).then(({ + svg: y }) => { - const w = { - svg: b, - code: f + const b = { + svg: y, + code: h }; - dY.set(d, w), gY.set(new y8(f, pY).result(), w), y.innerHTML = b, y.className = "mermaid"; - }).catch((b) => { - y.innerHTML = `Mermaid error: -${b}`, y.classList.remove("mermaid"); + dY.set(f, b), gY.set(new y8(h, pY).result(), b), v.innerHTML = y, v.className = "mermaid"; + }).catch((y) => { + v.innerHTML = `Mermaid error: +${y}`, v.classList.remove("mermaid"); }).finally(() => { - v.remove(); + m.remove(); }); }); } - return `
${(m = p == null ? void 0 : p.svg) != null ? m : f}
`; + return `
${(g = d == null ? void 0 : d.svg) != null ? g : h}
`; }; }; function S_t(t, e, r) { @@ -48091,7 +48090,6 @@ const __t = (t, e) => ((t == null ? void 0 : t.match(e)) || []).length, mY = (t, breaks: !0, linkify: !0 }).use(gLe).use(Z1t(e, s)).use(K1t(r, s)).use(k_t, { - preview: n, lineMap: g, parent: s }).use(emt, S_t); diff --git a/docs/collaboration.html b/docs/collaboration.html index e55b6a8..89f8e28 100644 --- a/docs/collaboration.html +++ b/docs/collaboration.html @@ -472,7 +472,7 @@

Other Collaborative Features0553955a + b33e50e1 @ main diff --git a/docs/comments.html b/docs/comments.html index a3d69a2..7cb1545 100644 --- a/docs/comments.html +++ b/docs/comments.html @@ -622,7 +622,7 @@

Suggestions - 0553955a + b33e50e1 @ main diff --git a/docs/genindex.html b/docs/genindex.html index a1073ef..bbf16a1 100644 --- a/docs/genindex.html +++ b/docs/genindex.html @@ -367,7 +367,7 @@ - 0553955a + b33e50e1 @ main diff --git a/docs/index.html b/docs/index.html index dcf7218..1d4214c 100644 --- a/docs/index.html +++ b/docs/index.html @@ -426,7 +426,7 @@

MyST Editor - User Manual - 0553955a + b33e50e1 @ main diff --git a/docs/introduction.html b/docs/introduction.html index 57aee41..c3e2c6a 100644 --- a/docs/introduction.html +++ b/docs/introduction.html @@ -426,7 +426,7 @@

Introduction - 0553955a + b33e50e1 @ main diff --git a/docs/mermaid.html b/docs/mermaid.html index f9188b3..08fb666 100644 --- a/docs/mermaid.html +++ b/docs/mermaid.html @@ -430,7 +430,7 @@

Mermaid Diagrams0553955a + b33e50e1 @ main diff --git a/docs/rich-links.html b/docs/rich-links.html index 0cf4cb4..e84ae98 100644 --- a/docs/rich-links.html +++ b/docs/rich-links.html @@ -506,7 +506,7 @@

View Mode Buttons0553955a + b33e50e1 @ main