@cnblogs/markdown-it-presets 1.9.14 → 1.9.15
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/commonjs/index.cjs
CHANGED
|
@@ -6211,7 +6211,7 @@ var MathEngine = /* @__PURE__ */ ((MathEngine2) => {
|
|
|
6211
6211
|
})(MathEngine || {});
|
|
6212
6212
|
var defaultConfig = {
|
|
6213
6213
|
[0 /* MathJax2 */]: {
|
|
6214
|
-
entryScript: "https://mathjax.cnblogs.com/2_7_5/MathJax.js?config=TeX-
|
|
6214
|
+
entryScript: "https://mathjax.cnblogs.com/2_7_5/MathJax.js?config=TeX-AMS_CHTML&delayStartupUntil=configured&v=20200504",
|
|
6215
6215
|
document: window.document,
|
|
6216
6216
|
engine: 0 /* MathJax2 */,
|
|
6217
6217
|
isEnabled: true
|
|
@@ -46,7 +46,7 @@ var MathEngine = /* @__PURE__ */ ((MathEngine2) => {
|
|
|
46
46
|
})(MathEngine || {});
|
|
47
47
|
var defaultConfig = {
|
|
48
48
|
[0 /* MathJax2 */]: {
|
|
49
|
-
entryScript: "https://mathjax.cnblogs.com/2_7_5/MathJax.js?config=TeX-
|
|
49
|
+
entryScript: "https://mathjax.cnblogs.com/2_7_5/MathJax.js?config=TeX-AMS_CHTML&delayStartupUntil=configured&v=20200504",
|
|
50
50
|
document: window.document,
|
|
51
51
|
engine: 0 /* MathJax2 */,
|
|
52
52
|
isEnabled: true
|
|
@@ -5,7 +5,7 @@ export var MathEngine;
|
|
|
5
5
|
})(MathEngine || (MathEngine = {}));
|
|
6
6
|
export const defaultConfig = {
|
|
7
7
|
[MathEngine.MathJax2]: {
|
|
8
|
-
entryScript: 'https://mathjax.cnblogs.com/2_7_5/MathJax.js?config=TeX-
|
|
8
|
+
entryScript: 'https://mathjax.cnblogs.com/2_7_5/MathJax.js?config=TeX-AMS_CHTML&delayStartupUntil=configured&v=20200504',
|
|
9
9
|
document: window.document,
|
|
10
10
|
engine: MathEngine.MathJax2,
|
|
11
11
|
isEnabled: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../../src/math/model.ts"],"names":[],"mappings":"AAgBA,MAAM,CAAN,IAAY,UAGX;AAHD,WAAY,UAAU;IAClB,mDAAY,CAAA;IACZ,mDAAY,CAAA;AAChB,CAAC,EAHW,UAAU,KAAV,UAAU,QAGrB;AAsBD,MAAM,CAAC,MAAM,aAAa,GAGtB;IACA,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE;QACnB,WAAW,EACP,
|
|
1
|
+
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../../src/math/model.ts"],"names":[],"mappings":"AAgBA,MAAM,CAAN,IAAY,UAGX;AAHD,WAAY,UAAU;IAClB,mDAAY,CAAA;IACZ,mDAAY,CAAA;AAChB,CAAC,EAHW,UAAU,KAAV,UAAU,QAGrB;AAsBD,MAAM,CAAC,MAAM,aAAa,GAGtB;IACA,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE;QACnB,WAAW,EACP,2GAA2G;QAC/G,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,MAAM,EAAE,UAAU,CAAC,QAAQ;QAC3B,SAAS,EAAE,IAAI;KAClB;IACD,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE;QACnB,WAAW,EAAE,wDAAwD;QACrE,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,MAAM,EAAE,UAAU,CAAC,QAAQ;QAC3B,SAAS,EAAE,IAAI;KAClB;CACJ,CAAC"}
|
package/dist/umd/mathRenderer.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.mathRenderer=t():e.mathRenderer=t()}(self,(function(){return function(){"use strict";var e={d:function(t,n){for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{IMathRenderer:function(){return o.IMathRenderer},MathEngine:function(){return r},MathJax2RendererConfig:function(){return o.MathJax2RendererConfig},MathJax3RendererConfig:function(){return o.MathJax3RendererConfig},RendererConfig:function(){return o.RendererConfig},createMathJaxRenderer:function(){return M}});var n,r,o={};function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}e.r(o),e.d(o,{M:function(){return r},u:function(){return a}}),function(e){e[e.MathJax2=0]="MathJax2",e[e.MathJax3=1]="MathJax3"}(r||(r={}));var a=(i(n={},r.MathJax2,{entryScript:"https://mathjax.cnblogs.com/2_7_5/MathJax.js?config=TeX-
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.mathRenderer=t():e.mathRenderer=t()}(self,(function(){return function(){"use strict";var e={d:function(t,n){for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{IMathRenderer:function(){return o.IMathRenderer},MathEngine:function(){return r},MathJax2RendererConfig:function(){return o.MathJax2RendererConfig},MathJax3RendererConfig:function(){return o.MathJax3RendererConfig},RendererConfig:function(){return o.RendererConfig},createMathJaxRenderer:function(){return M}});var n,r,o={};function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}e.r(o),e.d(o,{M:function(){return r},u:function(){return a}}),function(e){e[e.MathJax2=0]="MathJax2",e[e.MathJax3=1]="MathJax3"}(r||(r={}));var a=(i(n={},r.MathJax2,{entryScript:"https://mathjax.cnblogs.com/2_7_5/MathJax.js?config=TeX-AMS_CHTML&delayStartupUntil=configured&v=20200504",document:window.document,engine:r.MathJax2,isEnabled:!0}),i(n,r.MathJax3,{entryScript:"https://mathjax.cnblogs.com/3_2_1/es5/tex-mml-chtml.js",document:window.document,engine:r.MathJax3,isEnabled:!0}),n),u=[],c=function(e){e&&clearTimeout(e)},l=function(e,t){var n=u.findIndex((function(n){return e&&n[0]===e||n[0]===t}));n>=0&&u.splice(n,1)},s={},f=function(){return s},d=function(e){var t,n=e.src,r=e.id,o=e.timeoutSeconds,i=e.appendTo,a=e.executionStrategy;return function(e){var t,n,r=e.url,o=e.id,i=e.timeoutSeconds,a=e.appendTo,s=e.hostElementTagName,f=e.beforeElementCreateCallback,d=a?a.ownerDocument:document,h=null!==(n=null!==(t=d.defaultView)&&void 0!==t?t:d.parentWindow)&&void 0!==n?n:window,p=function(e,t){var n=u.find((function(n){return e&&n[0]===e||n[0]===t}));return(null!=n?n:[])[1]}(d!==document?"load-resource-to-another-window-context-"+h.name+"-"+o:o,r);if(p)return p;var m=d.querySelector("".concat(s,"#").concat(o));return(m=(m=m||"script"===s&&d.querySelector('script[src="'.concat(r,'"]')))||"link"===s&&d.querySelector('link[href="'.concat(r,'"]')))?Promise.resolve(m):(p=new Promise((function(e,t){var n;n=s,function(n){var u;n.id=null!=o?o:"",null!=a||(a=d.head),i=i<=0?5:i,n instanceof HTMLLinkElement?(n.href=r,n.rel="stylesheet",n.type="text/css"):n instanceof HTMLScriptElement&&(n.src=r,n.type="text/javascript",n.defer=!0),n.onload=function(){c(u),l(o,r),e(n)},n.onerror=function(e){c(u),n.remove(),l(o,r),t(e)},null==f||f.call(void 0,n),a.append(n),u=setTimeout((function(){c(u),n.remove(),l(o,r),t("timeout after ".concat(i," seconds"))}),1e3*i)}(document.createElement(n))})),u.push([o||r,p]),p)}({url:n,hostElementTagName:"script",timeoutSeconds:null!==(t=null!=o?o:f().timeoutSeconds)&&void 0!==t?t:5,id:r,appendTo:null!=i?i:f().appendTo,beforeElementCreateCallback:function(e){e instanceof HTMLScriptElement&&("async"===(null!=a?a:f().executionStrategy)?(e.async=!0,e.defer=!1):(e.defer=!0,e.async=!1))}})};function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?h(Object(n),!0).forEach((function(t){v(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function m(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function g(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function b(e,t,n){return t&&g(e.prototype,t),n&&g(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function v(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var y=function(){function e(){m(this,e),v(this,"_defaultConfig",a[r.MathJax2]),v(this,"_defaultMathJaxConfig",{tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]],processClass:"math",processEscapes:!0},TeX:{equationNumbers:{autoNumber:"AMS",useLabelIds:!0},extensions:["extpfeil.js","mediawiki-texvc.js"],Macros:{bm:"\\boldsymbol"}},CommonHTML:{linebreaks:{automatic:!0}},"HTML-CSS":{linebreaks:{automatic:!0}},SVG:{linebreaks:{automatic:!0}},skipStartupTypeset:!0}),v(this,"_config",this._defaultConfig)}return b(e,[{key:"_global",get:function(){var e;return null!==(e=this._config.document.defaultView)&&void 0!==e?e:window}},{key:"render",value:function(e,t){var n=this;return this._config.isEnabled?this.init().then((function(r){if(r){var o=n._config.onRendered;r.Hub.Queue(["Typeset",r.Hub,e]),null!=o&&r.Hub.Queue((function(){return o(r)})),t&&r.Hub.Queue(t)}})).catch(console.warn):Promise.resolve()}},{key:"config",value:function(e){return this._config=Object.assign({},this._defaultConfig,e),this}},{key:"init",value:function(){var e=this;if(this._initTask)return this._initTask;var t=this._config,n=t.entryScript,r=t.tapMathJaxConfig,o=t.document;return this._initTask=d({src:n,id:"mathjax",timeoutSeconds:10,appendTo:o.head}).then((function(){var t,n=e._global.MathJax;if(n)return n.Hub.Config(null!==(t=null==r?void 0:r.call(void 0,Object.assign({},e._defaultMathJaxConfig)))&&void 0!==t?t:p({},e._defaultMathJaxConfig)),n.Hub.Configured(),n})).catch((function(){return e._initTask=void 0}))}}]),e}(),x=function(){function e(){m(this,e),v(this,"_defaultConfig",a[r.MathJax3]),v(this,"_defaultMathJaxConfig",{tex:{inlineMath:[["$","$"],["\\(","\\)"]],processEscapes:!0,tags:"ams",useLabelIds:!0,macros:{bm:"\\boldsymbol"},packages:{"[+]":["noerrors","extpfeil"]}},options:{processHtmlClass:"math",ignoreHtmlClass:"tex2jax_ignore"},loader:{load:["[tex]/noerrors","[tex]/extpfeil"]},startup:{typeset:!1}}),v(this,"_config",this._defaultConfig)}return b(e,[{key:"config",value:function(e){return this._config=Object.assign({},this._defaultConfig,e),this}},{key:"render",value:function(e,t){var n=this;return this._config.isEnabled?this.init().then((function(r){r&&(r.startup.promise=r.startup.promise.then((function(){return r.typesetPromise([e]).then((function(){try{var e;null===(e=n._config.onRendered)||void 0===e||e.call(void 0,r)}catch(e){console.error(e)}try{null==t||t.call(void 0)}catch(e){console.error(e)}}))})))})).catch(console.warn):Promise.resolve()}},{key:"init",value:function(){var e,t=this;return(null!==(e=this._initTask)&&void 0!==e?e:this._initTask=new Promise((function(e,n){var r,o,i=t._config,a=i.entryScript,u=i.tapMathJaxConfig,c=null!==(r=i.document.defaultView)&&void 0!==r?r:window;c.MathJax=null!==(o=null==u?void 0:u.call(void 0,p({},t._defaultMathJaxConfig)))&&void 0!==o?o:p({},t._defaultMathJaxConfig),c.MathJax.startup||(c.MathJax.startup={}),c.MathJax.startup.ready=function(){var t,n;null===(t=c.MathJax)||void 0===t||null===(n=t.startup)||void 0===n||n.defaultReady(),e(c.MathJax)},d({src:a,id:"mathjax",executionStrategy:"defer",appendTo:c.document.head}).catch(n)}))).catch((function(){return t._initTask=void 0}))}}]),e}(),M=function(e){switch(e.engine){case r.MathJax2:return(new y).config(e);case r.MathJax3:return(new x).config(e);default:throw Error("Renderer unavailable")}};return t}()}));
|