diff --git a/docs/index.html b/docs/index.html index 3dbaae8b..50c62e51 100644 --- a/docs/index.html +++ b/docs/index.html @@ -5,7 +5,7 @@ 0 \} ``` -You can even include custom React components if you declare them in the "overrides" option. +You can even include custom React components if you declare them in the [`overrides` option](https://github.com/quantizor/markdown-to-jsx/blob/main/README.md#optionsoverrides---rendering-arbitrary-react-components). Isn't that cool? diff --git a/docs/markdown-to-jsx.js b/docs/markdown-to-jsx.js index ab166f24..4f97cb18 100644 --- a/docs/markdown-to-jsx.js +++ b/docs/markdown-to-jsx.js @@ -1,2 +1,2 @@ -!function(n,e,t,r){function a(n){return n&&"object"==typeof n&&"default"in n?n:{default:n}}function o(n){if(n&&n.__esModule)return n;var e=Object.create(null);return n&&Object.keys(n).forEach(function(t){if("default"!==t){var r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:function(){return n[t]}})}}),e.default=n,e}var i=/*#__PURE__*/a(n),l=/*#__PURE__*/o(n),c=/*#__PURE__*/o(e),u=/*#__PURE__*/a(t),s=/*#__PURE__*/a(r);function f(){return f=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0||(a[t]=n[t]);return a}(e,["children","math","block","errorColor","renderError","settings","as"]),d=u||(a?"div":"span"),m=null!=t?t:r,g=n.useState({innerHtml:""}),h=g[0],y=g[1];return n.useEffect(function(){try{var n=s.default.renderToString(m,p({displayMode:!!a,errorColor:o,throwOnError:!!l},c));y({innerHtml:n})}catch(n){if(!(n instanceof s.default.ParseError||n instanceof TypeError))throw n;y(l?{errorElement:l(n)}:{innerHtml:n.message})}},[a,m,o,l,c]),"errorElement"in h?h.errorElement:i.default.createElement(d,Object.assign({},f,{dangerouslySetInnerHTML:{__html:h.innerHtml}}))});function g(){return g=Object.assign?Object.assign.bind():function(n){for(var e=1;e",lt:"<",nbsp:" ",quot:"“"},k=["style","script"],x=/([-A-Z0-9_:]+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|(?:\{((?:\\.|{[^}]*?}|[^}])*)\})))?/gi,b=/mailto:/i,E=/\n{2,}$/,w=/^( *>[^\n]+(\n[^\n]+)*\n*)+\n{2,}/,H=/^ *> ?/gm,O=/^ {2,}\n/,M=/^(?:( *[-*_])){3,} *(?:\n *)+\n/,I=/^\s*(`{3,}|~{3,}) *(\S+)?([^\n]*?)?\n([\s\S]+?)\s*\1 *(?:\n *)*\n?/,A=/^(?: {4}[^\n]+\n*)+(?:\n *)+\n?/,j=/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,C=/^(?:\n *)*\n/,S=/\r\n?/g,z=/^\[\^([^\]]+)](:.*)\n/,G=/^\[\^([^\]]+)]/,L=/\f/g,T=/^\s*?\[(x|\s)\]/,$=/^ *(#{1,6}) *([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,_=/^ *(#{1,6}) +([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,R=/^([^\n]+)\n *(=|-){3,} *(?:\n *)+\n/,X=/^ *(?!<[a-z][^ >/]* ?\/>)<([a-z][^ >/]*) ?([^>]*)\/{0}>\n?(\s*(?:<\1[^>]*?>[\s\S]*?<\/\1>|(?!<\1)[\s\S])*?)<\/\1>\n*/i,P=/&([a-z0-9]+|#[0-9]{1,6}|#x[0-9a-fA-F]{1,6});/gi,W=/^)/,N=/^(data|aria|x)-[a-z_][a-z\d_.-]*$/,D=/^ *<([a-z][a-z0-9:]*)(?:\s+((?:<.*?>|[^>])*))?\/?>(?!<\/\1>)(\s*\n)?/i,U=/^\{.*\}$/,B=/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,F=/^<([^ >]+@[^ >]+)>/,Z=/^<([^ >]+:\/[^ >]+)>/,q=/-([a-z])?/gi,V=/^(.*\|?.*)\n *(\|? *[-:]+ *\|[-| :]*)\n((?:.*\|.*\n)*)\n?/,J=/^\[([^\]]*)\]:\s+]+)>?\s*("([^"]*)")?/,K=/^!\[([^\]]*)\] ?\[([^\]]*)\]/,Q=/^\[([^\]]*)\] ?\[([^\]]*)\]/,Y=/(\[|\])/g,nn=/(\n|^[-*]\s|^#|^ {2,}|^-{2,}|^>\s)/,en=/\t/g,tn=/^ *\| */,rn=/(^ *\||\| *$)/g,an=/ *$/,on=/^ *:-+: *$/,ln=/^ *:-+ *$/,cn=/^ *-+: *$/,un=/^([*_])\1((?:\[.*?\][([].*?[)\]]|<.*?>(?:.*?<.*?>)?|`.*?`|~+.*?~+|.)*?)\1\1(?!\1)/,sn=/^([*_])((?:\[.*?\][([].*?[)\]]|<.*?>(?:.*?<.*?>)?|`.*?`|~+.*?~+|.)*?)\1(?!\1|\w)/,fn=/^==((?:\[.*?\]|<.*?>(?:.*?<.*?>)?|`.*?`|.)*?)==/,dn=/^~~((?:\[.*?\]|<.*?>(?:.*?<.*?>)?|`.*?`|.)*?)~~/,pn=/^\\([^0-9A-Za-z\s])/,mn=/^[\s\S]+?(?=[^0-9A-Z\s\u00c0-\uffff&#;.()'"]|\d+\.|\n\n| {2,}\n|\w+:\S|$)/i,gn=/^\n+/,hn=/^([ \t]*)/,yn=/\\([^\\])/g,vn=/ *\n+$/,kn=/(?:^|\n)( *)$/,xn="(?:\\d+\\.)",bn="(?:[*+-])";function En(n){return"( *)("+(1===n?xn:bn)+") +"}var wn=En(1),Hn=En(2);function On(n){return new RegExp("^"+(1===n?wn:Hn))}var Mn=On(1),In=On(2);function An(n){return new RegExp("^"+(1===n?wn:Hn)+"[^\\n]*(?:\\n(?!\\1"+(1===n?xn:bn)+" )[^\\n]*)*(\\n|$)","gm")}var jn=An(1),Cn=An(2);function Sn(n){var e=1===n?xn:bn;return new RegExp("^( *)("+e+") [\\s\\S]+?(?:\\n{2,}(?! )(?!\\1"+e+" (?!"+e+" ))\\n*|\\s*\\n*$)")}var zn=Sn(1),Gn=Sn(2);function Ln(n,e){var t=1===e,r=t?zn:Gn,a=t?jn:Cn,o=t?Mn:In;return{match:function(n,e,t){var a=kn.exec(t);return a&&(e.list||!e.inline&&!e.simple)?r.exec(n=a[1]+n):null},order:ne.HIGH,parse:function(n,e,r){var i=t?+n[2]:void 0,l=n[0].replace(E,"\n").match(a),c=!1;return{items:l.map(function(n,t){var a=o.exec(n)[0].length,i=new RegExp("^ {1,"+a+"}","gm"),u=n.replace(i,"").replace(o,""),s=t===l.length-1,f=-1!==u.indexOf("\n\n")||s&&c;c=f;var d,p=r.inline,m=r.list;r.list=!0,f?(r.inline=!1,d=u.replace(vn,"\n\n")):(r.inline=!0,d=u.replace(vn,""));var g=e(d,r);return r.inline=p,r.list=m,g}),ordered:t,start:i}},render:function(e,t,r){return n(e.ordered?"ol":"ul",{key:r.key,start:e.start},e.items.map(function(e,a){return n("li",{key:a},t(e,r))}))}}}var Tn=/^\[([^\]]*)]\( *((?:\([^)]*\)|[^() ])*) *"?([^)"]*)?"?\)/,$n=/^!\[([^\]]*)]\( *((?:\([^)]*\)|[^() ])*) *"?([^)"]*)?"?\)/,_n=[w,I,A,$,R,_,W,V,jn,zn,Cn,Gn],Rn=[].concat(_n,[/^[^\n]+(?: \n|\n{2,})/,X,D]);function Xn(n){return n.replace(/[ÀÁÂÃÄÅàáâãäåæÆ]/g,"a").replace(/[çÇ]/g,"c").replace(/[ðÐ]/g,"d").replace(/[ÈÉÊËéèêë]/g,"e").replace(/[ÏïÎîÍíÌì]/g,"i").replace(/[Ññ]/g,"n").replace(/[øØœŒÕõÔôÓóÒò]/g,"o").replace(/[ÜüÛûÚúÙù]/g,"u").replace(/[ŸÿÝý]/g,"y").replace(/[^a-z0-9- ]/gi,"").replace(/ /gi,"-").toLowerCase()}function Pn(n){return cn.test(n)?"right":on.test(n)?"center":ln.test(n)?"left":null}function Wn(n,e,t){var r=t.inTable;t.inTable=!0;var a=e(n.trim(),t);t.inTable=r;var o=[[]];return a.forEach(function(n,e){26===n.type?0!==e&&e!==a.length-1&&o.push([]):(27!==n.type||null!=a[e+1]&&26!==a[e+1].type||(n.text=n.text.replace(an,"")),o[o.length-1].push(n))}),o}function Nn(n,e,t){t.inline=!0;var r=Wn(n[1],e,t),a=n[2].replace(rn,"").split("|").map(Pn),o=function(n,e,t){return n.trim().split("\n").map(function(n){return Wn(n,e,t)})}(n[3],e,t);return t.inline=!1,{align:a,cells:o,header:r,type:25}}function Dn(n,e){return null==n.align[e]?{}:{textAlign:n.align[e]}}function Un(n){return function(e,t){return t.inline?n.exec(e):null}}function Bn(n){return function(e,t){return t.inline||t.simple?n.exec(e):null}}function Fn(n){return function(e,t){return t.inline||t.simple?null:n.exec(e)}}function Zn(n){return function(e){return n.exec(e)}}function qn(n,e,t){if(e.inline||e.simple)return null;if(t&&!t.endsWith("\n"))return null;var r="";n.split("\n").every(function(n){return!_n.some(function(e){return e.test(n)})&&(r+=n+"\n",n.trim())});var a=r.trimEnd();return""==a?null:[r,a]}function Vn(n){try{if(decodeURIComponent(n).replace(/[^A-Za-z0-9/:]/g,"").match(/^\s*(javascript|vbscript|data(?!:image)):/i))return}catch(n){return null}return n}function Jn(n){return n.replace(yn,"$1")}function Kn(n,e,t){var r=t.inline||!1,a=t.simple||!1;t.inline=!0,t.simple=!0;var o=n(e,t);return t.inline=r,t.simple=a,o}function Qn(n,e,t){var r=t.inline||!1,a=t.simple||!1;t.inline=!1,t.simple=!0;var o=n(e,t);return t.inline=r,t.simple=a,o}function Yn(n,e,t){return t.inline=!1,n(e,t)}var ne,ee,te,re,ae,oe,ie,le,ce,ue,se,fe,de=function(n,e,t){return{content:Kn(e,n[1],t)}};function pe(){return{}}function me(){return null}function ge(){return[].slice.call(arguments).filter(Boolean).join(" ")}function he(n,e,t){for(var r=n,a=e.split(".");a.length&&void 0!==(r=r[a[0]]);)a.shift();return r||t}function ye(n,e){var t=he(e,n);return t?"function"==typeof t||"object"==typeof t&&"render"in t?t:he(e,n+".component",n):n}function ve(n,e){var t;void 0===e&&(e={}),e.overrides=e.overrides||{},e.slugify=e.slugify||Xn,e.namedCodesToUnicode=e.namedCodesToUnicode?g({},v,e.namedCodesToUnicode):v;var r=e.createElement||l.createElement;function a(n,t){var a=he(e.overrides,n+".props",{});return r.apply(void 0,[ye(n,e.overrides),g({},t,a,{className:ge(null==t?void 0:t.className,a.className)||void 0})].concat([].slice.call(arguments,2)))}function o(n){var t=!1;e.forceInline?t=!0:e.forceBlock||(t=!1===nn.test(n));for(var r=p(d(t?n:n.trimEnd().replace(gn,"")+"\n\n",{inline:t}));"string"==typeof r[r.length-1]&&!r[r.length-1].trim();)r.pop();if(null===e.wrapper)return r;var o,i=e.wrapper||(t?"span":"div");if(r.length>1||e.forceWrapper)o=r;else{if(1===r.length)return"string"==typeof(o=r[0])?a("span",{key:"outer"},o):o;o=null}return l.createElement(i,{key:"outer"},o)}function i(n){var e=n.match(x);return e?e.reduce(function(n,e,t){var r,a=e.indexOf("=");if(-1!==a){var i=(r=e.slice(0,a),-1!==r.indexOf("-")&&null===r.match(N)&&(r=r.replace(q,function(n,e){return e.toUpperCase()})),r).trim(),c=function(n){var e=n[0];return('"'===e||"'"===e)&&n.length>=2&&n[n.length-1]===e?n.slice(1,-1):n}(e.slice(a+1).trim()),u=y[i]||i,s=n[u]=function(n,e){return"style"===n?e.split(/;\s?/).reduce(function(n,e){var t=e.slice(0,e.indexOf(":"));return n[t.replace(/(-[a-z])/g,function(n){return n[1].toUpperCase()})]=e.slice(t.length+1).trim(),n},{}):"href"===n?Vn(e):(e.match(U)&&(e=e.slice(1,e.length-1)),"true"===e||"false"!==e&&e)}(i,c);"string"==typeof s&&(X.test(s)||D.test(s))&&(n[u]=l.cloneElement(o(s.trim()),{key:t}))}else"style"!==e&&(n[y[e]||e]=!0);return n},{}):null}var c=[],u={},s=((t={})[0]={match:Fn(w),order:ne.HIGH,parse:function(n,e,t){return{content:e(n[0].replace(H,""),t)}},render:function(n,e,t){return a("blockquote",{key:t.key},e(n.content,t))}},t[1]={match:Zn(O),order:ne.HIGH,parse:pe,render:function(n,e,t){return a("br",{key:t.key})}},t[2]={match:Fn(M),order:ne.HIGH,parse:pe,render:function(n,e,t){return a("hr",{key:t.key})}},t[3]={match:Fn(A),order:ne.MAX,parse:function(n){return{lang:void 0,text:n[0].replace(/^ {4}/gm,"").replace(/\n+$/,"")}},render:function(n,e,t){return a("pre",{key:t.key},a("code",g({},n.attrs,{className:n.lang?"lang-"+n.lang:""}),n.text))}},t[4]={match:Fn(I),order:ne.MAX,parse:function(n){return{attrs:i(n[3]||""),lang:n[2]||void 0,text:n[4],type:3}}},t[5]={match:Bn(j),order:ne.LOW,parse:function(n){return{text:n[2]}},render:function(n,e,t){return a("code",{key:t.key},n.text)}},t[6]={match:Fn(z),order:ne.MAX,parse:function(n){return c.push({footnote:n[2],identifier:n[1]}),{}},render:me},t[7]={match:Un(G),order:ne.HIGH,parse:function(n){return{target:"#"+e.slugify(n[1]),text:n[1]}},render:function(n,e,t){return a("a",{key:t.key,href:Vn(n.target)},a("sup",{key:t.key},n.text))}},t[8]={match:Un(T),order:ne.HIGH,parse:function(n){return{_completed:"x"===n[1].toLowerCase()}},render:function(n,e,t){return a("input",{checked:n._completed,key:t.key,readOnly:!0,type:"checkbox"})}},t[9]={match:Fn(e.enforceAtxHeadings?_:$),order:ne.HIGH,parse:function(n,t,r){return{content:Kn(t,n[2],r),_id:e.slugify(n[2]),level:n[1].length}},render:function(n,e,t){return a("h"+n.level,{id:n._id,key:t.key},e(n.content,t))}},t[10]={match:Fn(R),order:ne.MAX,parse:function(n,e,t){return{content:Kn(e,n[1],t),level:"="===n[2]?1:2,type:9}}},t[12]={match:Zn(W),order:ne.HIGH,parse:function(){return{}},render:me},t[14]={match:Bn($n),order:ne.HIGH,parse:function(n){return{alt:n[1],target:Jn(n[2]),title:n[3]}},render:function(n,e,t){return a("img",{key:t.key,alt:n.alt||void 0,title:n.title||void 0,src:Vn(n.target)})}},t[15]={match:Un(Tn),order:ne.LOW,parse:function(n,e,t){return{content:Qn(e,n[1],t),target:Jn(n[2]),title:n[3]}},render:function(n,e,t){return a("a",{key:t.key,href:Vn(n.target),title:n.title},e(n.content,t))}},t[16]={match:Un(Z),order:ne.MAX,parse:function(n){return{content:[{text:n[1],type:27}],target:n[1],type:15}}},t[17]={match:function(n,e){return e.inAnchor?null:Un(B)(n,e)},order:ne.MAX,parse:function(n){return{content:[{text:n[1],type:27}],target:n[1],title:void 0,type:15}}},t[18]={match:Un(F),order:ne.MAX,parse:function(n){var e=n[1],t=n[1];return b.test(t)||(t="mailto:"+t),{content:[{text:e.replace("mailto:",""),type:27}],target:t,type:15}}},t[20]=Ln(a,1),t[33]=Ln(a,2),t[19]={match:Fn(C),order:ne.LOW,parse:pe,render:function(){return"\n"}},t[21]={match:qn,order:ne.LOW,parse:de,render:function(n,e,t){return a("p",{key:t.key},e(n.content,t))}},t[22]={match:Un(J),order:ne.MAX,parse:function(n){return u[n[1]]={target:n[2],title:n[4]},{}},render:me},t[23]={match:Bn(K),order:ne.MAX,parse:function(n){return{alt:n[1]||void 0,ref:n[2]}},render:function(n,e,t){return a("img",{key:t.key,alt:n.alt,src:Vn(u[n.ref].target),title:u[n.ref].title})}},t[24]={match:Un(Q),order:ne.MAX,parse:function(n,e,t){return{content:e(n[1],t),fallbackContent:e(n[0].replace(Y,"\\$1"),t),ref:n[2]}},render:function(n,e,t){return u[n.ref]?a("a",{key:t.key,href:Vn(u[n.ref].target),title:u[n.ref].title},e(n.content,t)):a("span",{key:t.key},e(n.fallbackContent,t))}},t[25]={match:Fn(V),order:ne.HIGH,parse:Nn,render:function(n,e,t){return a("table",{key:t.key},a("thead",null,a("tr",null,n.header.map(function(r,o){return a("th",{key:o,style:Dn(n,o)},e(r,t))}))),a("tbody",null,n.cells.map(function(r,o){return a("tr",{key:o},r.map(function(r,o){return a("td",{key:o,style:Dn(n,o)},e(r,t))}))})))}},t[26]={match:function(n,e){return e.inTable?(e.inline=!0,tn.exec(n)):null},order:ne.HIGH,parse:function(){return{type:26}},render:function(){return" | "}},t[27]={match:Zn(mn),order:ne.MIN,parse:function(n){return{text:n[0].replace(P,function(n,t){return e.namedCodesToUnicode[t]?e.namedCodesToUnicode[t]:n})}},render:function(n){return n.text}},t[28]={match:Bn(un),order:ne.MED,parse:function(n,e,t){return{content:e(n[2],t)}},render:function(n,e,t){return a("strong",{key:t.key},e(n.content,t))}},t[29]={match:Bn(sn),order:ne.LOW,parse:function(n,e,t){return{content:e(n[2],t)}},render:function(n,e,t){return a("em",{key:t.key},e(n.content,t))}},t[30]={match:Bn(pn),order:ne.HIGH,parse:function(n){return{text:n[1],type:27}}},t[31]={match:Bn(fn),order:ne.LOW,parse:de,render:function(n,e,t){return a("mark",{key:t.key},e(n.content,t))}},t[32]={match:Bn(dn),order:ne.LOW,parse:de,render:function(n,e,t){return a("del",{key:t.key},e(n.content,t))}},t);!0!==e.disableParsingRawHTML&&(s[11]={match:Zn(X),order:ne.HIGH,parse:function(n,e,t){var r,a=n[3].match(hn),o=new RegExp("^"+a[1],"gm"),l=n[3].replace(o,""),c=(r=l,Rn.some(function(n){return n.test(r)})?Yn:Kn),u=n[1].toLowerCase(),s=-1!==k.indexOf(u),f={attrs:i(n[2]),noInnerParse:s,tag:s?u:n[1]};return t.inAnchor=t.inAnchor||"a"===u,s?f.text=n[3]:f.content=c(e,l,t),t.inAnchor=!1,f},render:function(n,e,t){return a(n.tag,g({key:t.key},n.attrs),n.text||e(n.content,t))}},s[13]={match:Zn(D),order:ne.HIGH,parse:function(n){return{attrs:i(n[2]||""),tag:n[1]}},render:function(n,e,t){return a(n.tag,g({},n.attrs,{key:t.key}))}});var f,d=function(n){var e=Object.keys(n);function t(r,a){for(var o=[],i="";r;)for(var l=0;l=0||(a[t]=n[t]);return a}(n,h);return l.cloneElement(ve(e,t),r)}function xe(){var n=l.useState(document.getElementById("sample-content").textContent.trim()),e=n[0],t=n[1],r=l.useCallback(function(n){return t(n.target.value)},[]);/*#__PURE__*/return l.createElement("main",null,/*#__PURE__*/l.createElement(we,null),/*#__PURE__*/l.createElement(He,null,/*#__PURE__*/l.createElement("a",{target:"_blank",href:"https://github.com/probablyup/markdown-to-jsx",title:"Check out the markdown-to-jsx source code",rel:"noopener noreferrer"},/*#__PURE__*/l.createElement("img",{src:"./images/logo.svg",alt:"markdown-to-jsx logo"})),/*#__PURE__*/l.createElement(Oe,null,/*#__PURE__*/l.createElement("h1",null,/*#__PURE__*/l.createElement("code",null,"markdown-to-jsx")," is an easy-to-use markdown component that takes Github-flavored Markdown (GFM) and makes native JSX without dangerous hacks. "),/*#__PURE__*/l.createElement("h2",null,"It's lightweight, customizable, and happily supports React-like libraries.")),/*#__PURE__*/l.createElement(Me,null,"See the"," ",/*#__PURE__*/l.createElement("a",{target:"_blank",href:"https://github.com/probablyup/markdown-to-jsx/blob/main/README.md",rel:"noopener noreferrer"},"project README")," ","for detailed installation & usage instructions.")),/*#__PURE__*/l.createElement(Ae,null,/*#__PURE__*/l.createElement(je,{onInput:r,value:e}),/*#__PURE__*/l.createElement(Ce,null,/*#__PURE__*/l.createElement(ke,{options:ze},e))))}(ee=ne||(ne={}))[ee.MAX=0]="MAX",ee[ee.HIGH=1]="HIGH",ee[ee.MED=2]="MED",ee[ee.LOW=3]="LOW",ee[ee.MIN=4]="MIN";var be="rgba(255, 255, 255, 0.5)",Ee="#fefefe",we=t.createGlobalStyle(te||(te=d(["\n\t*,\n\t*::before,\n\t*::after {\n\t\tbox-sizing: border-box;\n\t\toutline-color: ",";\n\t}\n\n\thtml,\n\tbody,\n\t#root,\n\tmain {\n\t\tmargin: 0;\n\t\tmin-height: 100vh;\n\t}\n\n\thtml {\n\t\tbackground: #222;\n\t\tcolor: ",";\n\t\tfont-family: Inter, Helvetica Neue, Helvetica, sans-serif;\n\t\tfont-size: 14px;\n\t\tline-height: 1.5;\n\t}\n\n\th1,\n\th2,\n\th3,\n\th4,\n\th5,\n\th6 {\n\t\tmargin: 0 0 1rem;\n text-wrap: balance;\n\t}\n\n\th1 {\n\t\tfont-size: 2rem;\n\t}\n\n\th2 {\n\t\tfont-size: 1.8rem;\n\t}\n\n\th3 {\n\t\tfont-size: 1.6rem;\n\t}\n\n\th4 {\n\t\tfont-size: 1.4rem;\n\t}\n\n\th5 {\n\t\tfont-size: 1.2rem;\n\t}\n\n\th6 {\n\t\tfont-size: 1rem;\n\t}\n\n\ta {\n\t\tcolor: ",";\n\t\ttransition: color 200ms ease;\n\n\t\t&:hover,\n\t\t&:focus {\n\t\t\tcolor: color-mix(in srgb, "," 75%, transparent);\n\t\t}\n\t}\n\n\tcode {\n\t\tbackground: color-mix(in srgb, "," 25%, transparent);\n\t\tdisplay: inline-block;\n\t\tpadding: 0 2px;\n\t}\n\n\tpre code {\n\t\tbackground: transparent;\n\t\tborder: 0;\n\t\tdisplay: block;\n\t\tpadding: 1em;\n\t}\n\n\tmain {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tpadding: 3rem 1.5rem 0;\n\t\tmargin: 0;\n\n\t\t@media all and (min-width: 1024px) {\n\t\t\tpadding: 3rem;\n\t\t}\n\t}\n\n p {\n text-wrap: balance;\n }\n"])),be,Ee,be,be,be),He=u.default.header(re||(re=d(["\n flex-shrink: 0;\n margin-bottom: 2em;\n text-align: center;\n\n img {\n height: 100px;\n }\n"]))),Oe=u.default.p(ae||(ae=d(["\n font-size: 16px;\n margin-left: auto;\n margin-right: auto;\n max-width: 60vw;\n\n h1,\n h2 {\n font: inherit;\n }\n\n @media all and (max-width: 500px) {\n max-width: none;\n }\n\n @media all and (max-width: 1023px) {\n h1,\n h2 {\n display: block;\n margin-bottom: 1.5rem;\n }\n }\n"]))),Me=u.default.p(oe||(oe=d(["\n color: color-mix(in srgb, "," 20%, white);\n"])),Ee),Ie=t.css(ie||(ie=d(["\n flex: 0 0 50%;\n padding: 1em;\n"]))),Ae=u.default.section(le||(le=d(["\n display: flex;\n flex-grow: 1;\n margin-left: -1.5rem;\n margin-right: -1.5rem;\n\n @media all and (min-width: 1024px) {\n margin-left: 0;\n margin-right: 0;\n }\n\n @media all and (max-width: 500px) {\n flex-direction: column;\n }\n"]))),je=u.default.textarea(ce||(ce=d(["\n ",";\n background: color-mix(in srgb, "," 10%, transparent);\n border: 0;\n color: inherit;\n position: sticky;\n top: 0;\n font-family: 'Source Code Pro', Consolas, Monaco, monospace;\n font-size: inherit;\n max-height: 100vh;\n\n @media all and (max-width: 500px) {\n height: 300px;\n position: relative;\n }\n"])),Ie,be),Ce=u.default.div(ue||(ue=d(["\n ",";\n padding-left: 2rem;\n padding-right: 1rem;\n overflow: auto;\n overflow-x: hidden;\n"])),Ie),Se=u.default.button(se||(se=d(["\n background: #444;\n color: #ddd;\n cursor: pointer;\n font: inherit;\n transition: background 200ms ease;\n\n &:hover,\n &:focus {\n background: #222;\n }\n\n &:active {\n background: #000;\n }\n"]))),ze={overrides:{MyComponent:{component:function(n){/*#__PURE__*/return l.createElement(Se,f({},n,{onClick:function(){alert("Look ma, I'm a real component!")}}))}}},renderRule:function(n,e,t,r){return 3===e.type&&"latex"===e.lang?/*#__PURE__*/l.createElement(m,{as:"div",key:r.key,style:{margin:"1.5em 0"}},String.raw(fe||(fe=d(["",""])),e.text)):n()}};c.render(/*#__PURE__*/l.createElement(xe,null),document.getElementById("root"))}(React,ReactDOM,styled,katex); +!function(n,e,t,r){function a(n){return n&&"object"==typeof n&&"default"in n?n:{default:n}}function o(n){if(n&&n.__esModule)return n;var e=Object.create(null);return n&&Object.keys(n).forEach(function(t){if("default"!==t){var r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:function(){return n[t]}})}}),e.default=n,e}var i=/*#__PURE__*/a(n),l=/*#__PURE__*/o(n),c=/*#__PURE__*/o(e),u=/*#__PURE__*/a(t),s=/*#__PURE__*/a(r);function f(){return f=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0||(a[t]=n[t]);return a}(e,["children","math","block","errorColor","renderError","settings","as"]),d=u||(a?"div":"span"),m=null!=t?t:r,g=n.useState({innerHtml:""}),h=g[0],y=g[1];return n.useEffect(function(){try{var n=s.default.renderToString(m,p({displayMode:!!a,errorColor:o,throwOnError:!!l},c));y({innerHtml:n})}catch(n){if(!(n instanceof s.default.ParseError||n instanceof TypeError))throw n;y(l?{errorElement:l(n)}:{innerHtml:n.message})}},[a,m,o,l,c]),"errorElement"in h?h.errorElement:i.default.createElement(d,Object.assign({},f,{dangerouslySetInnerHTML:{__html:h.innerHtml}}))});function g(){return g=Object.assign?Object.assign.bind():function(n){for(var e=1;e",lt:"<",nbsp:" ",quot:"“"},k=["style","script"],x=/([-A-Z0-9_:]+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|(?:\{((?:\\.|{[^}]*?}|[^}])*)\})))?/gi,b=/mailto:/i,E=/\n{2,}$/,w=/^( *>[^\n]+(\n[^\n]+)*\n*)+\n{2,}/,H=/^ *> ?/gm,O=/^ {2,}\n/,M=/^(?:( *[-*_])){3,} *(?:\n *)+\n/,I=/^\s*(`{3,}|~{3,}) *(\S+)?([^\n]*?)?\n([\s\S]+?)\s*\1 *(?:\n *)*\n?/,A=/^(?: {4}[^\n]+\n*)+(?:\n *)+\n?/,j=/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,z=/^(?:\n *)*\n/,C=/\r\n?/g,S=/^\[\^([^\]]+)](:.*)\n/,G=/^\[\^([^\]]+)]/,L=/\f/g,T=/^\s*?\[(x|\s)\]/,$=/^ *(#{1,6}) *([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,_=/^ *(#{1,6}) +([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,R=/^([^\n]+)\n *(=|-){3,} *(?:\n *)+\n/,X=/^ *(?!<[a-z][^ >/]* ?\/>)<([a-z][^ >/]*) ?([^>]*)\/{0}>\n?(\s*(?:<\1[^>]*?>[\s\S]*?<\/\1>|(?!<\1)[\s\S])*?)<\/\1>\n*/i,W=/&([a-z0-9]+|#[0-9]{1,6}|#x[0-9a-fA-F]{1,6});/gi,P=/^)/,N=/^(data|aria|x)-[a-z_][a-z\d_.-]*$/,D=/^ *<([a-z][a-z0-9:]*)(?:\s+((?:<.*?>|[^>])*))?\/?>(?!<\/\1>)(\s*\n)?/i,U=/^\{.*\}$/,B=/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,F=/^<([^ >]+@[^ >]+)>/,q=/^<([^ >]+:\/[^ >]+)>/,Z=/-([a-z])?/gi,J=/^(.*\|?.*)\n *(\|? *[-:]+ *\|[-| :]*)\n((?:.*\|.*\n)*)\n?/,V=/^\[([^\]]*)\]:\s+]+)>?\s*("([^"]*)")?/,K=/^!\[([^\]]*)\] ?\[([^\]]*)\]/,Q=/^\[([^\]]*)\] ?\[([^\]]*)\]/,Y=/(\[|\])/g,nn=/(\n|^[-*]\s|^#|^ {2,}|^-{2,}|^>\s)/,en=/\t/g,tn=/^ *\| */,rn=/(^ *\||\| *$)/g,an=/ *$/,on=/^ *:-+: *$/,ln=/^ *:-+ *$/,cn=/^ *-+: *$/,un=/^([*_])\1((?:\[.*?\][([].*?[)\]]|<.*?>(?:.*?<.*?>)?|`.*?`|~+.*?~+|.)*?)\1\1(?!\1)/,sn=/^([*_])((?:\[.*?\][([].*?[)\]]|<.*?>(?:.*?<.*?>)?|`.*?`|~+.*?~+|.)*?)\1(?!\1|\w)/,fn=/^==((?:\[.*?\]|<.*?>(?:.*?<.*?>)?|`.*?`|.)*?)==/,dn=/^~~((?:\[.*?\]|<.*?>(?:.*?<.*?>)?|`.*?`|.)*?)~~/,pn=/^\\([^0-9A-Za-z\s])/,mn=/^[\s\S]+?(?=[^0-9A-Z\s\u00c0-\uffff&#;.()'"]|\d+\.|\n\n| {2,}\n|\w+:\S|$)/i,gn=/^\n+/,hn=/^([ \t]*)/,yn=/\\([^\\])/g,vn=/ *\n+$/,kn=/(?:^|\n)( *)$/,xn="(?:\\d+\\.)",bn="(?:[*+-])";function En(n){return"( *)("+(1===n?xn:bn)+") +"}var wn=En(1),Hn=En(2);function On(n){return new RegExp("^"+(1===n?wn:Hn))}var Mn=On(1),In=On(2);function An(n){return new RegExp("^"+(1===n?wn:Hn)+"[^\\n]*(?:\\n(?!\\1"+(1===n?xn:bn)+" )[^\\n]*)*(\\n|$)","gm")}var jn=An(1),zn=An(2);function Cn(n){var e=1===n?xn:bn;return new RegExp("^( *)("+e+") [\\s\\S]+?(?:\\n{2,}(?! )(?!\\1"+e+" (?!"+e+" ))\\n*|\\s*\\n*$)")}var Sn=Cn(1),Gn=Cn(2);function Ln(n,e){var t=1===e,r=t?Sn:Gn,a=t?jn:zn,o=t?Mn:In;return{match:function(n,e,t){var a=kn.exec(t);return a&&(e.list||!e.inline&&!e.simple)?r.exec(n=a[1]+n):null},order:ne.HIGH,parse:function(n,e,r){var i=t?+n[2]:void 0,l=n[0].replace(E,"\n").match(a),c=!1;return{items:l.map(function(n,t){var a=o.exec(n)[0].length,i=new RegExp("^ {1,"+a+"}","gm"),u=n.replace(i,"").replace(o,""),s=t===l.length-1,f=-1!==u.indexOf("\n\n")||s&&c;c=f;var d,p=r.inline,m=r.list;r.list=!0,f?(r.inline=!1,d=u.replace(vn,"\n\n")):(r.inline=!0,d=u.replace(vn,""));var g=e(d,r);return r.inline=p,r.list=m,g}),ordered:t,start:i}},render:function(e,t,r){return n(e.ordered?"ol":"ul",{key:r.key,start:e.start},e.items.map(function(e,a){return n("li",{key:a},t(e,r))}))}}}var Tn=/^\[([^\]]*)]\( *((?:\([^)]*\)|[^() ])*) *"?([^)"]*)?"?\)/,$n=/^!\[([^\]]*)]\( *((?:\([^)]*\)|[^() ])*) *"?([^)"]*)?"?\)/,_n=[w,I,A,$,R,_,P,J,jn,Sn,zn,Gn],Rn=[].concat(_n,[/^[^\n]+(?: \n|\n{2,})/,X,D]);function Xn(n){return n.replace(/[ÀÁÂÃÄÅàáâãäåæÆ]/g,"a").replace(/[çÇ]/g,"c").replace(/[ðÐ]/g,"d").replace(/[ÈÉÊËéèêë]/g,"e").replace(/[ÏïÎîÍíÌì]/g,"i").replace(/[Ññ]/g,"n").replace(/[øØœŒÕõÔôÓóÒò]/g,"o").replace(/[ÜüÛûÚúÙù]/g,"u").replace(/[ŸÿÝý]/g,"y").replace(/[^a-z0-9- ]/gi,"").replace(/ /gi,"-").toLowerCase()}function Wn(n){return cn.test(n)?"right":on.test(n)?"center":ln.test(n)?"left":null}function Pn(n,e,t){var r=t.inTable;t.inTable=!0;var a=e(n.trim(),t);t.inTable=r;var o=[[]];return a.forEach(function(n,e){26===n.type?0!==e&&e!==a.length-1&&o.push([]):(27!==n.type||null!=a[e+1]&&26!==a[e+1].type||(n.text=n.text.replace(an,"")),o[o.length-1].push(n))}),o}function Nn(n,e,t){t.inline=!0;var r=Pn(n[1],e,t),a=n[2].replace(rn,"").split("|").map(Wn),o=function(n,e,t){return n.trim().split("\n").map(function(n){return Pn(n,e,t)})}(n[3],e,t);return t.inline=!1,{align:a,cells:o,header:r,type:25}}function Dn(n,e){return null==n.align[e]?{}:{textAlign:n.align[e]}}function Un(n){return function(e,t){return t.inline?n.exec(e):null}}function Bn(n){return function(e,t){return t.inline||t.simple?n.exec(e):null}}function Fn(n){return function(e,t){return t.inline||t.simple?null:n.exec(e)}}function qn(n){return function(e){return n.exec(e)}}function Zn(n,e,t){if(e.inline||e.simple)return null;if(t&&!t.endsWith("\n"))return null;var r="";n.split("\n").every(function(n){return!_n.some(function(e){return e.test(n)})&&(r+=n+"\n",n.trim())});var a=r.trimEnd();return""==a?null:[r,a]}function Jn(n){try{if(decodeURIComponent(n).replace(/[^A-Za-z0-9/:]/g,"").match(/^\s*(javascript|vbscript|data(?!:image)):/i))return}catch(n){return null}return n}function Vn(n){return n.replace(yn,"$1")}function Kn(n,e,t){var r=t.inline||!1,a=t.simple||!1;t.inline=!0,t.simple=!0;var o=n(e,t);return t.inline=r,t.simple=a,o}function Qn(n,e,t){var r=t.inline||!1,a=t.simple||!1;t.inline=!1,t.simple=!0;var o=n(e,t);return t.inline=r,t.simple=a,o}function Yn(n,e,t){return t.inline=!1,n(e,t)}var ne,ee,te,re,ae,oe,ie,le,ce,ue,se,fe,de=function(n,e,t){return{content:Kn(e,n[1],t)}};function pe(){return{}}function me(){return null}function ge(){return[].slice.call(arguments).filter(Boolean).join(" ")}function he(n,e,t){for(var r=n,a=e.split(".");a.length&&void 0!==(r=r[a[0]]);)a.shift();return r||t}function ye(n,e){var t=he(e,n);return t?"function"==typeof t||"object"==typeof t&&"render"in t?t:he(e,n+".component",n):n}function ve(n,e){var t;void 0===e&&(e={}),e.overrides=e.overrides||{},e.slugify=e.slugify||Xn,e.namedCodesToUnicode=e.namedCodesToUnicode?g({},v,e.namedCodesToUnicode):v;var r=e.createElement||l.createElement;function a(n,t){var a=he(e.overrides,n+".props",{});return r.apply(void 0,[ye(n,e.overrides),g({},t,a,{className:ge(null==t?void 0:t.className,a.className)||void 0})].concat([].slice.call(arguments,2)))}function o(n){var t=!1;e.forceInline?t=!0:e.forceBlock||(t=!1===nn.test(n));for(var r=p(d(t?n:n.trimEnd().replace(gn,"")+"\n\n",{inline:t}));"string"==typeof r[r.length-1]&&!r[r.length-1].trim();)r.pop();if(null===e.wrapper)return r;var o,i=e.wrapper||(t?"span":"div");if(r.length>1||e.forceWrapper)o=r;else{if(1===r.length)return"string"==typeof(o=r[0])?a("span",{key:"outer"},o):o;o=null}return l.createElement(i,{key:"outer"},o)}function i(n){var e=n.match(x);return e?e.reduce(function(n,e,t){var r,a=e.indexOf("=");if(-1!==a){var i=(r=e.slice(0,a),-1!==r.indexOf("-")&&null===r.match(N)&&(r=r.replace(Z,function(n,e){return e.toUpperCase()})),r).trim(),c=function(n){var e=n[0];return('"'===e||"'"===e)&&n.length>=2&&n[n.length-1]===e?n.slice(1,-1):n}(e.slice(a+1).trim()),u=y[i]||i,s=n[u]=function(n,e){return"style"===n?e.split(/;\s?/).reduce(function(n,e){var t=e.slice(0,e.indexOf(":"));return n[t.replace(/(-[a-z])/g,function(n){return n[1].toUpperCase()})]=e.slice(t.length+1).trim(),n},{}):"href"===n?Jn(e):(e.match(U)&&(e=e.slice(1,e.length-1)),"true"===e||"false"!==e&&e)}(i,c);"string"==typeof s&&(X.test(s)||D.test(s))&&(n[u]=l.cloneElement(o(s.trim()),{key:t}))}else"style"!==e&&(n[y[e]||e]=!0);return n},{}):null}var c=[],u={},s=((t={})[0]={match:Fn(w),order:ne.HIGH,parse:function(n,e,t){return{content:e(n[0].replace(H,""),t)}},render:function(n,e,t){return a("blockquote",{key:t.key},e(n.content,t))}},t[1]={match:qn(O),order:ne.HIGH,parse:pe,render:function(n,e,t){return a("br",{key:t.key})}},t[2]={match:Fn(M),order:ne.HIGH,parse:pe,render:function(n,e,t){return a("hr",{key:t.key})}},t[3]={match:Fn(A),order:ne.MAX,parse:function(n){return{lang:void 0,text:n[0].replace(/^ {4}/gm,"").replace(/\n+$/,"")}},render:function(n,e,t){return a("pre",{key:t.key},a("code",g({},n.attrs,{className:n.lang?"lang-"+n.lang:""}),n.text))}},t[4]={match:Fn(I),order:ne.MAX,parse:function(n){return{attrs:i(n[3]||""),lang:n[2]||void 0,text:n[4],type:3}}},t[5]={match:Bn(j),order:ne.LOW,parse:function(n){return{text:n[2]}},render:function(n,e,t){return a("code",{key:t.key},n.text)}},t[6]={match:Fn(S),order:ne.MAX,parse:function(n){return c.push({footnote:n[2],identifier:n[1]}),{}},render:me},t[7]={match:Un(G),order:ne.HIGH,parse:function(n){return{target:"#"+e.slugify(n[1]),text:n[1]}},render:function(n,e,t){return a("a",{key:t.key,href:Jn(n.target)},a("sup",{key:t.key},n.text))}},t[8]={match:Un(T),order:ne.HIGH,parse:function(n){return{_completed:"x"===n[1].toLowerCase()}},render:function(n,e,t){return a("input",{checked:n._completed,key:t.key,readOnly:!0,type:"checkbox"})}},t[9]={match:Fn(e.enforceAtxHeadings?_:$),order:ne.HIGH,parse:function(n,t,r){return{content:Kn(t,n[2],r),_id:e.slugify(n[2]),level:n[1].length}},render:function(n,e,t){return a("h"+n.level,{id:n._id,key:t.key},e(n.content,t))}},t[10]={match:Fn(R),order:ne.MAX,parse:function(n,e,t){return{content:Kn(e,n[1],t),level:"="===n[2]?1:2,type:9}}},t[12]={match:qn(P),order:ne.HIGH,parse:function(){return{}},render:me},t[14]={match:Bn($n),order:ne.HIGH,parse:function(n){return{alt:n[1],target:Vn(n[2]),title:n[3]}},render:function(n,e,t){return a("img",{key:t.key,alt:n.alt||void 0,title:n.title||void 0,src:Jn(n.target)})}},t[15]={match:Un(Tn),order:ne.LOW,parse:function(n,e,t){return{content:Qn(e,n[1],t),target:Vn(n[2]),title:n[3]}},render:function(n,e,t){return a("a",{key:t.key,href:Jn(n.target),title:n.title},e(n.content,t))}},t[16]={match:Un(q),order:ne.MAX,parse:function(n){return{content:[{text:n[1],type:27}],target:n[1],type:15}}},t[17]={match:function(n,e){return e.inAnchor?null:Un(B)(n,e)},order:ne.MAX,parse:function(n){return{content:[{text:n[1],type:27}],target:n[1],title:void 0,type:15}}},t[18]={match:Un(F),order:ne.MAX,parse:function(n){var e=n[1],t=n[1];return b.test(t)||(t="mailto:"+t),{content:[{text:e.replace("mailto:",""),type:27}],target:t,type:15}}},t[20]=Ln(a,1),t[33]=Ln(a,2),t[19]={match:Fn(z),order:ne.LOW,parse:pe,render:function(){return"\n"}},t[21]={match:Zn,order:ne.LOW,parse:de,render:function(n,e,t){return a("p",{key:t.key},e(n.content,t))}},t[22]={match:Un(V),order:ne.MAX,parse:function(n){return u[n[1]]={target:n[2],title:n[4]},{}},render:me},t[23]={match:Bn(K),order:ne.MAX,parse:function(n){return{alt:n[1]||void 0,ref:n[2]}},render:function(n,e,t){return a("img",{key:t.key,alt:n.alt,src:Jn(u[n.ref].target),title:u[n.ref].title})}},t[24]={match:Un(Q),order:ne.MAX,parse:function(n,e,t){return{content:e(n[1],t),fallbackContent:e(n[0].replace(Y,"\\$1"),t),ref:n[2]}},render:function(n,e,t){return u[n.ref]?a("a",{key:t.key,href:Jn(u[n.ref].target),title:u[n.ref].title},e(n.content,t)):a("span",{key:t.key},e(n.fallbackContent,t))}},t[25]={match:Fn(J),order:ne.HIGH,parse:Nn,render:function(n,e,t){return a("table",{key:t.key},a("thead",null,a("tr",null,n.header.map(function(r,o){return a("th",{key:o,style:Dn(n,o)},e(r,t))}))),a("tbody",null,n.cells.map(function(r,o){return a("tr",{key:o},r.map(function(r,o){return a("td",{key:o,style:Dn(n,o)},e(r,t))}))})))}},t[26]={match:function(n,e){return e.inTable?(e.inline=!0,tn.exec(n)):null},order:ne.HIGH,parse:function(){return{type:26}},render:function(){return" | "}},t[27]={match:qn(mn),order:ne.MIN,parse:function(n){return{text:n[0].replace(W,function(n,t){return e.namedCodesToUnicode[t]?e.namedCodesToUnicode[t]:n})}},render:function(n){return n.text}},t[28]={match:Bn(un),order:ne.MED,parse:function(n,e,t){return{content:e(n[2],t)}},render:function(n,e,t){return a("strong",{key:t.key},e(n.content,t))}},t[29]={match:Bn(sn),order:ne.LOW,parse:function(n,e,t){return{content:e(n[2],t)}},render:function(n,e,t){return a("em",{key:t.key},e(n.content,t))}},t[30]={match:Bn(pn),order:ne.HIGH,parse:function(n){return{text:n[1],type:27}}},t[31]={match:Bn(fn),order:ne.LOW,parse:de,render:function(n,e,t){return a("mark",{key:t.key},e(n.content,t))}},t[32]={match:Bn(dn),order:ne.LOW,parse:de,render:function(n,e,t){return a("del",{key:t.key},e(n.content,t))}},t);!0!==e.disableParsingRawHTML&&(s[11]={match:qn(X),order:ne.HIGH,parse:function(n,e,t){var r,a=n[3].match(hn),o=new RegExp("^"+a[1],"gm"),l=n[3].replace(o,""),c=(r=l,Rn.some(function(n){return n.test(r)})?Yn:Kn),u=n[1].toLowerCase(),s=-1!==k.indexOf(u),f={attrs:i(n[2]),noInnerParse:s,tag:s?u:n[1]};return t.inAnchor=t.inAnchor||"a"===u,s?f.text=n[3]:f.content=c(e,l,t),t.inAnchor=!1,f},render:function(n,e,t){return a(n.tag,g({key:t.key},n.attrs),n.text||e(n.content,t))}},s[13]={match:qn(D),order:ne.HIGH,parse:function(n){return{attrs:i(n[2]||""),tag:n[1]}},render:function(n,e,t){return a(n.tag,g({},n.attrs,{key:t.key}))}});var f,d=function(n){var e=Object.keys(n);function t(r,a){for(var o=[],i="";r;)for(var l=0;l=0||(a[t]=n[t]);return a}(n,h);return l.cloneElement(ve(e,t),r)}function xe(){var n=l.useState(document.getElementById("sample-content").textContent.trim()),e=n[0],t=n[1],r=l.useCallback(function(n){return t(n.target.value)},[]);/*#__PURE__*/return l.createElement("main",null,/*#__PURE__*/l.createElement(we,null),/*#__PURE__*/l.createElement(He,null,/*#__PURE__*/l.createElement("a",{target:"_blank",href:"https://github.com/quantizor/markdown-to-jsx",title:"Check out the markdown-to-jsx source code",rel:"noopener noreferrer"},/*#__PURE__*/l.createElement("img",{src:"./images/logo.svg",alt:"markdown-to-jsx logo"})),/*#__PURE__*/l.createElement(Oe,null,/*#__PURE__*/l.createElement("h1",null,/*#__PURE__*/l.createElement("code",null,"markdown-to-jsx")," is an easy-to-use markdown component that takes Github-flavored Markdown (GFM) and makes native JSX without dangerous hacks. "),/*#__PURE__*/l.createElement("h2",null,"It's lightweight, customizable, and happily supports React-like libraries.")),/*#__PURE__*/l.createElement(Me,null,"See the"," ",/*#__PURE__*/l.createElement("a",{target:"_blank",href:"https://github.com/quantizor/markdown-to-jsx/blob/main/README.md",rel:"noopener noreferrer"},"project README")," ","for detailed installation & usage instructions.")),/*#__PURE__*/l.createElement(Ae,null,/*#__PURE__*/l.createElement(je,{onInput:r,value:e}),/*#__PURE__*/l.createElement(ze,null,/*#__PURE__*/l.createElement(ke,{options:Se},e))))}(ee=ne||(ne={}))[ee.MAX=0]="MAX",ee[ee.HIGH=1]="HIGH",ee[ee.MED=2]="MED",ee[ee.LOW=3]="LOW",ee[ee.MIN=4]="MIN";var be="cornflowerblue",Ee="#fefefe",we=t.createGlobalStyle(te||(te=d(["\n\t*,\n\t*::before,\n\t*::after {\n\t\tbox-sizing: border-box;\n\t\toutline-color: ",";\n\t}\n\n\thtml,\n\tbody,\n\t#root,\n\tmain {\n\t\tmargin: 0;\n\t\tmin-height: 100vh;\n\t}\n\n\thtml {\n\t\tbackground: #1a1c23;\n\t\tcolor: ",";\n\t\tfont-family: Inter, Helvetica Neue, Helvetica, sans-serif;\n\t\tfont-size: 14px;\n\t\tline-height: 1.5;\n\t}\n\n\th1,\n\th2,\n\th3,\n\th4,\n\th5,\n\th6 {\n\t\tmargin: 0 0 1rem;\n text-wrap: balance;\n\t}\n\n\th1 {\n\t\tfont-size: 2rem;\n\t}\n\n\th2 {\n\t\tfont-size: 1.8rem;\n\t}\n\n\th3 {\n\t\tfont-size: 1.6rem;\n\t}\n\n\th4 {\n\t\tfont-size: 1.4rem;\n\t}\n\n\th5 {\n\t\tfont-size: 1.2rem;\n\t}\n\n\th6 {\n\t\tfont-size: 1rem;\n\t}\n\n\ta {\n\t\tcolor: ",";\n\t\ttransition: color 200ms ease;\n\n\t\t&:hover,\n\t\t&:focus {\n\t\t\tcolor: color-mix(in srgb, "," 75%, transparent);\n\t\t}\n\t}\n\n\tcode {\n\t\tbackground: color-mix(in srgb, "," 15%, transparent);\n border-radius: 2px;\n\t\tdisplay: inline-block;\n font-family: 'Jetbrains Mono', Consolas, Monaco, monospace;\n font-size: 0.9em;\n\t\tpadding: 0 4px;\n text-decoration: inherit;\n\t}\n\n\tpre code {\n\t\tbackground: transparent;\n\t\tborder: 0;\n\t\tdisplay: block;\n\t\tpadding: 1em;\n\t}\n\n\tmain {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tpadding: 3rem 1.5rem 0;\n\t\tmargin: 0;\n\n\t\t@media all and (min-width: 1024px) {\n\t\t\tpadding: 3rem;\n\t\t}\n\t}\n\n p {\n text-wrap: balance;\n }\n"])),be,Ee,be,be,be),He=u.default.header(re||(re=d(["\n flex-shrink: 0;\n margin-bottom: 2em;\n text-align: center;\n\n img {\n height: 100px;\n }\n"]))),Oe=u.default.p(ae||(ae=d(["\n font-size: 16px;\n margin-left: auto;\n margin-right: auto;\n max-width: 60vw;\n\n h1,\n h2 {\n font: inherit;\n }\n\n @media all and (max-width: 500px) {\n max-width: none;\n }\n\n @media all and (max-width: 1023px) {\n h1,\n h2 {\n display: block;\n margin-bottom: 1.5rem;\n }\n }\n"]))),Me=u.default.p(oe||(oe=d(["\n color: color-mix(in srgb, "," 20%, white);\n"])),Ee),Ie=t.css(ie||(ie=d(["\n flex: 0 0 50%;\n padding: 1em;\n"]))),Ae=u.default.section(le||(le=d(["\n display: flex;\n flex-grow: 1;\n margin-left: -1.5rem;\n margin-right: -1.5rem;\n\n @media all and (min-width: 1024px) {\n margin-left: 0;\n margin-right: 0;\n }\n\n @media all and (max-width: 500px) {\n flex-direction: column;\n }\n"]))),je=u.default.textarea(ce||(ce=d(["\n ",";\n background: color-mix(in srgb, "," 10%, transparent);\n border: 0;\n color: inherit;\n position: sticky;\n top: 0;\n font-family: 'Jetbrains Mono', Consolas, Monaco, monospace;\n font-size: inherit;\n max-height: 100vh;\n\n @media all and (max-width: 500px) {\n height: 300px;\n position: relative;\n }\n"])),Ie,be),ze=u.default.div(ue||(ue=d(["\n ",";\n padding-left: 2rem;\n padding-right: 1rem;\n overflow: auto;\n overflow-x: hidden;\n"])),Ie),Ce=u.default.button(se||(se=d(["\n background: color-mix(in srgb, "," 50%, black);\n border: 1px solid color-mix(in srgb, "," 50%, transparent);\n border-radius: 2px;\n color: #fff;\n cursor: pointer;\n padding: 0.25em 0.75em;\n font: inherit;\n transition: background 200ms ease;\n\n &:hover,\n &:focus {\n background: ",";\n }\n\n &:active {\n background: color-mix(in srgb, "," 80%, black);\n }\n"])),be,be,be,be),Se={overrides:{MyComponent:{component:function(n){/*#__PURE__*/return l.createElement(Ce,f({},n,{onClick:function(){alert("Look ma, I'm a real component!")}}))}}},renderRule:function(n,e,t,r){return 3===e.type&&"latex"===e.lang?/*#__PURE__*/l.createElement(m,{as:"div",key:r.key,style:{margin:"1.5em 0"}},String.raw(fe||(fe=d(["",""])),e.text)):n()}};c.render(/*#__PURE__*/l.createElement(xe,null),document.getElementById("root"))}(React,ReactDOM,styled,katex); //# sourceMappingURL=markdown-to-jsx.js.map diff --git a/docs/markdown-to-jsx.js.map b/docs/markdown-to-jsx.js.map index 28bab87c..a5748c15 100644 --- a/docs/markdown-to-jsx.js.map +++ b/docs/markdown-to-jsx.js.map @@ -1 +1 @@ -{"version":3,"file":"markdown-to-jsx.js","sources":["../node_modules/@matejmazur/react-katex/dist/react-katex.m.js","../dist/index.module.js","../site.tsx"],"sourcesContent":["import r,{memo as e,useState as n,useEffect as t}from\"react\";import o from\"katex\";function a(){return(a=Object.assign||function(r){for(var e=1;e=0||(o[n]=r[n]);return o}(e,[\"children\",\"math\",\"block\",\"errorColor\",\"renderError\",\"settings\",\"as\"]),d=u||(s?\"div\":\"span\"),p=null!=i?i:l,g=n({innerHtml:\"\"}),E=g[0],v=g[1];return t(function(){try{var r=o.renderToString(p,a({displayMode:!!s,errorColor:c,throwOnError:!!f},m));v({innerHtml:r})}catch(r){if(!(r instanceof o.ParseError||r instanceof TypeError))throw r;v(f?{errorElement:f(r)}:{innerHtml:r.message})}},[s,p,c,f,m]),\"errorElement\"in E?E.errorElement:r.createElement(d,Object.assign({},h,{dangerouslySetInnerHTML:{__html:E.innerHtml}}))});export default i;\n//# sourceMappingURL=react-katex.m.js.map\n","import*as e from\"react\";function n(){return n=Object.assign?Object.assign.bind():function(e){for(var n=1;n\",lt:\"<\",nbsp:\" \",quot:\"“\"},o=[\"style\",\"script\"],c=/([-A-Z0-9_:]+)(?:\\s*=\\s*(?:(?:\"((?:\\\\.|[^\"])*)\")|(?:'((?:\\\\.|[^'])*)')|(?:\\{((?:\\\\.|{[^}]*?}|[^}])*)\\})))?/gi,l=/mailto:/i,u=/\\n{2,}$/,s=/^( *>[^\\n]+(\\n[^\\n]+)*\\n*)+\\n{2,}/,f=/^ *> ?/gm,d=/^ {2,}\\n/,p=/^(?:( *[-*_])){3,} *(?:\\n *)+\\n/,m=/^\\s*(`{3,}|~{3,}) *(\\S+)?([^\\n]*?)?\\n([\\s\\S]+?)\\s*\\1 *(?:\\n *)*\\n?/,g=/^(?: {4}[^\\n]+\\n*)+(?:\\n *)+\\n?/,h=/^(`+)\\s*([\\s\\S]*?[^`])\\s*\\1(?!`)/,y=/^(?:\\n *)*\\n/,k=/\\r\\n?/g,v=/^\\[\\^([^\\]]+)](:.*)\\n/,x=/^\\[\\^([^\\]]+)]/,b=/\\f/g,H=/^\\s*?\\[(x|\\s)\\]/,A=/^ *(#{1,6}) *([^\\n]+?)(?: +#*)?(?:\\n *)*(?:\\n|$)/,I=/^ *(#{1,6}) +([^\\n]+?)(?: +#*)?(?:\\n *)*(?:\\n|$)/,S=/^([^\\n]+)\\n *(=|-){3,} *(?:\\n *)+\\n/,M=/^ *(?!<[a-z][^ >/]* ?\\/>)<([a-z][^ >/]*) ?([^>]*)\\/{0}>\\n?(\\s*(?:<\\1[^>]*?>[\\s\\S]*?<\\/\\1>|(?!<\\1)[\\s\\S])*?)<\\/\\1>\\n*/i,L=/&([a-z0-9]+|#[0-9]{1,6}|#x[0-9a-fA-F]{1,6});/gi,O=/^)/,C=/^(data|aria|x)-[a-z_][a-z\\d_.-]*$/,E=/^ *<([a-z][a-z0-9:]*)(?:\\s+((?:<.*?>|[^>])*))?\\/?>(?!<\\/\\1>)(\\s*\\n)?/i,w=/^\\{.*\\}$/,T=/^(https?:\\/\\/[^\\s<]+[^<.,:;\"')\\]\\s])/,G=/^<([^ >]+@[^ >]+)>/,$=/^<([^ >]+:\\/[^ >]+)>/,z=/-([a-z])?/gi,B=/^(.*\\|?.*)\\n *(\\|? *[-:]+ *\\|[-| :]*)\\n((?:.*\\|.*\\n)*)\\n?/,W=/^\\[([^\\]]*)\\]:\\s+]+)>?\\s*(\"([^\"]*)\")?/,X=/^!\\[([^\\]]*)\\] ?\\[([^\\]]*)\\]/,D=/^\\[([^\\]]*)\\] ?\\[([^\\]]*)\\]/,R=/(\\[|\\])/g,U=/(\\n|^[-*]\\s|^#|^ {2,}|^-{2,}|^>\\s)/,_=/\\t/g,N=/^ *\\| */,j=/(^ *\\||\\| *$)/g,F=/ *$/,P=/^ *:-+: *$/,Z=/^ *:-+ *$/,q=/^ *-+: *$/,Q=/^([*_])\\1((?:\\[.*?\\][([].*?[)\\]]|<.*?>(?:.*?<.*?>)?|`.*?`|~+.*?~+|.)*?)\\1\\1(?!\\1)/,V=/^([*_])((?:\\[.*?\\][([].*?[)\\]]|<.*?>(?:.*?<.*?>)?|`.*?`|~+.*?~+|.)*?)\\1(?!\\1|\\w)/,J=/^==((?:\\[.*?\\]|<.*?>(?:.*?<.*?>)?|`.*?`|.)*?)==/,K=/^~~((?:\\[.*?\\]|<.*?>(?:.*?<.*?>)?|`.*?`|.)*?)~~/,Y=/^\\\\([^0-9A-Za-z\\s])/,ee=/^[\\s\\S]+?(?=[^0-9A-Z\\s\\u00c0-\\uffff&#;.()'\"]|\\d+\\.|\\n\\n| {2,}\\n|\\w+:\\S|$)/i,ne=/^\\n+/,te=/^([ \\t]*)/,re=/\\\\([^\\\\])/g,ae=/ *\\n+$/,ie=/(?:^|\\n)( *)$/,oe=\"(?:\\\\d+\\\\.)\",ce=\"(?:[*+-])\";function le(e){return\"( *)(\"+(1===e?oe:ce)+\") +\"}var ue=le(1),se=le(2);function fe(e){return new RegExp(\"^\"+(1===e?ue:se))}var de=fe(1),pe=fe(2);function me(e){return new RegExp(\"^\"+(1===e?ue:se)+\"[^\\\\n]*(?:\\\\n(?!\\\\1\"+(1===e?oe:ce)+\" )[^\\\\n]*)*(\\\\n|$)\",\"gm\")}var ge=me(1),he=me(2);function ye(e){var n=1===e?oe:ce;return new RegExp(\"^( *)(\"+n+\") [\\\\s\\\\S]+?(?:\\\\n{2,}(?! )(?!\\\\1\"+n+\" (?!\"+n+\" ))\\\\n*|\\\\s*\\\\n*$)\")}var ke=ye(1),ve=ye(2);function xe(e,n){var t=1===n,r=t?ke:ve,a=t?ge:he,i=t?de:pe;return{match:function(e,n,t){var a=ie.exec(t);return a&&(n.list||!n.inline&&!n.simple)?r.exec(e=a[1]+e):null},order:Re.HIGH,parse:function(e,n,r){var o=t?+e[2]:void 0,c=e[0].replace(u,\"\\n\").match(a),l=!1;return{items:c.map(function(e,t){var a=i.exec(e)[0].length,o=new RegExp(\"^ {1,\"+a+\"}\",\"gm\"),u=e.replace(o,\"\").replace(i,\"\"),s=t===c.length-1,f=-1!==u.indexOf(\"\\n\\n\")||s&&l;l=f;var d,p=r.inline,m=r.list;r.list=!0,f?(r.inline=!1,d=u.replace(ae,\"\\n\\n\")):(r.inline=!0,d=u.replace(ae,\"\"));var g=n(d,r);return r.inline=p,r.list=m,g}),ordered:t,start:o}},render:function(n,t,r){return e(n.ordered?\"ol\":\"ul\",{key:r.key,start:n.start},n.items.map(function(n,a){return e(\"li\",{key:a},t(n,r))}))}}}var be=/^\\[([^\\]]*)]\\( *((?:\\([^)]*\\)|[^() ])*) *\"?([^)\"]*)?\"?\\)/,He=/^!\\[([^\\]]*)]\\( *((?:\\([^)]*\\)|[^() ])*) *\"?([^)\"]*)?\"?\\)/,Ae=[s,m,g,A,S,I,O,B,ge,ke,he,ve],Ie=[].concat(Ae,[/^[^\\n]+(?: \\n|\\n{2,})/,M,E]);function Se(e){return e.replace(/[ÀÁÂÃÄÅàáâãäåæÆ]/g,\"a\").replace(/[çÇ]/g,\"c\").replace(/[ðÐ]/g,\"d\").replace(/[ÈÉÊËéèêë]/g,\"e\").replace(/[ÏïÎîÍíÌì]/g,\"i\").replace(/[Ññ]/g,\"n\").replace(/[øØœŒÕõÔôÓóÒò]/g,\"o\").replace(/[ÜüÛûÚúÙù]/g,\"u\").replace(/[ŸÿÝý]/g,\"y\").replace(/[^a-z0-9- ]/gi,\"\").replace(/ /gi,\"-\").toLowerCase()}function Me(e){return q.test(e)?\"right\":P.test(e)?\"center\":Z.test(e)?\"left\":null}function Le(e,n,t){var a=t.inTable;t.inTable=!0;var i=n(e.trim(),t);t.inTable=a;var o=[[]];return i.forEach(function(e,n){e.type===r.tableSeparator?0!==n&&n!==i.length-1&&o.push([]):(e.type!==r.text||null!=i[n+1]&&i[n+1].type!==r.tableSeparator||(e.text=e.text.replace(F,\"\")),o[o.length-1].push(e))}),o}function Oe(e,n,t){t.inline=!0;var a=Le(e[1],n,t),i=e[2].replace(j,\"\").split(\"|\").map(Me),o=function(e,n,t){return e.trim().split(\"\\n\").map(function(e){return Le(e,n,t)})}(e[3],n,t);return t.inline=!1,{align:i,cells:o,header:a,type:r.table}}function Ce(e,n){return null==e.align[n]?{}:{textAlign:e.align[n]}}function Ee(e){return function(n,t){return t.inline?e.exec(n):null}}function we(e){return function(n,t){return t.inline||t.simple?e.exec(n):null}}function Te(e){return function(n,t){return t.inline||t.simple?null:e.exec(n)}}function Ge(e){return function(n){return e.exec(n)}}function $e(e,n,t){if(n.inline||n.simple)return null;if(t&&!t.endsWith(\"\\n\"))return null;var r=\"\";e.split(\"\\n\").every(function(e){return!Ae.some(function(n){return n.test(e)})&&(r+=e+\"\\n\",e.trim())});var a=r.trimEnd();return\"\"==a?null:[r,a]}function ze(e){try{if(decodeURIComponent(e).replace(/[^A-Za-z0-9/:]/g,\"\").match(/^\\s*(javascript|vbscript|data(?!:image)):/i))return}catch(e){return null}return e}function Be(e){return e.replace(re,\"$1\")}function We(e,n,t){var r=t.inline||!1,a=t.simple||!1;t.inline=!0,t.simple=!0;var i=e(n,t);return t.inline=r,t.simple=a,i}function Xe(e,n,t){var r=t.inline||!1,a=t.simple||!1;t.inline=!1,t.simple=!0;var i=e(n,t);return t.inline=r,t.simple=a,i}function De(e,n,t){return t.inline=!1,e(n,t)}var Re,Ue=function(e,n,t){return{content:We(n,e[1],t)}};function _e(){return{}}function Ne(){return null}function je(){return[].slice.call(arguments).filter(Boolean).join(\" \")}function Fe(e,n,t){for(var r=e,a=n.split(\".\");a.length&&void 0!==(r=r[a[0]]);)a.shift();return r||t}function Pe(e,n){var t=Fe(n,e);return t?\"function\"==typeof t||\"object\"==typeof t&&\"render\"in t?t:Fe(n,e+\".component\",e):e}function Ze(t,u){var j;void 0===u&&(u={}),u.overrides=u.overrides||{},u.slugify=u.slugify||Se,u.namedCodesToUnicode=u.namedCodesToUnicode?n({},i,u.namedCodesToUnicode):i;var F=u.createElement||e.createElement;function P(e,t){var r=Fe(u.overrides,e+\".props\",{});return F.apply(void 0,[Pe(e,u.overrides),n({},t,r,{className:je(null==t?void 0:t.className,r.className)||void 0})].concat([].slice.call(arguments,2)))}function Z(n){var t=!1;u.forceInline?t=!0:u.forceBlock||(t=!1===U.test(n));for(var r=le(ce(t?n:n.trimEnd().replace(ne,\"\")+\"\\n\\n\",{inline:t}));\"string\"==typeof r[r.length-1]&&!r[r.length-1].trim();)r.pop();if(null===u.wrapper)return r;var a,i=u.wrapper||(t?\"span\":\"div\");if(r.length>1||u.forceWrapper)a=r;else{if(1===r.length)return\"string\"==typeof(a=r[0])?P(\"span\",{key:\"outer\"},a):a;a=null}return e.createElement(i,{key:\"outer\"},a)}function q(n){var t=n.match(c);return t?t.reduce(function(n,t,r){var i=t.indexOf(\"=\");if(-1!==i){var o=function(e){return-1!==e.indexOf(\"-\")&&null===e.match(C)&&(e=e.replace(z,function(e,n){return n.toUpperCase()})),e}(t.slice(0,i)).trim(),c=function(e){var n=e[0];return('\"'===n||\"'\"===n)&&e.length>=2&&e[e.length-1]===n?e.slice(1,-1):e}(t.slice(i+1).trim()),l=a[o]||o,u=n[l]=function(e,n){return\"style\"===e?n.split(/;\\s?/).reduce(function(e,n){var t=n.slice(0,n.indexOf(\":\"));return e[t.replace(/(-[a-z])/g,function(e){return e[1].toUpperCase()})]=n.slice(t.length+1).trim(),e},{}):\"href\"===e?ze(n):(n.match(w)&&(n=n.slice(1,n.length-1)),\"true\"===n||\"false\"!==n&&n)}(o,c);\"string\"==typeof u&&(M.test(u)||E.test(u))&&(n[l]=e.cloneElement(Z(u.trim()),{key:r}))}else\"style\"!==t&&(n[a[t]||t]=!0);return n},{}):null}var re=[],ae={},ie=((j={})[r.blockQuote]={match:Te(s),order:Re.HIGH,parse:function(e,n,t){return{content:n(e[0].replace(f,\"\"),t)}},render:function(e,n,t){return P(\"blockquote\",{key:t.key},n(e.content,t))}},j[r.breakLine]={match:Ge(d),order:Re.HIGH,parse:_e,render:function(e,n,t){return P(\"br\",{key:t.key})}},j[r.breakThematic]={match:Te(p),order:Re.HIGH,parse:_e,render:function(e,n,t){return P(\"hr\",{key:t.key})}},j[r.codeBlock]={match:Te(g),order:Re.MAX,parse:function(e){return{lang:void 0,text:e[0].replace(/^ {4}/gm,\"\").replace(/\\n+$/,\"\")}},render:function(e,t,r){return P(\"pre\",{key:r.key},P(\"code\",n({},e.attrs,{className:e.lang?\"lang-\"+e.lang:\"\"}),e.text))}},j[r.codeFenced]={match:Te(m),order:Re.MAX,parse:function(e){return{attrs:q(e[3]||\"\"),lang:e[2]||void 0,text:e[4],type:r.codeBlock}}},j[r.codeInline]={match:we(h),order:Re.LOW,parse:function(e){return{text:e[2]}},render:function(e,n,t){return P(\"code\",{key:t.key},e.text)}},j[r.footnote]={match:Te(v),order:Re.MAX,parse:function(e){return re.push({footnote:e[2],identifier:e[1]}),{}},render:Ne},j[r.footnoteReference]={match:Ee(x),order:Re.HIGH,parse:function(e){return{target:\"#\"+u.slugify(e[1]),text:e[1]}},render:function(e,n,t){return P(\"a\",{key:t.key,href:ze(e.target)},P(\"sup\",{key:t.key},e.text))}},j[r.gfmTask]={match:Ee(H),order:Re.HIGH,parse:function(e){return{_completed:\"x\"===e[1].toLowerCase()}},render:function(e,n,t){return P(\"input\",{checked:e._completed,key:t.key,readOnly:!0,type:\"checkbox\"})}},j[r.heading]={match:Te(u.enforceAtxHeadings?I:A),order:Re.HIGH,parse:function(e,n,t){return{content:We(n,e[2],t),_id:u.slugify(e[2]),level:e[1].length}},render:function(e,n,t){return P(\"h\"+e.level,{id:e._id,key:t.key},n(e.content,t))}},j[r.headingSetext]={match:Te(S),order:Re.MAX,parse:function(e,n,t){return{content:We(n,e[1],t),level:\"=\"===e[2]?1:2,type:r.heading}}},j[r.htmlComment]={match:Ge(O),order:Re.HIGH,parse:function(){return{}},render:Ne},j[r.image]={match:we(He),order:Re.HIGH,parse:function(e){return{alt:e[1],target:Be(e[2]),title:e[3]}},render:function(e,n,t){return P(\"img\",{key:t.key,alt:e.alt||void 0,title:e.title||void 0,src:ze(e.target)})}},j[r.link]={match:Ee(be),order:Re.LOW,parse:function(e,n,t){return{content:Xe(n,e[1],t),target:Be(e[2]),title:e[3]}},render:function(e,n,t){return P(\"a\",{key:t.key,href:ze(e.target),title:e.title},n(e.content,t))}},j[r.linkAngleBraceStyleDetector]={match:Ee($),order:Re.MAX,parse:function(e){return{content:[{text:e[1],type:r.text}],target:e[1],type:r.link}}},j[r.linkBareUrlDetector]={match:function(e,n){return n.inAnchor?null:Ee(T)(e,n)},order:Re.MAX,parse:function(e){return{content:[{text:e[1],type:r.text}],target:e[1],title:void 0,type:r.link}}},j[r.linkMailtoDetector]={match:Ee(G),order:Re.MAX,parse:function(e){var n=e[1],t=e[1];return l.test(t)||(t=\"mailto:\"+t),{content:[{text:n.replace(\"mailto:\",\"\"),type:r.text}],target:t,type:r.link}}},j[r.orderedList]=xe(P,1),j[r.unorderedList]=xe(P,2),j[r.newlineCoalescer]={match:Te(y),order:Re.LOW,parse:_e,render:function(){return\"\\n\"}},j[r.paragraph]={match:$e,order:Re.LOW,parse:Ue,render:function(e,n,t){return P(\"p\",{key:t.key},n(e.content,t))}},j[r.ref]={match:Ee(W),order:Re.MAX,parse:function(e){return ae[e[1]]={target:e[2],title:e[4]},{}},render:Ne},j[r.refImage]={match:we(X),order:Re.MAX,parse:function(e){return{alt:e[1]||void 0,ref:e[2]}},render:function(e,n,t){return P(\"img\",{key:t.key,alt:e.alt,src:ze(ae[e.ref].target),title:ae[e.ref].title})}},j[r.refLink]={match:Ee(D),order:Re.MAX,parse:function(e,n,t){return{content:n(e[1],t),fallbackContent:n(e[0].replace(R,\"\\\\$1\"),t),ref:e[2]}},render:function(e,n,t){return ae[e.ref]?P(\"a\",{key:t.key,href:ze(ae[e.ref].target),title:ae[e.ref].title},n(e.content,t)):P(\"span\",{key:t.key},n(e.fallbackContent,t))}},j[r.table]={match:Te(B),order:Re.HIGH,parse:Oe,render:function(e,n,t){return P(\"table\",{key:t.key},P(\"thead\",null,P(\"tr\",null,e.header.map(function(r,a){return P(\"th\",{key:a,style:Ce(e,a)},n(r,t))}))),P(\"tbody\",null,e.cells.map(function(r,a){return P(\"tr\",{key:a},r.map(function(r,a){return P(\"td\",{key:a,style:Ce(e,a)},n(r,t))}))})))}},j[r.tableSeparator]={match:function(e,n){return n.inTable?(n.inline=!0,N.exec(e)):null},order:Re.HIGH,parse:function(){return{type:r.tableSeparator}},render:function(){return\" | \"}},j[r.text]={match:Ge(ee),order:Re.MIN,parse:function(e){return{text:e[0].replace(L,function(e,n){return u.namedCodesToUnicode[n]?u.namedCodesToUnicode[n]:e})}},render:function(e){return e.text}},j[r.textBolded]={match:we(Q),order:Re.MED,parse:function(e,n,t){return{content:n(e[2],t)}},render:function(e,n,t){return P(\"strong\",{key:t.key},n(e.content,t))}},j[r.textEmphasized]={match:we(V),order:Re.LOW,parse:function(e,n,t){return{content:n(e[2],t)}},render:function(e,n,t){return P(\"em\",{key:t.key},n(e.content,t))}},j[r.textEscaped]={match:we(Y),order:Re.HIGH,parse:function(e){return{text:e[1],type:r.text}}},j[r.textMarked]={match:we(J),order:Re.LOW,parse:Ue,render:function(e,n,t){return P(\"mark\",{key:t.key},n(e.content,t))}},j[r.textStrikethroughed]={match:we(K),order:Re.LOW,parse:Ue,render:function(e,n,t){return P(\"del\",{key:t.key},n(e.content,t))}},j);!0!==u.disableParsingRawHTML&&(ie[r.htmlBlock]={match:Ge(M),order:Re.HIGH,parse:function(e,n,t){var r,a=e[3].match(te),i=new RegExp(\"^\"+a[1],\"gm\"),c=e[3].replace(i,\"\"),l=(r=c,Ie.some(function(e){return e.test(r)})?De:We),u=e[1].toLowerCase(),s=-1!==o.indexOf(u),f={attrs:q(e[2]),noInnerParse:s,tag:s?u:e[1]};return t.inAnchor=t.inAnchor||\"a\"===u,s?f.text=e[3]:f.content=l(n,c,t),t.inAnchor=!1,f},render:function(e,t,r){return P(e.tag,n({key:r.key},e.attrs),e.text||t(e.content,r))}},ie[r.htmlSelfClosing]={match:Ge(E),order:Re.HIGH,parse:function(e){return{attrs:q(e[2]||\"\"),tag:e[1]}},render:function(e,t,r){return P(e.tag,n({},e.attrs,{key:r.key}))}});var oe,ce=function(e){var n=Object.keys(e);function t(r,a){for(var i=[],o=\"\";r;)for(var c=0;c=0||(a[t]=e[t]);return a}(n,t);return e.cloneElement(Ze(r,a),i)}export{r as RuleType,Ze as compiler};\n//# sourceMappingURL=index.module.js.map\n","/* @jsx React.createElement */\nimport * as React from 'react'\nimport * as ReactDOM from 'react-dom'\nimport styled, { createGlobalStyle, css, CSSProp } from 'styled-components'\nimport TeX from '@matejmazur/react-katex'\nimport Markdown, { MarkdownToJSX, RuleType } from './'\n\ndeclare module 'react' {\n interface Attributes {\n css?: CSSProp\n }\n}\n\nfunction TryItLive() {\n const [markdown, setMarkdown] = React.useState(\n document.getElementById('sample-content')!.textContent!.trim()\n )\n\n const handleInput = React.useCallback(e => setMarkdown(e.target.value), [])\n\n return (\n
\n \n\n
\n \n \"markdown-to-jsx\n \n\n \n

\n markdown-to-jsx is an easy-to-use markdown component\n that takes Github-flavored Markdown (GFM) and makes native JSX\n without dangerous hacks. \n

\n

\n It's lightweight, customizable, and happily supports React-like\n libraries.\n

\n
\n\n \n See the{' '}\n \n project README\n {' '}\n for detailed installation & usage instructions.\n \n
\n\n \n