@pie-element/shared-math-rendering-mathjax 0.1.1-next.5 → 0.1.1-next.6
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.js +5 -9
- package/dist/unsupported-page.d.ts +1 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -187,17 +187,13 @@ function z() {
|
|
|
187
187
|
let e = window[P];
|
|
188
188
|
return typeof e?.renderMath == "function" ? e : null;
|
|
189
189
|
}
|
|
190
|
-
|
|
191
|
-
let e = i();
|
|
192
|
-
e && r("legacy-renderer-delegation", `window['${P}'] renders this element's math with MathJax ${e}`);
|
|
193
|
-
}
|
|
194
|
-
var V = async (e) => {
|
|
190
|
+
var B = async (e) => {
|
|
195
191
|
if (typeof window > "u") return;
|
|
196
192
|
let t = typeof e == "string", n;
|
|
197
193
|
t ? (n = document.createElement("div"), n.innerHTML = e) : n = e || document.body;
|
|
198
194
|
let r = z();
|
|
199
|
-
return r ?
|
|
200
|
-
},
|
|
195
|
+
return r ? await r.renderMath?.(n) : await R()(n), t ? n.innerHTML : void 0;
|
|
196
|
+
}, V = (e) => z()?.wrapMath?.(e) ?? e, H = (e) => {
|
|
201
197
|
let t = e.trim();
|
|
202
198
|
return t.startsWith("\\[") && t.endsWith("\\]") ? {
|
|
203
199
|
unwrapped: t.slice(2, -2).trim(),
|
|
@@ -224,6 +220,6 @@ var V = async (e) => {
|
|
|
224
220
|
close: "$"
|
|
225
221
|
}
|
|
226
222
|
} : { unwrapped: t };
|
|
227
|
-
},
|
|
223
|
+
}, U = (e) => z()?.mmlToLatex?.(e) ?? e;
|
|
228
224
|
//#endregion
|
|
229
|
-
export { t as MATHJAX_CONFLICT_EVENT, e as UNSUPPORTED_PAGE_DOCS_URL, M as createMathjaxRenderer, N as getMathjaxCssUrls,
|
|
225
|
+
export { t as MATHJAX_CONFLICT_EVENT, e as UNSUPPORTED_PAGE_DOCS_URL, M as createMathjaxRenderer, N as getMathjaxCssUrls, U as mmlToLatex, B as renderMath, H as unWrapMath, V as wrapMath };
|
|
@@ -13,9 +13,7 @@ export type MathjaxConflictCondition =
|
|
|
13
13
|
/** `window.MathJax` is a MathJax 3 build. */
|
|
14
14
|
'mathjax-3-global'
|
|
15
15
|
/** Another MathJax output stylesheet was added to `<head>` beside this adapter's. */
|
|
16
|
-
| 'foreign-output-stylesheet'
|
|
17
|
-
/** `window['@pie-lib/math-rendering']` routes ESM element math to MathJax 3. */
|
|
18
|
-
| 'legacy-renderer-delegation';
|
|
16
|
+
| 'foreign-output-stylesheet';
|
|
19
17
|
export interface MathjaxConflictDetail {
|
|
20
18
|
condition: MathjaxConflictCondition;
|
|
21
19
|
message: string;
|