md-editor-v3 4.19.1 → 4.19.2

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.
@@ -1,7 +1,7 @@
1
1
  import { inject, onMounted, watch, toRef, nextTick, shallowRef, ref, computed, onBeforeUnmount, defineComponent, createVNode, Fragment, reactive, provide } from "vue";
2
2
  import { p as prefix, f as configOption, g as codeCss, s as staticTextDefault, b as allToolbar, d as allFooter } from "./config.mjs";
3
3
  import { b as bus, C as CATALOG_CHANGED, P as PUSH_CATALOG, h as RERENDER, B as BUILD_FINISHED, T as TASK_STATE_CHANGED, d as ON_SAVE, E as ERROR_CATCHER, U as UPLOAD_IMAGE, c as CHANGE_CATALOG_VISIBLE, i as PAGE_FULL_SCREEN_CHANGED, F as FULL_SCREEN_CHANGED, j as PREVIEW_CHANGED, k as PREVIEW_ONLY_CHANGED, H as HTML_PREVIEW_CHANGED, l as CATALOG_VISIBLE_CHANGED, R as REPLACE, a as CHANGE_FULL_SCREEN, g as EVENT_LISTENER } from "./event-name.mjs";
4
- import { a as appendHandler, u as updateHandler } from "./dom.mjs";
4
+ import { a as appendHandler, u as updateHandler, z as zoomMermaid } from "./dom.mjs";
5
5
  import { debounce, randomId, deepMerge, deepClone } from "@vavt/util";
6
6
  import mediumZoom from "medium-zoom";
7
7
  import copy from "copy-to-clipboard";
@@ -207,52 +207,57 @@ const useMermaid = (props) => {
207
207
  );
208
208
  }
209
209
  });
