notes/_plug/katex.plug.json
2023-04-19 12:51:03 +02:00

1 line
1.2 KiB
JSON

{"name":"katex","imports":["https://get.silverbullet.md/global.plug.json"],"functions":{"katexWidget":{"codeWidget":"latex","code":"(() => { var mod=(()=>{var d=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var o=(t,e)=>{for(var i in e)d(t,i,{get:e[i],enumerable:!0})},p=(t,e,i,r)=>{if(e&&typeof e==\"object\"||typeof e==\"function\")for(let n of a(e))!m.call(t,n)&&n!==i&&d(t,n,{get:()=>e[n],enumerable:!(r=l(e,n))||r.enumerable});return t};var c=t=>p(d({},\"__esModule\",{value:!0}),t);var x={};o(x,{default:()=>u});function s(t){return{html:`\n <link rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/npm/katex@0.16.4/dist/katex.min.css\" crossorigin=\"anonymous\">\n <div id=\"katex\"></div>\n <div id=\"formula\" style=\"display: none;\">${t.replaceAll(\"<\",\"&lt;\")}</div>`,script:`\n loadJsByUrl(\"https://cdn.jsdelivr.net/npm/katex@0.16.4/dist/katex.min.js\").then(() => {\n katex.render(document.getElementById(\"formula\").innerText, document.getElementById(\"katex\"));\n updateHeight();\n });\n document.addEventListener(\"click\", () => {\n api({type: \"blur\"});\n });\n `}}var u=s;return c(x);})();\n return mod;})()"}},"assets":{}}