@cnblogs/markdown-it-presets 1.10.4 → 1.10.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.
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see mathRenderer.js.LICENSE.txt */
2
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.mathRenderer=e():t.mathRenderer=e()}(self,(function(){return function(){"use strict";var t={d:function(e,n){for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r:function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{IMathRenderer:function(){return n.IMathRenderer},MathEngine:function(){return o},MathJax2RendererConfig:function(){return n.MathJax2RendererConfig},MathJax3RendererConfig:function(){return n.MathJax3RendererConfig},RendererConfig:function(){return n.RendererConfig},createMathRenderer:function(){return S}});var n={};t.r(n),t.d(n,{M:function(){return o},u:function(){return d}});var r,o,i=[],a=function(t){t&&clearTimeout(t)},c=function(t,e){var n=i.findIndex((function(n){return t&&n[0]===t||n[0]===e}));n>=0&&i.splice(n,1)},u=function(t){var e,n,r=t.url,o=t.id,u=t.timeoutSeconds,s=t.appendTo,l=t.hostElementTagName,f=t.beforeElementCreateCallback,h=s?s.ownerDocument:document,d=null!==(n=null!==(e=h.defaultView)&&void 0!==e?e:h.parentWindow)&&void 0!==n?n:window,p=function(t,e){var n=i.find((function(n){return t&&n[0]===t||n[0]===e}));return(null!=n?n:[])[1]}(h!==document?"load-resource-to-another-window-context-"+d.name+"-"+o:o,r);if(p)return p;var v=h.querySelector("".concat(l,"#").concat(o));return(v=(v=v||"script"===l&&h.querySelector('script[src="'.concat(r,'"]')))||"link"===l&&h.querySelector('link[href="'.concat(r,'"]')))?Promise.resolve(v):(p=new Promise((function(t,e){var n,i;n=l,i=function(n){var i;n.id=null!=o?o:"",null!=s||(s=h.head),u=u<=0?5:u,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(){a(i),c(o,r),t(n)},n.onerror=function(t){a(i),n.remove(),c(o,r),e(t)},null==f||f.call(void 0,n),s.append(n),i=setTimeout((function(){a(i),n.remove(),c(o,r),e("timeout after ".concat(u," seconds"))}),1e3*u)},i(document.createElement(n))})),i.push([o||r,p]),p)},s={},l=function(){return s},f=function(t){var e,n=t.src,r=t.id,o=t.timeoutSeconds,i=t.appendTo,a=t.executionStrategy;return u({url:n,hostElementTagName:"script",timeoutSeconds:null!==(e=null!=o?o:l().timeoutSeconds)&&void 0!==e?e:5,id:r,appendTo:null!=i?i:l().appendTo,beforeElementCreateCallback:function(t){t instanceof HTMLScriptElement&&("async"===(null!=a?a:l().executionStrategy)?(t.async=!0,t.defer=!1):(t.defer=!0,t.async=!1))}})};function h(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}!function(t){t[t.MathJax2=0]="MathJax2",t[t.MathJax3=1]="MathJax3",t[t.Katex=2]="Katex"}(o||(o={}));var d=(h(r={},o.MathJax2,{entryScript:"https://mathjax.cnblogs.com/2_7_5/MathJax.js?config=TeX-AMS_CHTML&delayStartupUntil=configured&v=20200504",document:window.document,engine:o.MathJax2,isEnabled:!0}),h(r,o.MathJax3,{entryScript:"https://mathjax.cnblogs.com/3_2_1/es5/tex-mml-chtml.js",document:window.document,engine:o.MathJax3,isEnabled:!0}),h(r,o.Katex,{entryScript:"https://common.cnblogs.com/katex/0.16.8/katex.min.js",document:window.document,engine:o.Katex,isEnabled:!0}),r);function p(t){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},p(t)}function v(){v=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function u(t,e,n,r){var o=e&&e.prototype instanceof f?e:f,i=Object.create(o.prototype),a=new j(r||[]);return i._invoke=function(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var c=_(a,n);if(c){if(c===l)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=s(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(t,n,a),i}function s(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var l={};function f(){}function h(){}function d(){}var m={};c(m,o,(function(){return this}));var y=Object.getPrototypeOf,g=y&&y(y(S([])));g&&g!==e&&n.call(g,o)&&(m=g);var b=d.prototype=f.prototype=Object.create(m);function x(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function r(o,i,a,c){var u=s(t[o],t,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==p(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var o;this._invoke=function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}}function _(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,_(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var r=s(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,l;var o=r.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function M(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function S(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:E}}function E(){return{value:void 0,done:!0}}return h.prototype=d,c(b,"constructor",d),c(d,"constructor",h),h.displayName=c(d,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,a,"GeneratorFunction")),t.prototype=Object.create(b),t},t.awrap=function(t){return{__await:t}},x(w.prototype),c(w.prototype,i,(function(){return this})),t.AsyncIterator=w,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new w(u(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(b),c(b,a,"Generator"),c(b,o,(function(){return this})),c(b,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=S,j.prototype={constructor:j,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(M),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,l):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),M(n),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;M(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:S(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}},t}function m(t,e,n,r,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void n(t)}c.done?e(u):Promise.resolve(u).then(r,o)}function y(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function g(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?y(Object(n),!0).forEach((function(e){_(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function b(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function x(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function w(t,e,n){return e&&x(t.prototype,e),n&&x(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function _(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var k=function(){function t(){b(this,t),_(this,"_defaultConfig",d[o.MathJax2]),_(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}),_(this,"_config",this._defaultConfig)}return w(t,[{key:"_global",get:function(){var t;return null!==(t=this._config.document.defaultView)&&void 0!==t?t:window}},{key:"render",value:function(t,e){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,t]),null!=o&&r.Hub.Queue((function(){return o(r)})),e&&r.Hub.Queue(e)}})).catch(console.warn):Promise.resolve()}},{key:"config",value:function(t){return this._config=Object.assign({},this._defaultConfig,t),this}},{key:"init",value:function(){var t=this;if(this._initTask)return this._initTask;var e=this._config,n=e.entryScript,r=e.tapMathJaxConfig,o=e.document;return this._initTask=f({src:n,id:"mathjax",timeoutSeconds:10,appendTo:o.head}).then((function(){var e,n=t._global.MathJax;if(n)return n.Hub.Config(null!==(e=null==r?void 0:r.call(void 0,Object.assign({},t._defaultMathJaxConfig)))&&void 0!==e?e:g({},t._defaultMathJaxConfig)),n.Hub.Configured(),n})).catch((function(){return t._initTask=void 0}))}}]),t}(),M=function(){function t(){b(this,t),_(this,"_defaultConfig",d[o.MathJax3]),_(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}}),_(this,"_config",this._defaultConfig)}return w(t,[{key:"config",value:function(t){return this._config=Object.assign({},this._defaultConfig,t),this}},{key:"render",value:function(t,e){var n=this;return this._config.isEnabled?this.init().then((function(r){r&&(r.startup.promise=r.startup.promise.then((function(){return r.typesetPromise([t]).then((function(){try{var t;null===(t=n._config.onRendered)||void 0===t||t.call(void 0,r)}catch(t){console.error(t)}try{null==e||e.call(void 0)}catch(t){console.error(t)}}))})))})).catch(console.warn):Promise.resolve()}},{key:"init",value:function(){var t,e=this;return(null!==(t=this._initTask)&&void 0!==t?t:this._initTask=new Promise((function(t,n){var r,o,i=e._config,a=i.entryScript,c=i.tapMathJaxConfig,u=null!==(r=i.document.defaultView)&&void 0!==r?r:window;u.MathJax=null!==(o=null==c?void 0:c.call(void 0,g({},e._defaultMathJaxConfig)))&&void 0!==o?o:g({},e._defaultMathJaxConfig),u.MathJax.startup||(u.MathJax.startup={}),u.MathJax.startup.ready=function(){var e,n;null===(e=u.MathJax)||void 0===e||null===(n=e.startup)||void 0===n||n.defaultReady(),t(u.MathJax)},f({src:a,id:"mathjax",executionStrategy:"defer",appendTo:u.document.head}).catch(n)}))).catch((function(){return e._initTask=void 0}))}}]),t}(),j=function(){function t(){b(this,t),_(this,"_defaultConfig",d[o.Katex]),_(this,"_config",this._defaultConfig)}var e,n;return w(t,[{key:"config",value:function(t){return this._config=Object.assign({},this._defaultConfig,t),this}},{key:"render",value:(e=v().mark((function t(e,n){var r;return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._config.isEnabled){t.next=2;break}return t.abrupt("return",Promise.resolve());case 2:return t.next=4,this.init();case 4:(null!==(r=this._config.document.defaultView)&&void 0!==r?r:window).renderMathInElement(e),n&&n();case 7:case"end":return t.stop()}}),t,this)})),n=function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(t){m(i,r,o,a,c,"next",t)}function c(t){m(i,r,o,a,c,"throw",t)}a(void 0)}))},function(t,e){return n.apply(this,arguments)})},{key:"init",value:function(){var t,e=this;return(null!==(t=this._initTask)&&void 0!==t?t:this._initTask=new Promise((function(t,n){var r,o,i,a,c,s,h,d=e._config,p=d.entryScript,v=null!==(r=d.document.defaultView)&&void 0!==r?r:window;Promise.all([(o={href:"https://common.cnblogs.com/katex/0.16.8/katex.min.css",id:"katex-style",appendTo:v.document.head},a=o.href,c=o.timeoutSeconds,s=o.id,h=o.appendTo,u({url:a,hostElementTagName:"link",timeoutSeconds:null!==(i=null!=c?c:l().timeoutSeconds)&&void 0!==i?i:5,id:s,appendTo:null!=h?h:l().appendTo})),f({src:p,id:"katex",appendTo:v.document.head})]).then((function(){return f({src:"https://common.cnblogs.com/katex/0.16.8/contrib/auto-render.min.js",id:"katex-auto-render",appendTo:v.document.head}).then((function(){return t()}))})).catch(n)}))).catch((function(){return e._initTask=void 0}))}}]),t}(),S=function(t){switch(t.engine){case o.MathJax2:return(new k).config(t);case o.MathJax3:return(new M).config(t);case o.Katex:return(new j).config(t);default:throw Error("Renderer unavailable")}};return e}()}));
2
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.mathRenderer=e():t.mathRenderer=e()}(self,(function(){return function(){"use strict";var t={d:function(e,n){for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r:function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{IMathRenderer:function(){return n.IMathRenderer},MathEngine:function(){return o},MathJax2RendererConfig:function(){return n.MathJax2RendererConfig},MathJax3RendererConfig:function(){return n.MathJax3RendererConfig},RendererConfig:function(){return n.RendererConfig},createMathRenderer:function(){return O}});var n={};t.r(n),t.d(n,{M:function(){return o},u:function(){return d}});var r,o,i=[],a=function(t){t&&clearTimeout(t)},c=function(t,e){var n=i.findIndex((function(n){return t&&n[0]===t||n[0]===e}));n>=0&&i.splice(n,1)},u=function(t){var e,n,r=t.url,o=t.id,u=t.timeoutSeconds,s=t.appendTo,l=t.hostElementTagName,f=t.beforeElementCreateCallback,h=s?s.ownerDocument:document,d=null!==(n=null!==(e=h.defaultView)&&void 0!==e?e:h.parentWindow)&&void 0!==n?n:window,p=function(t,e){var n=i.find((function(n){return t&&n[0]===t||n[0]===e}));return(null!=n?n:[])[1]}(h!==document?"load-resource-to-another-window-context-"+d.name+"-"+o:o,r);if(p)return p;var v=h.querySelector("".concat(l,"#").concat(o));return(v=(v=v||"script"===l&&h.querySelector('script[src="'.concat(r,'"]')))||"link"===l&&h.querySelector('link[href="'.concat(r,'"]')))?Promise.resolve(v):(p=new Promise((function(t,e){var n,i;n=l,i=function(n){var i;n.id=null!=o?o:"",null!=s||(s=h.head),u=u<=0?5:u,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(){a(i),c(o,r),t(n)},n.onerror=function(t){a(i),n.remove(),c(o,r),e(t)},null==f||f.call(void 0,n),s.append(n),i=setTimeout((function(){a(i),n.remove(),c(o,r),e("timeout after ".concat(u," seconds"))}),1e3*u)},i(document.createElement(n))})),i.push([o||r,p]),p)},s={},l=function(){return s},f=function(t){var e,n=t.src,r=t.id,o=t.timeoutSeconds,i=t.appendTo,a=t.executionStrategy;return u({url:n,hostElementTagName:"script",timeoutSeconds:null!==(e=null!=o?o:l().timeoutSeconds)&&void 0!==e?e:5,id:r,appendTo:null!=i?i:l().appendTo,beforeElementCreateCallback:function(t){t instanceof HTMLScriptElement&&("async"===(null!=a?a:l().executionStrategy)?(t.async=!0,t.defer=!1):(t.defer=!0,t.async=!1))}})};function h(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}!function(t){t[t.MathJax2=0]="MathJax2",t[t.MathJax3=1]="MathJax3",t[t.Katex=2]="Katex"}(o||(o={}));var d=(h(r={},o.MathJax2,{entryScript:"https://mathjax.cnblogs.com/2_7_5/MathJax.js?config=TeX-AMS_CHTML&delayStartupUntil=configured&v=20200504",document:window.document,engine:o.MathJax2,isEnabled:!0}),h(r,o.MathJax3,{entryScript:"https://mathjax.cnblogs.com/3_2_1/es5/tex-mml-chtml.js",document:window.document,engine:o.MathJax3,isEnabled:!0}),h(r,o.Katex,{entryScript:"https://common.cnblogs.com/katex/0.16.8/katex.min.js",document:window.document,engine:o.Katex,isEnabled:!0}),r);function p(t){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},p(t)}function v(){v=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function u(t,e,n,r){var o=e&&e.prototype instanceof f?e:f,i=Object.create(o.prototype),a=new j(r||[]);return i._invoke=function(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var c=_(a,n);if(c){if(c===l)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=s(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(t,n,a),i}function s(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var l={};function f(){}function h(){}function d(){}var y={};c(y,o,(function(){return this}));var m=Object.getPrototypeOf,g=m&&m(m(O([])));g&&g!==e&&n.call(g,o)&&(y=g);var b=d.prototype=f.prototype=Object.create(y);function x(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function r(o,i,a,c){var u=s(t[o],t,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==p(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var o;this._invoke=function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}}function _(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,_(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var r=s(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,l;var o=r.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function M(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function O(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:S}}function S(){return{value:void 0,done:!0}}return h.prototype=d,c(b,"constructor",d),c(d,"constructor",h),h.displayName=c(d,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,a,"GeneratorFunction")),t.prototype=Object.create(b),t},t.awrap=function(t){return{__await:t}},x(w.prototype),c(w.prototype,i,(function(){return this})),t.AsyncIterator=w,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new w(u(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(b),c(b,a,"Generator"),c(b,o,(function(){return this})),c(b,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=O,j.prototype={constructor:j,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(M),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,l):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),M(n),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;M(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:O(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}},t}function y(t,e,n,r,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void n(t)}c.done?e(u):Promise.resolve(u).then(r,o)}function m(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function g(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?m(Object(n),!0).forEach((function(e){_(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function b(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function x(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function w(t,e,n){return e&&x(t.prototype,e),n&&x(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function _(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var k=function(){function t(){b(this,t),_(this,"_defaultConfig",d[o.MathJax2]),_(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}),_(this,"_config",this._defaultConfig)}return w(t,[{key:"_global",get:function(){var t;return null!==(t=this._config.document.defaultView)&&void 0!==t?t:window}},{key:"render",value:function(t,e){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,t]),null!=o&&r.Hub.Queue((function(){return o(r)})),e&&r.Hub.Queue(e)}})).catch(console.warn):Promise.resolve()}},{key:"config",value:function(t){return this._config=Object.assign({},this._defaultConfig,t),this}},{key:"init",value:function(){var t=this;if(this._initTask)return this._initTask;var e=this._config,n=e.entryScript,r=e.tapMathJaxConfig,o=e.document;return this._initTask=f({src:n,id:"mathjax",timeoutSeconds:10,appendTo:o.head}).then((function(){var e,n=t._global.MathJax;if(n)return n.Hub.Config(null!==(e=null==r?void 0:r.call(void 0,Object.assign({},t._defaultMathJaxConfig)))&&void 0!==e?e:g({},t._defaultMathJaxConfig)),n.Hub.Configured(),n})).catch((function(){return t._initTask=void 0}))}}]),t}(),M=function(){function t(){b(this,t),_(this,"_defaultConfig",d[o.MathJax3]),_(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}}),_(this,"_config",this._defaultConfig)}return w(t,[{key:"config",value:function(t){return this._config=Object.assign({},this._defaultConfig,t),this}},{key:"render",value:function(t,e){var n=this;return this._config.isEnabled?this.init().then((function(r){r&&(r.startup.promise=r.startup.promise.then((function(){return r.typesetPromise([t]).then((function(){try{var t;null===(t=n._config.onRendered)||void 0===t||t.call(void 0,r)}catch(t){console.error(t)}try{null==e||e.call(void 0)}catch(t){console.error(t)}}))})))})).catch(console.warn):Promise.resolve()}},{key:"init",value:function(){var t,e=this;return(null!==(t=this._initTask)&&void 0!==t?t:this._initTask=new Promise((function(t,n){var r,o,i=e._config,a=i.entryScript,c=i.tapMathJaxConfig,u=null!==(r=i.document.defaultView)&&void 0!==r?r:window;u.MathJax=null!==(o=null==c?void 0:c.call(void 0,g({},e._defaultMathJaxConfig)))&&void 0!==o?o:g({},e._defaultMathJaxConfig),u.MathJax.startup||(u.MathJax.startup={}),u.MathJax.startup.ready=function(){var e,n;null===(e=u.MathJax)||void 0===e||null===(n=e.startup)||void 0===n||n.defaultReady(),t(u.MathJax)},f({src:a,id:"mathjax",executionStrategy:"defer",appendTo:u.document.head}).catch(n)}))).catch((function(){return e._initTask=void 0}))}}]),t}(),j=function(){function t(){b(this,t),_(this,"_defaultConfig",d[o.Katex]),_(this,"_defaultKatexOptions",{delimiters:[{left:"$$",right:"$$",display:!0},{left:"$",right:"$",display:!1},{left:"\\(",right:"\\)",display:!1},{left:"\\[",right:"\\]",display:!0}]}),_(this,"_config",this._defaultConfig),_(this,"_katexOption",Object.assign({},this._defaultKatexOptions))}var e,n;return w(t,[{key:"_global",get:function(){var t;return null!==(t=this._config.document.defaultView)&&void 0!==t?t:window}},{key:"config",value:function(t){return this._config=Object.assign({},this._defaultConfig,t),this}},{key:"render",value:(e=v().mark((function t(e,n){return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._config.isEnabled){t.next=2;break}return t.abrupt("return",Promise.resolve());case 2:return t.next=4,this.init();case 4:this._global.renderMathInElement(e,this._katexOption),n&&n();case 7:case"end":return t.stop()}}),t,this)})),n=function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(t){y(i,r,o,a,c,"next",t)}function c(t){y(i,r,o,a,c,"throw",t)}a(void 0)}))},function(t,e){return n.apply(this,arguments)})},{key:"init",value:function(){var t,e=this;return(null!==(t=this._initTask)&&void 0!==t?t:this._initTask=new Promise((function(t,n){var r,o,i,a,c,s,h=e._config,d=h.entryScript,p=h.document;Promise.all([(r={href:"https://common.cnblogs.com/katex/0.16.8/katex.min.css",id:"katex-style",appendTo:p.head},i=r.href,a=r.timeoutSeconds,c=r.id,s=r.appendTo,u({url:i,hostElementTagName:"link",timeoutSeconds:null!==(o=null!=a?a:l().timeoutSeconds)&&void 0!==o?o:5,id:c,appendTo:null!=s?s:l().appendTo})),f({src:d,id:"katex",appendTo:p.head})]).then((function(){return f({src:"https://common.cnblogs.com/katex/0.16.8/contrib/auto-render.min.js",id:"katex-auto-render",appendTo:p.head}).then((function(){var n,r;e._katexOption=null!==(n=null===(r=e._config.tapMathJaxConfig)||void 0===r?void 0:r.call(void 0,e._katexOption))&&void 0!==n?n:g({},e._defaultKatexOptions),t()}))})).catch(n)}))).catch((function(){return e._initTask=void 0}))}}]),t}(),O=function(t){switch(t.engine){case o.MathJax2:return(new k).config(t);case o.MathJax3:return(new M).config(t);case o.Katex:return(new j).config(t);default:throw Error("Renderer unavailable")}};return e}()}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cnblogs/markdown-it-presets",
3
- "version": "1.10.4",
3
+ "version": "1.10.6",
4
4
  "description": "Markdown-it configuration for cnblogs.com",
5
5
  "repository": "git@github.com:cnblogs/packages.git",
6
6
  "main": "index.js",