210
- const replaceMermaid = () => {
211
- nextTick(() => {
212
- if (!props.noMermaid && mermaidRef.value) {
213
- const mermaidSourceEles = rootRef.value.querySelectorAll(
214
- `div.${prefix}-mermaid`
215
- );
216
- const svgContainingElement = document.createElement("div");
217
- svgContainingElement.style.width = document.body.offsetWidth + "px";
218
- svgContainingElement.style.height = document.body.offsetHeight + "px";
219
- svgContainingElement.style.position = "fixed";
220
- svgContainingElement.style.zIndex = "-10000";
221
- svgContainingElement.style.top = "-10000";
222
- let count = mermaidSourceEles.length;
223
- if (count > 0) {
224
- document.body.appendChild(svgContainingElement);
225
- }
226
- mermaidSourceEles.forEach(async (item) => {
227
- let mermaidHtml = mermaidCache.get(item.innerText);
228
- if (!mermaidHtml) {
229
- const idRand = randomId();
230
- const render = mermaidRef.value.renderAsync || mermaidRef.value.render;
231
- let svg = "";
232
- try {
233
- svg = await render(idRand, item.innerText, svgContainingElement);
234
- } catch (error) {
235
- }
236
- mermaidHtml = await props.sanitizeMermaid(
237
- typeof svg === "string" ? svg : svg.svg
238
- );
239
- }
240
- const p = document.createElement("p");
241
- p.className = `${prefix}-mermaid`;
242
- p.setAttribute("data-processed", "");
243
- p.innerHTML = mermaidHtml;
244
- p.children[0].removeAttribute("height");
245
- mermaidCache.set(item.innerText, p.innerHTML);
246
- if (item.dataset.line !== void 0) {
247
- p.dataset.line = item.dataset.line;
248
- }
249
- item.replaceWith(p);
250
- if (--count === 0) {
251
- svgContainingElement.remove();
252
- }
253
- });
210
+ const replaceMermaid = async () => {
211
+ if (!props.noMermaid && mermaidRef.value) {
212
+ const mermaidSourceEles = rootRef.value.querySelectorAll(
213
+ `div.${prefix}-mermaid`
214
+ );
215
+ const svgContainingElement = document.createElement("div");
216
+ const sceWidth = document.body.offsetWidth > 1366 ? document.body.offsetWidth : 1366;
217
+ const sceHeight = document.body.offsetHeight > 768 ? document.body.offsetHeight : 768;
218
+ svgContainingElement.style.width = sceWidth + "px";
219
+ svgContainingElement.style.height = sceHeight + "px";
220
+ svgContainingElement.style.position = "fixed";
221
+ svgContainingElement.style.zIndex = "-10000";
222
+ svgContainingElement.style.top = "-10000";
223
+ let count = mermaidSourceEles.length;
224
+ if (count > 0) {
225
+ document.body.appendChild(svgContainingElement);
254
226
  }
255
- });
227
+ await Promise.allSettled(
228
+ Array.from(mermaidSourceEles).map((ele) => {
229
+ const handler = async (item) => {
230
+ let mermaidHtml = mermaidCache.get(item.innerText);
231
+ if (!mermaidHtml) {
232
+ const idRand = randomId();
233
+ const render = mermaidRef.value.renderAsync || mermaidRef.value.render;
234
+ let svg = "";
235
+ try {
236
+ svg = await render(idRand, item.innerText, svgContainingElement);
237
+ } catch (error) {
238
+ }
239
+ mermaidHtml = await props.sanitizeMermaid(
240
+ typeof svg === "string" ? svg : svg.svg
241
+ );
242
+ }
243
+ const p = document.createElement("p");
244
+ p.className = `${prefix}-mermaid`;
245
+ p.setAttribute("data-processed", "");
246
+ p.innerHTML = mermaidHtml;
247
+ p.children[0].removeAttribute("height");
248
+ mermaidCache.set(item.innerText, p.innerHTML);
249
+ if (item.dataset.line !== void 0) {
250
+ p.dataset.line = item.dataset.line;
251
+ }
252
+ item.replaceWith(p);
253
+ if (--count === 0) {
254
+ svgContainingElement.remove();
255
+ }
256
+ };
257
+ return handler(ele);
258
+ })
259
+ );
260
+ }
256
261
  };
257
262
  return { mermaidRef, reRenderRef, replaceMermaid };
258
263
  };
@@ -302,7 +307,6 @@ const MermaidPlugin = (md, options) => {
302
307
  return temp(tokens, idx, ops, env, slf);
303
308
  };
304
309
  };
