@wangeditor-next/plugin-formula 0.0.12-beta.2 → 0.0.12-beta.4

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,4 +1,3 @@
1
- .katex .katex-html {
2
- /* \newline is an empty block at top level, between .base elements */
3
- display:none;
1
+ .katex-html {
2
+ display: none;
4
3
  }
package/dist/index.js CHANGED
@@ -104,6 +104,8 @@
104
104
  Object.setPrototypeOf(HTMLElement, BuiltInHTMLElement);
105
105
  }());
106
106
 
107
+ var katexStyleContent = undefined;
108
+
107
109
  /**
108
110
  * @description 注册自定义 elem
109
111
  * @author wangfupeng
@@ -114,6 +116,9 @@
114
116
  var _this = _super.call(this) || this;
115
117
  var shadow = _this.attachShadow({ mode: 'open' });
116
118
  var document = shadow.ownerDocument;
119
+ var style = document.createElement('style');
120
+ style.innerHTML = katexStyleContent; // 加载 css 文本
121
+ shadow.appendChild(style);
117
122
  var span = document.createElement('span');
118
123
  span.style.display = 'inline-block';
119
124
  shadow.appendChild(span);
@@ -151,6 +156,7 @@
151
156
  WangEditorFormulaCard.prototype.render = function (value) {
152
157
  katex.render(value, this.span, {
153
158
  throwOnError: false,
159
+ option: 'mathml',
154
160
  });
155
161
  };
156
162
  return WangEditorFormulaCard;
package/dist/index.mjs CHANGED
@@ -102,6 +102,8 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
102
102
  Object.setPrototypeOf(HTMLElement, BuiltInHTMLElement);
103
103
  }());
104
104
 
105
+ var katexStyleContent = undefined;
106
+
105
107
  /**
106
108
  * @description 注册自定义 elem
107
109
  * @author wangfupeng
@@ -112,6 +114,9 @@ var WangEditorFormulaCard = /** @class */ (function (_super) {
112
114
  var _this = _super.call(this) || this;
113
115
  var shadow = _this.attachShadow({ mode: 'open' });
114
116
  var document = shadow.ownerDocument;
117
+ var style = document.createElement('style');
118
+ style.innerHTML = katexStyleContent; // 加载 css 文本
119
+ shadow.appendChild(style);
115
120
  var span = document.createElement('span');
116
121
  span.style.display = 'inline-block';
117
122
  shadow.appendChild(span);
@@ -149,6 +154,7 @@ var WangEditorFormulaCard = /** @class */ (function (_super) {
149
154
  WangEditorFormulaCard.prototype.render = function (value) {
150
155
  katex.render(value, this.span, {
151
156
  throwOnError: false,
157
+ option: 'mathml',
152
158
  });
153
159
  };
154
160
  return WangEditorFormulaCard;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wangeditor-next/plugin-formula",
3
- "version": "0.0.12-beta.2",
3
+ "version": "0.0.12-beta.4",
4
4
  "description": "wangEditor next formula 公式",
5
5
  "author": "cycleccc <2991205548@qq.com>",
6
6
  "type": "module",