@8btc/mditor 0.0.30 → 0.0.31

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.
package/dist/index.css CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Vditor v0.0.30 - A markdown editor written in TypeScript.
2
+ * Vditor v0.0.31 - A markdown editor written in TypeScript.
3
3
  *
4
4
  * MIT License
5
5
  *
@@ -25,7 +25,7 @@
25
25
  *
26
26
  */
27
27
  /*!
28
- * Vditor v0.0.30 - A markdown editor written in TypeScript.
28
+ * Vditor v0.0.31 - A markdown editor written in TypeScript.
29
29
  *
30
30
  * MIT License
31
31
  *
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Vditor v0.0.30 - A markdown editor written in TypeScript.
2
+ * Vditor v0.0.31 - A markdown editor written in TypeScript.
3
3
  *
4
4
  * MIT License
5
5
  *
@@ -2923,7 +2923,7 @@ var Vditor = /** @class */ (function () {
2923
2923
  /* harmony export */ "H": () => (/* binding */ _VDITOR_VERSION),
2924
2924
  /* harmony export */ "g": () => (/* binding */ Constants)
2925
2925
  /* harmony export */ });
2926
- var _VDITOR_VERSION = "0.0.30";
2926
+ var _VDITOR_VERSION = "0.0.31";
2927
2927
 
2928
2928
  var Constants = /** @class */ (function () {
2929
2929
  function Constants() {
@@ -3225,7 +3225,7 @@ var Constants = /** @class */ (function () {
3225
3225
  "c#",
3226
3226
  "bat",
3227
3227
  ];
3228
- Constants.CDN = "https://webcdn.wujieai.com/vditor@".concat("0.0.30");
3228
+ Constants.CDN = "https://webcdn.wujieai.com/vditor@".concat("0.0.31");
3229
3229
  Constants.MARKDOWN_OPTIONS = {
3230
3230
  autoSpace: false,
3231
3231
  gfmAutoLink: true,
@@ -5560,15 +5560,15 @@ var mathRender = function (element, options) {
5560
5560
  next();
5561
5561
  };
5562
5562
  if (!window.MathJax) {
5563
- // 关闭自动 typeset、不指定 elements,避免处理整个 document。外部使用本包时无需配置 startup.elements
5563
+ // typeset 设为 true 以正常完成公式渲染;elements 限定为传入的容器,外部使用本包时仅处理该容器,不影响编辑器以外的公式。
5564
5564
  // 渲染时会将 startup.elements 临时设为传入的 element(当前预览/编辑容器),再 clear/updateDocument。
5565
5565
  window.MathJax = {
5566
5566
  loader: {
5567
5567
  paths: { mathjax: "".concat(options.cdn, "/dist/js/mathjax") },
5568
5568
  },
5569
5569
  startup: {
5570
- typeset: false,
5571
- elements: [],
5570
+ typeset: true,
5571
+ elements: element instanceof HTMLElement ? [element] : [],
5572
5572
  },
5573
5573
  tex: {
5574
5574
  inlineMath: [
@@ -5633,10 +5633,11 @@ var mathRender = function (element, options) {
5633
5633
  });
5634
5634
  };
5635
5635
  window.MathJax.startup.promise.then(function () {
5636
- // 脚本加载后再次强制不自动 typeset、不指定 elements,避免组件内部或用户配置导致处理整页
5636
+ // 限定仅处理当前容器,避免组件内部或用户配置导致处理整页、影响编辑器以外的公式
5637
5637
  if (window.MathJax.startup) {
5638
- window.MathJax.startup.typeset = false;
5639
- window.MathJax.startup.elements = [];
5638
+ window.MathJax.startup.typeset = true;
5639
+ window.MathJax.startup.elements =
5640
+ element instanceof HTMLElement ? [element] : [];
5640
5641
  }
5641
5642
  var chains = [];
5642
5643
  var _loop_1 = function (i) {