305
- const MermaidPlugin$1 = MermaidPlugin;
306
310
  const mergeAttrs = (token, addAttrs) => {
307
311
  const tmpAttrs = token.attrs ? token.attrs.slice() : [];
308
312
  addAttrs.forEach((addAttr) => {
@@ -454,7 +458,6 @@ const KatexPlugin = (md, { katexRef }) => {
454
458
  md.renderer.rules.math_inline = katexInline;
455
459
  md.renderer.rules.math_block = katexBlock;
456
460
  };
457
- const KatexPlugin$1 = KatexPlugin;
458
461
  const AdmonitionPlugin = (md, options) => {
459
462
  options = options || {};
460
463
  const markers = 3, markerStr = options.marker || "!", markerChar = markerStr.charCodeAt(0), markerLen = markerStr.length;
@@ -574,7 +577,6 @@ const AdmonitionPlugin = (md, options) => {
574
577
  md.renderer.rules["admonition_title_close"] = render;
575
578
  md.renderer.rules["admonition_close"] = render;
576
579
  };
577
- const AdmonitionPlugin$1 = AdmonitionPlugin;
578
580
  const HeadingPlugin = (md, options) => {
579
581
  md.renderer.rules.heading_open = (tokens, idx) => {
580
582
  var _a;
@@ -599,7 +601,6 @@ const HeadingPlugin = (md, options) => {
599
601
  return self2.renderToken(tokens, idx, opts);
600
602
  };
601
603
  };
602
- const HeadingPlugin$1 = HeadingPlugin;
603
604
  const StrIcon = (name, customIcon) => {
604
605
  if (typeof customIcon[name] === "string") {
605
606
  return customIcon[name];
@@ -704,7 +705,6 @@ const codetabs = (md, _opts) => {
704
705
  md.renderer.rules.fence = fenceGroup;
705
706
  md.renderer.rules.code_block = fenceGroup;
706
707
  };
707
- const CodePlugin = codetabs;
708
708
  function getDefaultExportFromCjs(x) {
709
709
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
710
710
  }
@@ -1057,8 +1057,7 @@ function onIgnoreAttr(name, value, options) {
1057
1057
  }
1058
1058
  var REGEXP_URL_JAVASCRIPT = /javascript\s*\:/img;
1059
1059
  function safeAttrValue$1(name, value) {
1060
- if (REGEXP_URL_JAVASCRIPT.test(value))
1061
- return "";
1060
+ if (REGEXP_URL_JAVASCRIPT.test(value)) return "";
1062
1061
  return value;
1063
1062
  }
1064
1063
  _default.whiteList = getDefaultWhiteList$1();
@@ -1104,8 +1103,7 @@ var util$1 = {
1104
1103
  var _$3 = util$1;
1105
1104
  function parseStyle$1(css2, onAttr2) {
1106
1105
  css2 = _$3.trimRight(css2);
1107
- if (css2[css2.length - 1] !== ";")
1108
- css2 += ";";
1106
+ if (css2[css2.length - 1] !== ";") css2 += ";";
1109
1107
  var cssLength = css2.length;
1110
1108
  var isParenthesisOpen = false;
1111
1109
  var lastPos = 0;
@@ -1120,8 +1118,7 @@ function parseStyle$1(css2, onAttr2) {
1120
1118
  var value = _$3.trim(source.slice(j2 + 1));
1121
1119
  if (name) {
1122
1120
  var ret = onAttr2(lastPos, retCSS.length, name, value, source);
1123
- if (ret)
1124
- retCSS += ret + "; ";
1121
+ if (ret) retCSS += ret + "; ";
1125
1122
  }
1126
1123
  }
1127
1124
  }
@@ -1131,8 +1128,7 @@ function parseStyle$1(css2, onAttr2) {
1131
1128
  var c = css2[i];
1132
1129
  if (c === "/" && css2[i + 1] === "*") {
1133
1130
  var j = css2.indexOf("*/", i + 2);
1134
- if (j === -1)
1135
- break;
1131
+ if (j === -1) break;
1136
1132
  i = j + 1;
1137
1133
  lastPos = i + 1;
1138
1134
  isParenthesisOpen = false;
@@ -1141,8 +1137,7 @@ function parseStyle$1(css2, onAttr2) {
1141
1137
  } else if (c === ")") {
1142
1138
  isParenthesisOpen = false;
1143
1139
  } else if (c === ";") {
1144
- if (isParenthesisOpen)
1145
- ;
1140
+ if (isParenthesisOpen) ;
1146
1141
  else {
1147
1142
  addNewAttr();
1148
1143
  }
@@ -1176,8 +1171,7 @@ function FilterCSS$2(options) {
1176
1171
  FilterCSS$2.prototype.process = function(css2) {
1177
1172
  css2 = css2 || "";
1178
1173
  css2 = css2.toString();
1179
- if (!css2)
1180
- return "";
1174
+ if (!css2) return "";
1181
1175
  var me = this;
1182
1176
  var options = me.options;
1183
1177
  var whiteList = options.whiteList;
@@ -1187,17 +1181,12 @@ FilterCSS$2.prototype.process = function(css2) {
1187
1181
  var retCSS = parseStyle(css2, function(sourcePosition, position, name, value, source) {
1188
1182
  var check = whiteList[name];
1189
1183
  var isWhite = false;
1190
- if (check === true)
1191
- isWhite = check;
1192
- else if (typeof check === "function")
1193
- isWhite = check(value);
1194
- else if (check instanceof RegExp)
1195
- isWhite = check.test(value);
1196
- if (isWhite !== true)
1197
- isWhite = false;
1184
+ if (check === true) isWhite = check;
1185
+ else if (typeof check === "function") isWhite = check(value);
1186
+ else if (check instanceof RegExp) isWhite = check.test(value);
1187
+ if (isWhite !== true) isWhite = false;
1198
1188
  value = safeAttrValue2(name, value);
1199
- if (!value)
1200
- return;
1189
+ if (!value) return;
1201
1190
  var opts = {
1202
1191
  position,
1203
1192
  sourcePosition,
@@ -1230,8 +1219,7 @@ var css = FilterCSS$2;
1230
1219
  }
1231
1220
  exports = module.exports = filterCSS;
1232
1221
  exports.FilterCSS = FilterCSS2;
1233
- for (var i in DEFAULT2)
1234
- exports[i] = DEFAULT2[i];
1222
+ for (var i in DEFAULT2) exports[i] = DEFAULT2[i];
1235
1223
  if (typeof window !== "undefined") {
1236
1224
  window.filterCSS = module.exports;
1237
1225
  }
@@ -1382,8 +1370,7 @@ function safeAttrValue(tag, name, value, cssFilter) {
1382
1370
  value = friendlyAttrValue(value);
1383
1371
  if (name === "href" || name === "src") {
1384
1372
  value = _$2.trim(value);
1385
- if (value === "#")
1386
- return "#";
1373
+ if (value === "#") return "#";
1387
1374
  if (!(value.substr(0, 7) === "http://" || value.substr(0, 8) === "https://" || value.substr(0, 7) === "mailto:" || value.substr(0, 4) === "tel:" || value.substr(0, 11) === "data:image/" || value.substr(0, 6) === "ftp://" || value.substr(0, 2) === "./" || value.substr(0, 3) === "../" || value[0] === "#" || value[0] === "/")) {
1388
1375
  return "";
1389
1376
  }
@@ -1465,8 +1452,7 @@ function StripTagBody(tags, next) {
1465
1452
  }
1466
1453
  var isRemoveAllTag = !Array.isArray(tags);
1467
1454
  function isRemoveTag(tag) {
1468
- if (isRemoveAllTag)
1469
- return true;
1455
+ if (isRemoveAllTag) return true;
1470
1456
  return _$2.indexOf(tags, tag) !== -1;
1471
1457
  }
1472
1458
  var removeList = [];
@@ -1527,11 +1513,9 @@ function stripBlankChar(html) {
1527
1513
  var chars = html.split("");
1528
1514
  chars = chars.filter(function(char) {
1529
1515
  var c = char.charCodeAt(0);
1530
- if (c === 127)
1531
- return false;
1516
+ if (c === 127) return false;
1532
1517
  if (c <= 31) {
1533
- if (c === 10 || c === 13)
1534
- return true;
1518
+ if (c === 10 || c === 13) return true;
1535
1519
  return false;
1536
1520
  }
1537
1521
  return true;
@@ -1571,10 +1555,8 @@ function getTagName(html) {
1571
1555
  tagName = html.slice(1, i + 1);
1572
1556
  }
1573
1557
  tagName = _$1.trim(tagName).toLowerCase();
1574
- if (tagName.slice(0, 1) === "/")
1575
- tagName = tagName.slice(1);
1576
- if (tagName.slice(-1) === "/")
1577
- tagName = tagName.slice(0, -1);
1558
+ if (tagName.slice(0, 1) === "/") tagName = tagName.slice(1);
1559
+ if (tagName.slice(-1) === "/") tagName = tagName.slice(0, -1);
1578
1560
  return tagName;
1579
1561
  }
1580
1562
  function isClosing(html) {
@@ -1589,56 +1571,55 @@ function parseTag$1(html, onTag2, escapeHtml2) {
1589
1571
  var len = html.length;
1590
1572
  var currentTagName = "";
1591
1573
  var currentHtml = "";
1592
- chariterator:
1593
- for (currentPos = 0; currentPos < len; currentPos++) {
1594
- var c = html.charAt(currentPos);
1595
- if (tagStart === false) {
1574
+ chariterator: for (currentPos = 0; currentPos < len; currentPos++) {
1575
+ var c = html.charAt(currentPos);
1576
+ if (tagStart === false) {
1577
+ if (c === "<") {
1578
+ tagStart = currentPos;
1579
+ continue;
1580
+ }
1581
+ } else {
1582
+ if (quoteStart === false) {
1596
1583
  if (c === "<") {
1584
+ rethtml += escapeHtml2(html.slice(lastPos, currentPos));
1597
1585
  tagStart = currentPos;
1586
+ lastPos = currentPos;
1598
1587
  continue;
1599
1588
  }
1600
- } else {
1601
- if (quoteStart === false) {
1602
- if (c === "<") {
1603
- rethtml += escapeHtml2(html.slice(lastPos, currentPos));
1604
- tagStart = currentPos;
1605
- lastPos = currentPos;
1606
- continue;
1607
- }
1608
- if (c === ">" || currentPos === len - 1) {
1609
- rethtml += escapeHtml2(html.slice(lastPos, tagStart));
1610
- currentHtml = html.slice(tagStart, currentPos + 1);
1611
- currentTagName = getTagName(currentHtml);
1612
- rethtml += onTag2(
1613
- tagStart,
1614
- rethtml.length,
1615
- currentTagName,
1616
- currentHtml,
1617
- isClosing(currentHtml)
1618
- );
1619
- lastPos = currentPos + 1;
1620
- tagStart = false;
1621
- continue;
1622
- }
1623
- if (c === '"' || c === "'") {
1624
- var i = 1;
1625
- var ic = html.charAt(currentPos - i);
1626
- while (ic.trim() === "" || ic === "=") {
1627
- if (ic === "=") {
1628
- quoteStart = c;
1629
- continue chariterator;
1630
- }
1631
- ic = html.charAt(currentPos - ++i);
1589
+ if (c === ">" || currentPos === len - 1) {
1590
+ rethtml += escapeHtml2(html.slice(lastPos, tagStart));
1591
+ currentHtml = html.slice(tagStart, currentPos + 1);
1592
+ currentTagName = getTagName(currentHtml);
1593
+ rethtml += onTag2(
1594
+ tagStart,
1595
+ rethtml.length,
1596
+ currentTagName,
1597
+ currentHtml,
1598
+ isClosing(currentHtml)
1599
+ );
1600
+ lastPos = currentPos + 1;
1601
+ tagStart = false;
1602
+ continue;
1603
+ }
1604
+ if (c === '"' || c === "'") {
1605
+ var i = 1;
1606
+ var ic = html.charAt(currentPos - i);
1607
+ while (ic.trim() === "" || ic === "=") {
1608
+ if (ic === "=") {
1609
+ quoteStart = c;
1610
+ continue chariterator;
1632
1611
  }
1633
- }
1634
- } else {
1635
- if (c === quoteStart) {
1636
- quoteStart = false;
1637
- continue;
1612
+ ic = html.charAt(currentPos - ++i);
1638
1613
  }
1639
1614
  }
1615
+ } else {
1616
+ if (c === quoteStart) {
1617
+ quoteStart = false;
1618
+ continue;
1619
+ }
1640
1620
  }
1641
1621
  }
1622
+ }
1642
1623
  if (lastPos < len) {
1643
1624
  rethtml += escapeHtml2(html.substr(lastPos));
1644
1625
  }
@@ -1654,11 +1635,9 @@ function parseAttr$1(html, onAttr2) {
1654
1635
  function addAttr(name, value) {
1655
1636
  name = _$1.trim(name);
1656
1637
  name = name.replace(REGEXP_ILLEGAL_ATTR_NAME, "").toLowerCase();
1657
- if (name.length < 1)
1658
- return;
1638
+ if (name.length < 1) return;
1659
1639
  var ret = onAttr2(name, value || "");
1660
- if (ret)
1661
- retAttrs.push(ret);
1640
+ if (ret) retAttrs.push(ret);
1662
1641
  }
1663
1642
  for (var i = 0; i < len; i++) {
1664
1643
  var c = html.charAt(i);
@@ -1725,30 +1704,24 @@ function parseAttr$1(html, onAttr2) {
1725
1704
  function findNextEqual(str, i) {
1726
1705
  for (; i < str.length; i++) {
1727
1706
  var c = str[i];
1728
- if (c === " ")
1729
- continue;
1730
- if (c === "=")
1731
- return i;
1707
+ if (c === " ") continue;
1708
+ if (c === "=") return i;
1732
1709
  return -1;
1733
1710
  }
1734
1711
  }
1735
1712
  function findNextQuotationMark(str, i) {
1736
1713
  for (; i < str.length; i++) {
1737
1714
  var c = str[i];
1738
- if (c === " ")
1739
- continue;
1740
- if (c === "'" || c === '"')
1741
- return i;
1715
+ if (c === " ") continue;
1716
+ if (c === "'" || c === '"') return i;
1742
1717
  return -1;
1743
1718
  }
1744
1719
  }
1745
1720
  function findBeforeEqual(str, i) {
1746
1721
  for (; i > 0; i--) {
1747
1722
  var c = str[i];
1748
- if (c === " ")
1749
- continue;
1750
- if (c === "=")
1751
- return i;
1723
+ if (c === " ") continue;
1724
+ if (c === "=") return i;
1752
1725
  return -1;
1753
1726
  }
1754
1727
  }
@@ -1787,8 +1760,7 @@ function getAttrs(html) {
1787
1760
  }
1788
1761
  html = _.trim(html.slice(i + 1, -1));
1789
1762
  var isClosing2 = html[html.length - 1] === "/";
1790
- if (isClosing2)
1791
- html = _.trim(html.slice(0, -1));
1763
+ if (isClosing2) html = _.trim(html.slice(0, -1));
1792
1764
  return {
1793
1765
  html,
1794
1766
  closing: isClosing2
@@ -1847,8 +1819,7 @@ function FilterXSS(options) {
1847
1819
  FilterXSS.prototype.process = function(html) {
1848
1820
  html = html || "";
1849
1821
  html = html.toString();
1850
- if (!html)
1851
- return "";
1822
+ if (!html) return "";
1852
1823
  var me = this;
1853
1824
  var options = me.options;
1854
1825
  var whiteList = options.whiteList;
@@ -1884,8 +1855,7 @@ FilterXSS.prototype.process = function(html) {
1884
1855
  isWhite: Object.prototype.hasOwnProperty.call(whiteList, tag)
1885
1856
  };
1886
1857
  var ret = onTag2(tag, html2, info);
1887
- if (!isNull(ret))
1888
- return ret;
1858
+ if (!isNull(ret)) return ret;
1889
1859
  if (info.isWhite) {
1890
1860
  if (info.isClosing) {
1891
1861
  return "</" + tag + ">";
@@ -1895,8 +1865,7 @@ FilterXSS.prototype.process = function(html) {
1895
1865
  var attrsHtml = parseAttr(attrs.html, function(name, value) {
1896
1866
  var isWhiteAttr = _.indexOf(whiteAttrList, name) !== -1;
1897
1867
  var ret2 = onTagAttr2(tag, name, value, isWhiteAttr);
1898
- if (!isNull(ret2))
1899
- return ret2;
1868
+ if (!isNull(ret2)) return ret2;
1900
1869
  if (isWhiteAttr) {
1901
1870
  value = safeAttrValue2(tag, name, value, cssFilter);
1902
1871
  if (value) {
@@ -1906,22 +1875,18 @@ FilterXSS.prototype.process = function(html) {
1906
1875
  }
1907
1876
  } else {
1908
1877
  ret2 = onIgnoreTagAttr2(tag, name, value, isWhiteAttr);
1909
- if (!isNull(ret2))
1910
- return ret2;
1878
+ if (!isNull(ret2)) return ret2;
1911
1879
  return;
1912
1880
  }
1913
1881
  });
1914
1882
  html2 = "<" + tag;
1915
- if (attrsHtml)
1916
- html2 += " " + attrsHtml;
1917
- if (attrs.closing)
1918
- html2 += " /";
1883
+ if (attrsHtml) html2 += " " + attrsHtml;
1884
+ if (attrs.closing) html2 += " /";
1919
1885
  html2 += ">";
1920
1886
  return html2;
1921
1887
  } else {
1922
1888
  ret = onIgnoreTag2(tag, html2, info);
1923
- if (!isNull(ret))
1924
- return ret;
1889
+ if (!isNull(ret)) return ret;
1925
1890
  return escapeHtml2(html2);
1926
1891
  }
1927
1892
  },
@@ -2029,7 +1994,6 @@ const XSSPlugin = (md, options) => {
2029
1994
  }
2030
1995
  });
2031
1996
  };
2032
- const XSSPlugin$1 = XSSPlugin;
2033
1997
  const attrSet = (token, name, value) => {
2034
1998
  const index2 = token.attrIndex(name);
2035
1999
  const attr = [name, value];
@@ -2123,7 +2087,6 @@ const githubTaskLists = (md, options = {}) => {
2123
2087
  }
2124
2088
  });
2125
2089
  };
2126
- const TaskListPlugin = githubTaskLists;
2127
2090
  const initLineNumber = (md) => {
2128
2091
  md.core.ruler.push("init-line-number", (state) => {
2129
2092
  state.tokens.forEach((token) => {
@@ -2147,6 +2110,7 @@ const useMarkdownIt = (props, previewOnly) => {
2147
2110
  const showCodeRowNumber = inject("showCodeRowNumber");
2148
2111
  const themeRef = inject("theme");
2149
2112
  const customIconRef = inject("customIcon");
2113
+ const rootRef = inject("rootRef");
2150
2114
  const headsRef = ref([]);
2151
2115
  const hljsRef = useHighlight(props);
2152
2116
  const katexRef = useKatex(props);
@@ -2167,22 +2131,22 @@ const useMarkdownIt = (props, previewOnly) => {
2167
2131
  },
2168
2132
  {
2169
2133
  type: "admonition",
2170
- plugin: AdmonitionPlugin$1,
2134
+ plugin: AdmonitionPlugin,
2171
2135
  options: {}
2172
2136
  },
2173
2137
  {
2174
2138
  type: "taskList",
2175
- plugin: TaskListPlugin,
2139
+ plugin: githubTaskLists,
2176
2140
  options: {}
2177
2141
  },
2178
2142
  {
2179
2143
  type: "heading",
2180
- plugin: HeadingPlugin$1,
2144
+ plugin: HeadingPlugin,
2181
2145
  options: { mdHeadingId: props.mdHeadingId, headsRef }
2182
2146
  },
2183
2147
  {
2184
2148
  type: "code",
2185
- plugin: CodePlugin,
2149
+ plugin: codetabs,
2186
2150
  options: {
2187
2151
  editorId,
2188
2152
  usedLanguageTextRef,
@@ -2194,21 +2158,21 @@ const useMarkdownIt = (props, previewOnly) => {
2194
2158
  },
2195
2159
  {
2196
2160
  type: "xss",
2197
- plugin: XSSPlugin$1,
2161
+ plugin: XSSPlugin,
2198
2162
  options: {}
2199
2163
  }
2200
2164
  ];
2201
2165
  if (!props.noKatex) {
2202
2166
  plugins.push({
2203
2167
  type: "katex",
2204
- plugin: KatexPlugin$1,
2168
+ plugin: KatexPlugin,
2205
2169
  options: { katexRef }
2206
2170
  });
2207
2171
  }
2208
2172
  if (!props.noMermaid) {
2209
2173
  plugins.push({
2210
2174
  type: "mermaid",
2211
- plugin: MermaidPlugin$1,
2175
+ plugin: MermaidPlugin,
2212
2176
  options: { themeRef }
2213
2177
  });
2214
2178
  }
@@ -2255,7 +2219,11 @@ const useMarkdownIt = (props, previewOnly) => {
2255
2219
  props.onHtmlChanged(html.value);
2256
2220
  props.onGetCatalog(headsRef.value);
2257
2221
  bus.emit(editorId, CATALOG_CHANGED, headsRef.value);
2258
- replaceMermaid();
2222
+ nextTick(() => {
2223
+ replaceMermaid().then(() => {
2224
+ zoomMermaid(rootRef.value.querySelectorAll(`#${editorId} .${prefix}-mermaid`));
2225
+ });
2226
+ });
2259
2227
  };
2260
2228
  onMounted(updatedTodo);
2261
2229
  const markHtml = () => {
@@ -2275,7 +2243,11 @@ const useMarkdownIt = (props, previewOnly) => {
2275
2243
  () => {
2276
2244
  if (props.setting.preview) {
2277
2245
  nextTick(() => {
2278
- replaceMermaid();
2246
+ replaceMermaid().then(() => {
2247
+ zoomMermaid(
2248
+ rootRef.value.querySelectorAll(`#${editorId} .${prefix}-mermaid`)
2249
+ );
2250
+ });
2279
2251
  bus.emit(editorId, CATALOG_CHANGED, headsRef.value);
2280
2252
  });
2281
2253
  }
@@ -2298,7 +2270,6 @@ const useMarkdownIt = (props, previewOnly) => {
2298
2270
  });
2299
2271
  return { html, key };
2300
2272
  };
2301
- const useMarkdownIt$1 = useMarkdownIt;
2302
2273
  const template = {
2303
2274
  checked: {
2304
2275
  regexp: /- \[x\]/,
@@ -2516,7 +2487,7 @@ const ContentPreview = /* @__PURE__ */ defineComponent({
2516
2487
  const {
2517
2488
  html,
2518
2489
  key
2519
- } = useMarkdownIt$1(props, props.previewOnly);
2490
+ } = useMarkdownIt(props, props.previewOnly);
2520
2491
  useCopyCode(props, html, key);
2521
2492
  userZoom(props, html);
2522
2493
  useTaskState(props, html);
@@ -348,7 +348,6 @@ const CatalogLink = /* @__PURE__ */ defineComponent({
348
348
  };
349
349
  }
350
350
  });
351
- const CatalogLink$1 = CatalogLink;
352
351
  const props = {
353
352
  /**
354
353
  * 编辑器的Id,务必与需要绑定的编辑器Id相同
@@ -546,7 +545,7 @@ const MdCatalog = /* @__PURE__ */ defineComponent({
546
545
  "class": [`${prefix}-catalog${props2.theme === "dark" ? "-dark" : ""}`, `${props2.class}`],
547
546
  "ref": catalogRef
548
547
  }, [catalogs.value.map((item) => {
549
- return createVNode(CatalogLink$1, {
548
+ return createVNode(CatalogLink, {
550
549
  "mdHeadingId": props2.mdHeadingId,
551
550
  "tocItem": item,
552
551
  "key": `link-${item.level}-${item.text}`,