1 line
2.3 KiB
JavaScript
1 line
2.3 KiB
JavaScript
(()=>{"use strict";var t={d:(e,a)=>{for(var n in a)t.o(a,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:a[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r: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,{HtmlNodeMethods:()=>c,TexHtmlConfiguration:()=>p});const a=("undefined"!=typeof window?window:global).MathJax._.components.global,n=(a.GLOBAL,a.isObject,a.combineConfig,a.combineDefaults,a.combineWithMathJax),o=(a.MathJax,MathJax._.input.tex.HandlerTypes),r=o.ConfigurationType,i=o.HandlerType,l=MathJax._.input.tex.Configuration,s=l.Configuration,d=(l.ConfigurationHandler,l.ParserConfiguration,MathJax._.input.tex.TokenMap),x=(d.parseResult,d.AbstractTokenMap,d.RegExpMap,d.AbstractParseMap,d.CharacterMap,d.DelimiterMap,d.MacroMap),h=(d.CommandMap,d.EnvironmentMap,MathJax._.input.tex.TexError.default),m=MathJax._.handlers.html.HTMLDomStrings.HTMLDomStrings,c={TexHTML(t,e){if(!t.options.allowTexHTML)return!1;const a=t.string.slice(t.i).match(/^tex-html(?: n="(\d+)")?>/);if(!a)return!1;t.i+=a[0].length;const n=(a[1]?`<!${a[1]}>`:"")+"</tex-html>",o=t.string.slice(t.i).indexOf(n);if(o<0)throw new h("TokenNotFoundForCommand","Could not find %1 for %2",n,"<"+a[0]);const r=t.string.substring(t.i,t.i+o).trim();t.i+=o+11+(a[1]?3+a[1].length:0);const i=t.configuration.packageData.get("texhtml").adaptor,l=i.childNodes(i.body(i.parse(r)));if(0===l.length)return!0;const s=1===l.length?l[0]:i.node("div",{},l),d=t.create("node","html").setHTML(s,i);return t.Push(t.create("node","mtext",[d])),!0}};new x("tex-html",{"<":c.TexHTML});const p=s.create("texhtml",{[r.HANDLER]:{[i.CHARACTER]:["tex-html"]},[r.OPTIONS]:{allowTexHTML:!1},[r.CONFIG]:()=>{if(m){const t=m.OPTIONS.includeHtmlTags;t["tex-html"]||(t["tex-html"]=(t,e)=>{const a=e.innerHTML(t),n=a.split(/<\/tex-html>/).length;return`<tex-html${n>1?` n="${n}"`:""}>`+a+(n>1?`<!${n}>`:"")+"</tex-html>"})}},[r.PREPROCESSORS]:[t=>{t.data.packageData.set("texhtml",{adaptor:t.document.adaptor})}],[r.POSTPROCESSORS]:[t=>{t.data.packageData.set("texhtml",{adaptor:null})}]});MathJax.loader&&MathJax.loader.checkVersion("[tex]/texhtml","4.0.0","tex-extension"),n({_:{input:{tex:{texhtml:{TexHtmlConfiguration:e}}}}})})(); |