markdown-to-jsx
Advanced tools
Comparing version 7.4.0 to 7.4.1
@@ -7,8 +7,6 @@ /// <reference types="react" /> | ||
options?: Partial<{ | ||
createElement: (tag: string | import("react").FunctionComponent<{}> | import("react").ComponentClass<{}, any>, props: JSX.IntrinsicAttributes, ...children: import("react").ReactChild[]) => import("react").ReactChild; | ||
createElement: (tag: string | import("react").FunctionComponent<{}> | import("react").ComponentClass<{}, any>, props: JSX.IntrinsicAttributes, ...children: import("react").ReactChild[]) => JSX.Element; | ||
disableParsingRawHTML: boolean; | ||
enforceAtxHeadings: boolean; | ||
forceBlock: boolean; | ||
forceInline: boolean; | ||
forceWrapper: boolean; | ||
namedCodesToUnicode: { | ||
@@ -18,5 +16,6 @@ [key: string]: string; | ||
overrides: import("./").MarkdownToJSX.Overrides; | ||
renderRule: (defaultOutput: () => import("react").ReactChild, node: import("./").MarkdownToJSX.ParserResult, renderAST: import("./").MarkdownToJSX.RuleOutput, state: import("./").MarkdownToJSX.State) => import("react").ReactChild; | ||
wrapper: import("react").ElementType<any>; | ||
forceWrapper: boolean; | ||
slugify: (source: string) => string; | ||
wrapper: import("react").ElementType<any>; | ||
enforceAtxHeadings: boolean; | ||
}>; | ||
@@ -23,0 +22,0 @@ }> & { |
@@ -348,3 +348,3 @@ /** | ||
* ``` | ||
* renderRule(next, node, output, state) { | ||
* renderRule(next, node, renderChildren, state) { | ||
* if (node.type === RuleType.codeBlock && node.lang === 'latex') { | ||
@@ -368,3 +368,9 @@ * return ( | ||
/** Resume normal processing, call this function as a fallback if you are not returning custom JSX. */ | ||
next: () => React.ReactChild, node: ParserResult, renderAST: RuleOutput, state: State) => React.ReactChild; | ||
next: () => React.ReactChild, | ||
/** the current AST node, use `RuleType` against `node.type` for identification */ | ||
node: ParserResult, | ||
/** use as `renderChildren(node.children)` for block nodes */ | ||
renderChildren: RuleOutput, | ||
/** contains `key` which should be supplied to the topmost JSX element */ | ||
state: State) => React.ReactChild; | ||
/** | ||
@@ -371,0 +377,0 @@ * Override normalization of non-URI-safe characters for use in generating |
@@ -1,2 +0,2 @@ | ||
import*as e from"react";function n(){return n=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},n.apply(this,arguments)}const t=["children","options"];var r,i;!function(e){e.blockQuote="0",e.breakLine="1",e.breakThematic="2",e.codeBlock="3",e.codeFenced="4",e.codeInline="5",e.footnote="6",e.footnoteReference="7",e.gfmTask="8",e.heading="9",e.headingSetext="10",e.htmlBlock="11",e.htmlComment="12",e.htmlSelfClosing="13",e.image="14",e.link="15",e.linkAngleBraceStyleDetector="16",e.linkBareUrlDetector="17",e.linkMailtoDetector="18",e.newlineCoalescer="19",e.orderedList="20",e.paragraph="21",e.ref="22",e.refImage="23",e.refLink="24",e.table="25",e.tableSeparator="26",e.text="27",e.textBolded="28",e.textEmphasized="29",e.textEscaped="30",e.textMarked="31",e.textStrikethroughed="32",e.unorderedList="33"}(r||(r={})),function(e){e[e.MAX=0]="MAX",e[e.HIGH=1]="HIGH",e[e.MED=2]="MED",e[e.LOW=3]="LOW",e[e.MIN=4]="MIN"}(i||(i={}));const l=["allowFullScreen","allowTransparency","autoComplete","autoFocus","autoPlay","cellPadding","cellSpacing","charSet","className","classId","colSpan","contentEditable","contextMenu","crossOrigin","encType","formAction","formEncType","formMethod","formNoValidate","formTarget","frameBorder","hrefLang","inputMode","keyParams","keyType","marginHeight","marginWidth","maxLength","mediaGroup","minLength","noValidate","radioGroup","readOnly","rowSpan","spellCheck","srcDoc","srcLang","srcSet","tabIndex","useMap"].reduce((e,n)=>(e[n.toLowerCase()]=n,e),{for:"htmlFor"}),o={amp:"&",apos:"'",gt:">",lt:"<",nbsp:" ",quot:"“"},c=["style","script"],a=/([-A-Z0-9_:]+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|(?:\{((?:\\.|{[^}]*?}|[^}])*)\})))?/gi,s=/mailto:/i,d=/\n{2,}$/,u=/^( *>[^\n]+(\n[^\n]+)*\n*)+\n{2,}/,p=/^ *> ?/gm,f=/^ {2,}\n/,h=/^(?:( *[-*_])){3,} *(?:\n *)+\n/,m=/^\s*(`{3,}|~{3,}) *(\S+)?([^\n]*?)?\n([\s\S]+?)\s*\1 *(?:\n *)*\n?/,g=/^(?: {4}[^\n]+\n*)+(?:\n *)+\n?/,y=/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,k=/^(?:\n *)*\n/,x=/\r\n?/g,v=/^\[\^([^\]]+)](:.*)\n/,b=/^\[\^([^\]]+)]/,$=/\f/g,S=/^\s*?\[(x|\s)\]/,w=/^ *(#{1,6}) *([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,C=/^ *(#{1,6}) +([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,E=/^([^\n]+)\n *(=|-){3,} *(?:\n *)+\n/,A=/^ *(?!<[a-z][^ >/]* ?\/>)<([a-z][^ >/]*) ?([^>]*)\/{0}>\n?(\s*(?:<\1[^>]*?>[\s\S]*?<\/\1>|(?!<\1)[\s\S])*?)<\/\1>\n*/i,O=/&([a-z0-9]+|#[0-9]{1,6}|#x[0-9a-fA-F]{1,6});/gi,T=/^<!--[\s\S]*?(?:-->)/,L=/^(data|aria|x)-[a-z_][a-z\d_.-]*$/,z=/^ *<([a-z][a-z0-9:]*)(?:\s+((?:<.*?>|[^>])*))?\/?>(?!<\/\1>)(\s*\n)?/i,M=/^\{.*\}$/,I=/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,R=/^<([^ >]+@[^ >]+)>/,U=/^<([^ >]+:\/[^ >]+)>/,j=/-([a-z])?/gi,B=/^(.*\|?.*)\n *(\|? *[-:]+ *\|[-| :]*)\n((?:.*\|.*\n)*)\n?/,N=/^\[([^\]]*)\]:\s+<?([^\s>]+)>?\s*("([^"]*)")?/,H=/^!\[([^\]]*)\] ?\[([^\]]*)\]/,D=/^\[([^\]]*)\] ?\[([^\]]*)\]/,P=/(\[|\])/g,_=/(\n|^[-*]\s|^#|^ {2,}|^-{2,}|^>\s)/,F=/\t/g,W=/^ *\| */,G=/(^ *\||\| *$)/g,Z=/ *$/,q=/^ *:-+: *$/,V=/^ *:-+ *$/,X=/^ *-+: *$/,Q=/^([*_])\1((?:\[.*?\][([].*?[)\]]|<.*?>(?:.*?<.*?>)?|`.*?`|~+.*?~+|.)*?)\1\1(?!\1)/,J=/^([*_])((?:\[.*?\][([].*?[)\]]|<.*?>(?:.*?<.*?>)?|`.*?`|~+.*?~+|.)*?)\1(?!\1|\w)/,K=/^==((?:\[.*?\]|<.*?>(?:.*?<.*?>)?|`.*?`|.)*?)==/,Y=/^~~((?:\[.*?\]|<.*?>(?:.*?<.*?>)?|`.*?`|.)*?)~~/,ee=/^\\([^0-9A-Za-z\s])/,ne=/^[\s\S]+?(?=[^0-9A-Z\s\u00c0-\uffff&#;.()'"]|\d+\.|\n\n| {2,}\n|\w+:\S|$)/i,te=/^\n+/,re=/^([ \t]*)/,ie=/\\([^\\])/g,le=/ *\n+$/,oe=/(?:^|\n)( *)$/,ce="(?:\\d+\\.)",ae="(?:[*+-])";function se(e){return"( *)("+(1===e?ce:ae)+") +"}const de=se(1),ue=se(2);function pe(e){return new RegExp("^"+(1===e?de:ue))}const fe=pe(1),he=pe(2);function me(e){return new RegExp("^"+(1===e?de:ue)+"[^\\n]*(?:\\n(?!\\1"+(1===e?ce:ae)+" )[^\\n]*)*(\\n|$)","gm")}const ge=me(1),ye=me(2);function ke(e){const n=1===e?ce:ae;return new RegExp("^( *)("+n+") [\\s\\S]+?(?:\\n{2,}(?! )(?!\\1"+n+" (?!"+n+" ))\\n*|\\s*\\n*$)")}const xe=ke(1),ve=ke(2);function be(e,n){const t=1===n,r=t?xe:ve,i=t?ge:ye,l=t?fe:he;return{match(e,n,t){const i=oe.exec(t);return i&&(n.list||!n.inline&&!n.simple)?r.exec(e=i[1]+e):null},order:1,parse(e,n,r){const o=t?+e[2]:void 0,c=e[0].replace(d,"\n").match(i);let a=!1;return{items:c.map(function(e,t){const i=l.exec(e)[0].length,o=new RegExp("^ {1,"+i+"}","gm"),s=e.replace(o,"").replace(l,""),d=t===c.length-1,u=-1!==s.indexOf("\n\n")||d&&a;a=u;const p=r.inline,f=r.list;let h;r.list=!0,u?(r.inline=!1,h=s.replace(le,"\n\n")):(r.inline=!0,h=s.replace(le,""));const m=n(h,r);return r.inline=p,r.list=f,m}),ordered:t,start:o}},render:(n,t,r)=>e(n.ordered?"ol":"ul",{key:r.key,start:"20"===n.type?n.start:void 0},n.items.map(function(n,i){return e("li",{key:i},t(n,r))}))}}const $e=/^\[([^\]]*)]\( *((?:\([^)]*\)|[^() ])*) *"?([^)"]*)?"?\)/,Se=/^!\[([^\]]*)]\( *((?:\([^)]*\)|[^() ])*) *"?([^)"]*)?"?\)/,we=[u,m,g,w,E,C,T,B,ge,xe,ye,ve],Ce=[...we,/^[^\n]+(?: \n|\n{2,})/,A,z];function Ee(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 Ae(e){return X.test(e)?"right":q.test(e)?"center":V.test(e)?"left":null}function Oe(e,n,t){const r=t.inTable;t.inTable=!0;const i=n(e.trim(),t);t.inTable=r;let l=[[]];return i.forEach(function(e,n){"26"===e.type?0!==n&&n!==i.length-1&&l.push([]):("27"!==e.type||null!=i[n+1]&&"26"!==i[n+1].type||(e.text=e.text.replace(Z,"")),l[l.length-1].push(e))}),l}function Te(e,n,t){t.inline=!0;const r=Oe(e[1],n,t),i=e[2].replace(G,"").split("|").map(Ae),l=function(e,n,t){return e.trim().split("\n").map(function(e){return Oe(e,n,t)})}(e[3],n,t);return t.inline=!1,{align:i,cells:l,header:r,type:"25"}}function Le(e,n){return null==e.align[n]?{}:{textAlign:e.align[n]}}function ze(e){return function(n,t){return t.inline?e.exec(n):null}}function Me(e){return function(n,t){return t.inline||t.simple?e.exec(n):null}}function Ie(e){return function(n,t){return t.inline||t.simple?null:e.exec(n)}}function Re(e){return function(n){return e.exec(n)}}function Ue(e,n,t){if(n.inline||n.simple)return null;if(t&&!t.endsWith("\n"))return null;let r="";e.split("\n").every(e=>!we.some(n=>n.test(e))&&(r+=e+"\n",e.trim()));const i=r.trimEnd();return""==i?null:[r,i]}function je(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(ie,"$1")}function Ne(e,n,t){const r=t.inline||!1,i=t.simple||!1;t.inline=!0,t.simple=!0;const l=e(n,t);return t.inline=r,t.simple=i,l}function He(e,n,t){const r=t.inline||!1,i=t.simple||!1;t.inline=!1,t.simple=!0;const l=e(n,t);return t.inline=r,t.simple=i,l}function De(e,n,t){return t.inline=!1,e(n,t)}const Pe=(e,n,t)=>({children:Ne(n,e[1],t)});function _e(){return{}}function Fe(){return null}function We(...e){return e.filter(Boolean).join(" ")}function Ge(e,n,t){let r=e;const i=n.split(".");for(;i.length&&(r=r[i[0]],void 0!==r);)i.shift();return r||t}function Ze(t,r={}){r.overrides=r.overrides||{},r.slugify=r.slugify||Ee,r.namedCodesToUnicode=r.namedCodesToUnicode?n({},o,r.namedCodesToUnicode):o;const i=r.createElement||e.createElement;function d(e,t,...l){const o=Ge(r.overrides,`${e}.props`,{});return i(function(e,n){const t=Ge(n,e);return t?"function"==typeof t||"object"==typeof t&&"render"in t?t:Ge(n,`${e}.component`,e):e}(e,r.overrides),n({},t,o,{className:We(null==t?void 0:t.className,o.className)||void 0}),...l)}function G(n){let t=!1;r.forceInline?t=!0:r.forceBlock||(t=!1===_.test(n));const i=le(ie(t?n:`${n.trimEnd().replace(te,"")}\n\n`,{inline:t}));for(;"string"==typeof i[i.length-1]&&!i[i.length-1].trim();)i.pop();if(null===r.wrapper)return i;const l=r.wrapper||(t?"span":"div");let o;if(i.length>1||r.forceWrapper)o=i;else{if(1===i.length)return o=i[0],"string"==typeof o?d("span",{key:"outer"},o):o;o=null}return e.createElement(l,{key:"outer"},o)}function Z(n){const t=n.match(a);return t?t.reduce(function(n,t,r){const i=t.indexOf("=");if(-1!==i){const o=function(e){return-1!==e.indexOf("-")&&null===e.match(L)&&(e=e.replace(j,function(e,n){return n.toUpperCase()})),e}(t.slice(0,i)).trim(),c=function(e){const n=e[0];return('"'===n||"'"===n)&&e.length>=2&&e[e.length-1]===n?e.slice(1,-1):e}(t.slice(i+1).trim()),a=l[o]||o,s=n[a]=function(e,n){return"style"===e?n.split(/;\s?/).reduce(function(e,n){const t=n.slice(0,n.indexOf(":"));return e[t.replace(/(-[a-z])/g,e=>e[1].toUpperCase())]=n.slice(t.length+1).trim(),e},{}):"href"===e||"src"===e?je(n):(n.match(M)&&(n=n.slice(1,n.length-1)),"true"===n||"false"!==n&&n)}(o,c);"string"==typeof s&&(A.test(s)||z.test(s))&&(n[a]=e.cloneElement(G(s.trim()),{key:r}))}else"style"!==t&&(n[l[t]||t]=!0);return n},{}):null}const q=[],V={},X={0:{match:Ie(u),order:1,parse:(e,n,t)=>({children:n(e[0].replace(p,""),t)}),render:(e,n,t)=>d("blockquote",{key:t.key},n(e.children,t))},1:{match:Re(f),order:1,parse:_e,render:(e,n,t)=>d("br",{key:t.key})},2:{match:Ie(h),order:1,parse:_e,render:(e,n,t)=>d("hr",{key:t.key})},3:{match:Ie(g),order:0,parse:e=>({lang:void 0,text:e[0].replace(/^ {4}/gm,"").replace(/\n+$/,"")}),render:(e,t,r)=>d("pre",{key:r.key},d("code",n({},e.attrs,{className:e.lang?`lang-${e.lang}`:""}),e.text))},4:{match:Ie(m),order:0,parse:e=>({attrs:Z(e[3]||""),lang:e[2]||void 0,text:e[4],type:"3"})},5:{match:Me(y),order:3,parse:e=>({text:e[2]}),render:(e,n,t)=>d("code",{key:t.key},e.text)},6:{match:Ie(v),order:0,parse:e=>(q.push({footnote:e[2],identifier:e[1]}),{}),render:Fe},7:{match:ze(b),order:1,parse:e=>({target:`#${r.slugify(e[1])}`,text:e[1]}),render:(e,n,t)=>d("a",{key:t.key,href:je(e.target)},d("sup",{key:t.key},e.text))},8:{match:ze(S),order:1,parse:e=>({completed:"x"===e[1].toLowerCase()}),render:(e,n,t)=>d("input",{checked:e.completed,key:t.key,readOnly:!0,type:"checkbox"})},9:{match:Ie(r.enforceAtxHeadings?C:w),order:1,parse:(e,n,t)=>({children:Ne(n,e[2],t),id:r.slugify(e[2]),level:e[1].length}),render:(e,n,t)=>d(`h${e.level}`,{id:e.id,key:t.key},n(e.children,t))},10:{match:Ie(E),order:0,parse:(e,n,t)=>({children:Ne(n,e[1],t),level:"="===e[2]?1:2,type:"9"})},11:{match:Re(A),order:1,parse(e,n,t){const[,r]=e[3].match(re),i=new RegExp(`^${r}`,"gm"),l=e[3].replace(i,""),o=(a=l,Ce.some(e=>e.test(a))?De:Ne);var a;const s=e[1].toLowerCase(),d=-1!==c.indexOf(s),u={attrs:Z(e[2]),noInnerParse:d,tag:d?s:e[1]};return t.inAnchor=t.inAnchor||"a"===s,d?u.text=e[3]:u.children=o(n,l,t),t.inAnchor=!1,u},render:(e,t,r)=>d(e.tag,n({key:r.key},e.attrs),e.text||t(e.children,r))},13:{match:Re(z),order:1,parse:e=>({attrs:Z(e[2]||""),tag:e[1]}),render:(e,t,r)=>d(e.tag,n({},e.attrs,{key:r.key}))},12:{match:Re(T),order:1,parse:()=>({}),render:Fe},14:{match:Me(Se),order:1,parse:e=>({alt:e[1],target:Be(e[2]),title:e[3]}),render:(e,n,t)=>d("img",{key:t.key,alt:e.alt||void 0,title:e.title||void 0,src:je(e.target)})},15:{match:ze($e),order:3,parse:(e,n,t)=>({children:He(n,e[1],t),target:Be(e[2]),title:e[3]}),render:(e,n,t)=>d("a",{key:t.key,href:je(e.target),title:e.title},n(e.children,t))},16:{match:ze(U),order:0,parse:e=>({children:[{text:e[1],type:"27"}],target:e[1],type:"15"})},17:{match:(e,n)=>n.inAnchor?null:ze(I)(e,n),order:0,parse:e=>({children:[{text:e[1],type:"27"}],target:e[1],title:void 0,type:"15"})},18:{match:ze(R),order:0,parse(e){let n=e[1],t=e[1];return s.test(t)||(t="mailto:"+t),{children:[{text:n.replace("mailto:",""),type:"27"}],target:t,type:"15"}}},20:be(d,1),33:be(d,2),19:{match:Ie(k),order:3,parse:_e,render:()=>"\n"},21:{match:Ue,order:3,parse:Pe,render:(e,n,t)=>d("p",{key:t.key},n(e.children,t))},22:{match:ze(N),order:0,parse:e=>(V[e[1]]={target:e[2],title:e[4]},{}),render:Fe},23:{match:Me(H),order:0,parse:e=>({alt:e[1]||void 0,ref:e[2]}),render:(e,n,t)=>d("img",{key:t.key,alt:e.alt,src:je(V[e.ref].target),title:V[e.ref].title})},24:{match:ze(D),order:0,parse:(e,n,t)=>({children:n(e[1],t),fallbackChildren:n(e[0].replace(P,"\\$1"),t),ref:e[2]}),render:(e,n,t)=>V[e.ref]?d("a",{key:t.key,href:je(V[e.ref].target),title:V[e.ref].title},n(e.children,t)):d("span",{key:t.key},n(e.fallbackChildren,t))},25:{match:Ie(B),order:1,parse:Te,render:(e,n,t)=>d("table",{key:t.key},d("thead",null,d("tr",null,e.header.map(function(r,i){return d("th",{key:i,style:Le(e,i)},n(r,t))}))),d("tbody",null,e.cells.map(function(r,i){return d("tr",{key:i},r.map(function(r,i){return d("td",{key:i,style:Le(e,i)},n(r,t))}))})))},26:{match:function(e,n){return n.inTable?(n.inline=!0,W.exec(e)):null},order:1,parse:function(){return{type:"26"}},render:()=>" | "},27:{match:Re(ne),order:4,parse:e=>({text:e[0].replace(O,(e,n)=>r.namedCodesToUnicode[n]?r.namedCodesToUnicode[n]:e)}),render:e=>e.text},28:{match:Me(Q),order:2,parse:(e,n,t)=>({children:n(e[2],t)}),render:(e,n,t)=>d("strong",{key:t.key},n(e.children,t))},29:{match:Me(J),order:3,parse:(e,n,t)=>({children:n(e[2],t)}),render:(e,n,t)=>d("em",{key:t.key},n(e.children,t))},30:{match:Me(ee),order:1,parse:e=>({text:e[1],type:"27"})},31:{match:Me(K),order:3,parse:Pe,render:(e,n,t)=>d("mark",{key:t.key},n(e.children,t))},32:{match:Me(Y),order:3,parse:Pe,render:(e,n,t)=>d("del",{key:t.key},n(e.children,t))}};!0===r.disableParsingRawHTML&&(delete X[11],delete X[13]);const ie=function(e){let n=Object.keys(e);function t(r,i){let l=[],o="";for(;r;){let c=0;for(;c<n.length;){const a=n[c],s=e[a],d=s.match(r,i,o);if(d){const e=d[0];r=r.substring(e.length);const n=s.parse(d,t,i);null==n.type&&(n.type=a),l.push(n),o=e;break}c++}}return l}return n.sort(function(n,t){let r=e[n].order,i=e[t].order;return r!==i?r-i:1}),function(e,n){return t(function(e){return e.replace(x,"\n").replace($,"").replace(F," ")}(e),n)}}(X),le=(oe=function(e,n){return function(t,r,i){const l=e[t.type].render;return n?n(()=>l(t,r,i),t,r,i):l(t,r,i)}}(X,r.renderRule),function e(n,t={}){if(Array.isArray(n)){const r=t.key,i=[];let l=!1;for(let r=0;r<n.length;r++){t.key=r;const o=e(n[r],t),c="string"==typeof o;c&&l?i[i.length-1]+=o:null!==o&&i.push(o),l=c}return t.key=r,i}return oe(n,e,t)});var oe;const ce=G(t);return q.length?d("div",null,ce,d("footer",{key:"footer"},q.map(function(e){return d("div",{id:r.slugify(e.identifier),key:e.identifier},e.identifier,le(ie(e.footnote,{inline:!0})))}))):ce}export default n=>{let{children:r,options:i}=n,l=function(e,n){if(null==e)return{};var t,r,i={},l=Object.keys(e);for(r=0;r<l.length;r++)n.indexOf(t=l[r])>=0||(i[t]=e[t]);return i}(n,t);return e.cloneElement(Ze(r,i),l)};export{r as RuleType,Ze as compiler}; | ||
import*as e from"react";function n(){return n=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},n.apply(this,arguments)}const t=["children","options"];var r,i;!function(e){e.blockQuote="0",e.breakLine="1",e.breakThematic="2",e.codeBlock="3",e.codeFenced="4",e.codeInline="5",e.footnote="6",e.footnoteReference="7",e.gfmTask="8",e.heading="9",e.headingSetext="10",e.htmlBlock="11",e.htmlComment="12",e.htmlSelfClosing="13",e.image="14",e.link="15",e.linkAngleBraceStyleDetector="16",e.linkBareUrlDetector="17",e.linkMailtoDetector="18",e.newlineCoalescer="19",e.orderedList="20",e.paragraph="21",e.ref="22",e.refImage="23",e.refLink="24",e.table="25",e.tableSeparator="26",e.text="27",e.textBolded="28",e.textEmphasized="29",e.textEscaped="30",e.textMarked="31",e.textStrikethroughed="32",e.unorderedList="33"}(r||(r={})),function(e){e[e.MAX=0]="MAX",e[e.HIGH=1]="HIGH",e[e.MED=2]="MED",e[e.LOW=3]="LOW",e[e.MIN=4]="MIN"}(i||(i={}));const l=["allowFullScreen","allowTransparency","autoComplete","autoFocus","autoPlay","cellPadding","cellSpacing","charSet","className","classId","colSpan","contentEditable","contextMenu","crossOrigin","encType","formAction","formEncType","formMethod","formNoValidate","formTarget","frameBorder","hrefLang","inputMode","keyParams","keyType","marginHeight","marginWidth","maxLength","mediaGroup","minLength","noValidate","radioGroup","readOnly","rowSpan","spellCheck","srcDoc","srcLang","srcSet","tabIndex","useMap"].reduce((e,n)=>(e[n.toLowerCase()]=n,e),{for:"htmlFor"}),o={amp:"&",apos:"'",gt:">",lt:"<",nbsp:" ",quot:"“"},c=["style","script"],a=/([-A-Z0-9_:]+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|(?:\{((?:\\.|{[^}]*?}|[^}])*)\})))?/gi,s=/mailto:/i,d=/\n{2,}$/,u=/^( *>[^\n]+(\n[^\n]+)*\n*)+\n{2,}/,p=/^ *> ?/gm,f=/^ {2,}\n/,h=/^(?:( *[-*_])){3,} *(?:\n *)+\n/,m=/^\s*(`{3,}|~{3,}) *(\S+)?([^\n]*?)?\n([\s\S]+?)\s*\1 *(?:\n *)*\n?/,g=/^(?: {4}[^\n]+\n*)+(?:\n *)+\n?/,y=/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,k=/^(?:\n *)*\n/,x=/\r\n?/g,v=/^\[\^([^\]]+)](:.*)\n/,b=/^\[\^([^\]]+)]/,$=/\f/g,S=/^---[ \t]*\n(.|\n)*\n---[ \t]*\n/,w=/^\s*?\[(x|\s)\]/,C=/^ *(#{1,6}) *([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,E=/^ *(#{1,6}) +([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,A=/^([^\n]+)\n *(=|-){3,} *(?:\n *)+\n/,O=/^ *(?!<[a-z][^ >/]* ?\/>)<([a-z][^ >/]*) ?([^>]*)\/{0}>\n?(\s*(?:<\1[^>]*?>[\s\S]*?<\/\1>|(?!<\1)[\s\S])*?)<\/\1>\n*/i,T=/&([a-z0-9]+|#[0-9]{1,6}|#x[0-9a-fA-F]{1,6});/gi,L=/^<!--[\s\S]*?(?:-->)/,z=/^(data|aria|x)-[a-z_][a-z\d_.-]*$/,M=/^ *<([a-z][a-z0-9:]*)(?:\s+((?:<.*?>|[^>])*))?\/?>(?!<\/\1>)(\s*\n)?/i,I=/^\{.*\}$/,R=/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,U=/^<([^ >]+@[^ >]+)>/,j=/^<([^ >]+:\/[^ >]+)>/,B=/-([a-z])?/gi,N=/^(.*\|?.*)\n *(\|? *[-:]+ *\|[-| :]*)\n((?:.*\|.*\n)*)\n?/,H=/^\[([^\]]*)\]:\s+<?([^\s>]+)>?\s*("([^"]*)")?/,D=/^!\[([^\]]*)\] ?\[([^\]]*)\]/,P=/^\[([^\]]*)\] ?\[([^\]]*)\]/,_=/(\[|\])/g,F=/(\n|^[-*]\s|^#|^ {2,}|^-{2,}|^>\s)/,W=/\t/g,G=/^ *\| */,Z=/(^ *\||\| *$)/g,q=/ *$/,V=/^ *:-+: *$/,X=/^ *:-+ *$/,Q=/^ *-+: *$/,J=/^([*_])\1((?:\[.*?\][([].*?[)\]]|<.*?>(?:.*?<.*?>)?|`.*?`|~+.*?~+|.)*?)\1\1(?!\1)/,K=/^([*_])((?:\[.*?\][([].*?[)\]]|<.*?>(?:.*?<.*?>)?|`.*?`|~+.*?~+|.)*?)\1(?!\1|\w)/,Y=/^==((?:\[.*?\]|<.*?>(?:.*?<.*?>)?|`.*?`|.)*?)==/,ee=/^~~((?:\[.*?\]|<.*?>(?:.*?<.*?>)?|`.*?`|.)*?)~~/,ne=/^\\([^0-9A-Za-z\s])/,te=/^[\s\S]+?(?=[^0-9A-Z\s\u00c0-\uffff&#;.()'"]|\d+\.|\n\n| {2,}\n|\w+:\S|$)/i,re=/^\n+/,ie=/^([ \t]*)/,le=/\\([^\\])/g,oe=/ *\n+$/,ce=/(?:^|\n)( *)$/,ae="(?:\\d+\\.)",se="(?:[*+-])";function de(e){return"( *)("+(1===e?ae:se)+") +"}const ue=de(1),pe=de(2);function fe(e){return new RegExp("^"+(1===e?ue:pe))}const he=fe(1),me=fe(2);function ge(e){return new RegExp("^"+(1===e?ue:pe)+"[^\\n]*(?:\\n(?!\\1"+(1===e?ae:se)+" )[^\\n]*)*(\\n|$)","gm")}const ye=ge(1),ke=ge(2);function xe(e){const n=1===e?ae:se;return new RegExp("^( *)("+n+") [\\s\\S]+?(?:\\n{2,}(?! )(?!\\1"+n+" (?!"+n+" ))\\n*|\\s*\\n*$)")}const ve=xe(1),be=xe(2);function $e(e,n){const t=1===n,r=t?ve:be,i=t?ye:ke,l=t?he:me;return{match(e,n,t){const i=ce.exec(t);return i&&(n.list||!n.inline&&!n.simple)?r.exec(e=i[1]+e):null},order:1,parse(e,n,r){const o=t?+e[2]:void 0,c=e[0].replace(d,"\n").match(i);let a=!1;return{items:c.map(function(e,t){const i=l.exec(e)[0].length,o=new RegExp("^ {1,"+i+"}","gm"),s=e.replace(o,"").replace(l,""),d=t===c.length-1,u=-1!==s.indexOf("\n\n")||d&&a;a=u;const p=r.inline,f=r.list;let h;r.list=!0,u?(r.inline=!1,h=s.replace(oe,"\n\n")):(r.inline=!0,h=s.replace(oe,""));const m=n(h,r);return r.inline=p,r.list=f,m}),ordered:t,start:o}},render:(n,t,r)=>e(n.ordered?"ol":"ul",{key:r.key,start:"20"===n.type?n.start:void 0},n.items.map(function(n,i){return e("li",{key:i},t(n,r))}))}}const Se=/^\[([^\]]*)]\( *((?:\([^)]*\)|[^() ])*) *"?([^)"]*)?"?\)/,we=/^!\[([^\]]*)]\( *((?:\([^)]*\)|[^() ])*) *"?([^)"]*)?"?\)/,Ce=[u,m,g,C,A,E,L,N,ye,ve,ke,be],Ee=[...Ce,/^[^\n]+(?: \n|\n{2,})/,O,M];function Ae(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 Oe(e){return Q.test(e)?"right":V.test(e)?"center":X.test(e)?"left":null}function Te(e,n,t){const r=t.inTable;t.inTable=!0;const i=n(e.trim(),t);t.inTable=r;let l=[[]];return i.forEach(function(e,n){"26"===e.type?0!==n&&n!==i.length-1&&l.push([]):("27"!==e.type||null!=i[n+1]&&"26"!==i[n+1].type||(e.text=e.text.replace(q,"")),l[l.length-1].push(e))}),l}function Le(e,n,t){t.inline=!0;const r=Te(e[1],n,t),i=e[2].replace(Z,"").split("|").map(Oe),l=function(e,n,t){return e.trim().split("\n").map(function(e){return Te(e,n,t)})}(e[3],n,t);return t.inline=!1,{align:i,cells:l,header:r,type:"25"}}function ze(e,n){return null==e.align[n]?{}:{textAlign:e.align[n]}}function Me(e){return function(n,t){return t.inline?e.exec(n):null}}function Ie(e){return function(n,t){return t.inline||t.simple?e.exec(n):null}}function Re(e){return function(n,t){return t.inline||t.simple?null:e.exec(n)}}function Ue(e){return function(n){return e.exec(n)}}function je(e,n,t){if(n.inline||n.simple)return null;if(t&&!t.endsWith("\n"))return null;let r="";e.split("\n").every(e=>!Ce.some(n=>n.test(e))&&(r+=e+"\n",e.trim()));const i=r.trimEnd();return""==i?null:[r,i]}function Be(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 Ne(e){return e.replace(le,"$1")}function He(e,n,t){const r=t.inline||!1,i=t.simple||!1;t.inline=!0,t.simple=!0;const l=e(n,t);return t.inline=r,t.simple=i,l}function De(e,n,t){const r=t.inline||!1,i=t.simple||!1;t.inline=!1,t.simple=!0;const l=e(n,t);return t.inline=r,t.simple=i,l}function Pe(e,n,t){return t.inline=!1,e(n,t)}const _e=(e,n,t)=>({children:He(n,e[1],t)});function Fe(){return{}}function We(){return null}function Ge(...e){return e.filter(Boolean).join(" ")}function Ze(e,n,t){let r=e;const i=n.split(".");for(;i.length&&(r=r[i[0]],void 0!==r);)i.shift();return r||t}function qe(t,r={}){r.overrides=r.overrides||{},r.slugify=r.slugify||Ae,r.namedCodesToUnicode=r.namedCodesToUnicode?n({},o,r.namedCodesToUnicode):o;const i=r.createElement||e.createElement;function d(e,t,...l){const o=Ze(r.overrides,`${e}.props`,{});return i(function(e,n){const t=Ze(n,e);return t?"function"==typeof t||"object"==typeof t&&"render"in t?t:Ze(n,`${e}.component`,e):e}(e,r.overrides),n({},t,o,{className:Ge(null==t?void 0:t.className,o.className)||void 0}),...l)}function Z(n){n=n.replace(S,"");let t=!1;r.forceInline?t=!0:r.forceBlock||(t=!1===F.test(n));const i=oe(le(t?n:`${n.trimEnd().replace(re,"")}\n\n`,{inline:t}));for(;"string"==typeof i[i.length-1]&&!i[i.length-1].trim();)i.pop();if(null===r.wrapper)return i;const l=r.wrapper||(t?"span":"div");let o;if(i.length>1||r.forceWrapper)o=i;else{if(1===i.length)return o=i[0],"string"==typeof o?d("span",{key:"outer"},o):o;o=null}return e.createElement(l,{key:"outer"},o)}function q(n){const t=n.match(a);return t?t.reduce(function(n,t,r){const i=t.indexOf("=");if(-1!==i){const o=function(e){return-1!==e.indexOf("-")&&null===e.match(z)&&(e=e.replace(B,function(e,n){return n.toUpperCase()})),e}(t.slice(0,i)).trim(),c=function(e){const n=e[0];return('"'===n||"'"===n)&&e.length>=2&&e[e.length-1]===n?e.slice(1,-1):e}(t.slice(i+1).trim()),a=l[o]||o,s=n[a]=function(e,n){return"style"===e?n.split(/;\s?/).reduce(function(e,n){const t=n.slice(0,n.indexOf(":"));return e[t.replace(/(-[a-z])/g,e=>e[1].toUpperCase())]=n.slice(t.length+1).trim(),e},{}):"href"===e||"src"===e?Be(n):(n.match(I)&&(n=n.slice(1,n.length-1)),"true"===n||"false"!==n&&n)}(o,c);"string"==typeof s&&(O.test(s)||M.test(s))&&(n[a]=e.cloneElement(Z(s.trim()),{key:r}))}else"style"!==t&&(n[l[t]||t]=!0);return n},{}):null}const V=[],X={},Q={0:{match:Re(u),order:1,parse:(e,n,t)=>({children:n(e[0].replace(p,""),t)}),render:(e,n,t)=>d("blockquote",{key:t.key},n(e.children,t))},1:{match:Ue(f),order:1,parse:Fe,render:(e,n,t)=>d("br",{key:t.key})},2:{match:Re(h),order:1,parse:Fe,render:(e,n,t)=>d("hr",{key:t.key})},3:{match:Re(g),order:0,parse:e=>({lang:void 0,text:e[0].replace(/^ {4}/gm,"").replace(/\n+$/,"")}),render:(e,t,r)=>d("pre",{key:r.key},d("code",n({},e.attrs,{className:e.lang?`lang-${e.lang}`:""}),e.text))},4:{match:Re(m),order:0,parse:e=>({attrs:q(e[3]||""),lang:e[2]||void 0,text:e[4],type:"3"})},5:{match:Ie(y),order:3,parse:e=>({text:e[2]}),render:(e,n,t)=>d("code",{key:t.key},e.text)},6:{match:Re(v),order:0,parse:e=>(V.push({footnote:e[2],identifier:e[1]}),{}),render:We},7:{match:Me(b),order:1,parse:e=>({target:`#${r.slugify(e[1])}`,text:e[1]}),render:(e,n,t)=>d("a",{key:t.key,href:Be(e.target)},d("sup",{key:t.key},e.text))},8:{match:Me(w),order:1,parse:e=>({completed:"x"===e[1].toLowerCase()}),render:(e,n,t)=>d("input",{checked:e.completed,key:t.key,readOnly:!0,type:"checkbox"})},9:{match:Re(r.enforceAtxHeadings?E:C),order:1,parse:(e,n,t)=>({children:He(n,e[2],t),id:r.slugify(e[2]),level:e[1].length}),render:(e,n,t)=>d(`h${e.level}`,{id:e.id,key:t.key},n(e.children,t))},10:{match:Re(A),order:0,parse:(e,n,t)=>({children:He(n,e[1],t),level:"="===e[2]?1:2,type:"9"})},11:{match:Ue(O),order:1,parse(e,n,t){const[,r]=e[3].match(ie),i=new RegExp(`^${r}`,"gm"),l=e[3].replace(i,""),o=(a=l,Ee.some(e=>e.test(a))?Pe:He);var a;const s=e[1].toLowerCase(),d=-1!==c.indexOf(s),u={attrs:q(e[2]),noInnerParse:d,tag:d?s:e[1]};return t.inAnchor=t.inAnchor||"a"===s,d?u.text=e[3]:u.children=o(n,l,t),t.inAnchor=!1,u},render:(e,t,r)=>d(e.tag,n({key:r.key},e.attrs),e.text||t(e.children,r))},13:{match:Ue(M),order:1,parse:e=>({attrs:q(e[2]||""),tag:e[1]}),render:(e,t,r)=>d(e.tag,n({},e.attrs,{key:r.key}))},12:{match:Ue(L),order:1,parse:()=>({}),render:We},14:{match:Ie(we),order:1,parse:e=>({alt:e[1],target:Ne(e[2]),title:e[3]}),render:(e,n,t)=>d("img",{key:t.key,alt:e.alt||void 0,title:e.title||void 0,src:Be(e.target)})},15:{match:Me(Se),order:3,parse:(e,n,t)=>({children:De(n,e[1],t),target:Ne(e[2]),title:e[3]}),render:(e,n,t)=>d("a",{key:t.key,href:Be(e.target),title:e.title},n(e.children,t))},16:{match:Me(j),order:0,parse:e=>({children:[{text:e[1],type:"27"}],target:e[1],type:"15"})},17:{match:(e,n)=>n.inAnchor?null:Me(R)(e,n),order:0,parse:e=>({children:[{text:e[1],type:"27"}],target:e[1],title:void 0,type:"15"})},18:{match:Me(U),order:0,parse(e){let n=e[1],t=e[1];return s.test(t)||(t="mailto:"+t),{children:[{text:n.replace("mailto:",""),type:"27"}],target:t,type:"15"}}},20:$e(d,1),33:$e(d,2),19:{match:Re(k),order:3,parse:Fe,render:()=>"\n"},21:{match:je,order:3,parse:_e,render:(e,n,t)=>d("p",{key:t.key},n(e.children,t))},22:{match:Me(H),order:0,parse:e=>(X[e[1]]={target:e[2],title:e[4]},{}),render:We},23:{match:Ie(D),order:0,parse:e=>({alt:e[1]||void 0,ref:e[2]}),render:(e,n,t)=>d("img",{key:t.key,alt:e.alt,src:Be(X[e.ref].target),title:X[e.ref].title})},24:{match:Me(P),order:0,parse:(e,n,t)=>({children:n(e[1],t),fallbackChildren:n(e[0].replace(_,"\\$1"),t),ref:e[2]}),render:(e,n,t)=>X[e.ref]?d("a",{key:t.key,href:Be(X[e.ref].target),title:X[e.ref].title},n(e.children,t)):d("span",{key:t.key},n(e.fallbackChildren,t))},25:{match:Re(N),order:1,parse:Le,render:(e,n,t)=>d("table",{key:t.key},d("thead",null,d("tr",null,e.header.map(function(r,i){return d("th",{key:i,style:ze(e,i)},n(r,t))}))),d("tbody",null,e.cells.map(function(r,i){return d("tr",{key:i},r.map(function(r,i){return d("td",{key:i,style:ze(e,i)},n(r,t))}))})))},26:{match:function(e,n){return n.inTable?(n.inline=!0,G.exec(e)):null},order:1,parse:function(){return{type:"26"}},render:()=>" | "},27:{match:Ue(te),order:4,parse:e=>({text:e[0].replace(T,(e,n)=>r.namedCodesToUnicode[n]?r.namedCodesToUnicode[n]:e)}),render:e=>e.text},28:{match:Ie(J),order:2,parse:(e,n,t)=>({children:n(e[2],t)}),render:(e,n,t)=>d("strong",{key:t.key},n(e.children,t))},29:{match:Ie(K),order:3,parse:(e,n,t)=>({children:n(e[2],t)}),render:(e,n,t)=>d("em",{key:t.key},n(e.children,t))},30:{match:Ie(ne),order:1,parse:e=>({text:e[1],type:"27"})},31:{match:Ie(Y),order:3,parse:_e,render:(e,n,t)=>d("mark",{key:t.key},n(e.children,t))},32:{match:Ie(ee),order:3,parse:_e,render:(e,n,t)=>d("del",{key:t.key},n(e.children,t))}};!0===r.disableParsingRawHTML&&(delete Q[11],delete Q[13]);const le=function(e){let n=Object.keys(e);function t(r,i){let l=[],o="";for(;r;){let c=0;for(;c<n.length;){const a=n[c],s=e[a],d=s.match(r,i,o);if(d){const e=d[0];r=r.substring(e.length);const n=s.parse(d,t,i);null==n.type&&(n.type=a),l.push(n),o=e;break}c++}}return l}return n.sort(function(n,t){let r=e[n].order,i=e[t].order;return r!==i?r-i:1}),function(e,n){return t(function(e){return e.replace(x,"\n").replace($,"").replace(W," ")}(e),n)}}(Q),oe=(ce=function(e,n){return function(t,r,i){const l=e[t.type].render;return n?n(()=>l(t,r,i),t,r,i):l(t,r,i)}}(Q,r.renderRule),function e(n,t={}){if(Array.isArray(n)){const r=t.key,i=[];let l=!1;for(let r=0;r<n.length;r++){t.key=r;const o=e(n[r],t),c="string"==typeof o;c&&l?i[i.length-1]+=o:null!==o&&i.push(o),l=c}return t.key=r,i}return ce(n,e,t)});var ce;const ae=Z(t);return V.length?d("div",null,ae,d("footer",{key:"footer"},V.map(function(e){return d("div",{id:r.slugify(e.identifier),key:e.identifier},e.identifier,oe(le(e.footnote,{inline:!0})))}))):ae}export default n=>{let{children:r,options:i}=n,l=function(e,n){if(null==e)return{};var t,r,i={},l=Object.keys(e);for(r=0;r<l.length;r++)n.indexOf(t=l[r])>=0||(i[t]=e[t]);return i}(n,t);return e.cloneElement(qe(r,i),l)};export{r as RuleType,qe as compiler}; | ||
//# sourceMappingURL=index.modern.js.map |
@@ -1,2 +0,2 @@ | ||
import*as e from"react";function r(){return r=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])}return e},r.apply(this,arguments)}var n,t,i=["children","options"];!function(e){e.blockQuote="0",e.breakLine="1",e.breakThematic="2",e.codeBlock="3",e.codeFenced="4",e.codeInline="5",e.footnote="6",e.footnoteReference="7",e.gfmTask="8",e.heading="9",e.headingSetext="10",e.htmlBlock="11",e.htmlComment="12",e.htmlSelfClosing="13",e.image="14",e.link="15",e.linkAngleBraceStyleDetector="16",e.linkBareUrlDetector="17",e.linkMailtoDetector="18",e.newlineCoalescer="19",e.orderedList="20",e.paragraph="21",e.ref="22",e.refImage="23",e.refLink="24",e.table="25",e.tableSeparator="26",e.text="27",e.textBolded="28",e.textEmphasized="29",e.textEscaped="30",e.textMarked="31",e.textStrikethroughed="32",e.unorderedList="33"}(n||(n={})),function(e){e[e.MAX=0]="MAX",e[e.HIGH=1]="HIGH",e[e.MED=2]="MED",e[e.LOW=3]="LOW",e[e.MIN=4]="MIN"}(t||(t={}));var a=["allowFullScreen","allowTransparency","autoComplete","autoFocus","autoPlay","cellPadding","cellSpacing","charSet","className","classId","colSpan","contentEditable","contextMenu","crossOrigin","encType","formAction","formEncType","formMethod","formNoValidate","formTarget","frameBorder","hrefLang","inputMode","keyParams","keyType","marginHeight","marginWidth","maxLength","mediaGroup","minLength","noValidate","radioGroup","readOnly","rowSpan","spellCheck","srcDoc","srcLang","srcSet","tabIndex","useMap"].reduce(function(e,r){return e[r.toLowerCase()]=r,e},{for:"htmlFor"}),c={amp:"&",apos:"'",gt:">",lt:"<",nbsp:" ",quot:"“"},o=["style","script"],l=/([-A-Z0-9_:]+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|(?:\{((?:\\.|{[^}]*?}|[^}])*)\})))?/gi,u=/mailto:/i,s=/\n{2,}$/,f=/^( *>[^\n]+(\n[^\n]+)*\n*)+\n{2,}/,d=/^ *> ?/gm,p=/^ {2,}\n/,h=/^(?:( *[-*_])){3,} *(?:\n *)+\n/,m=/^\s*(`{3,}|~{3,}) *(\S+)?([^\n]*?)?\n([\s\S]+?)\s*\1 *(?:\n *)*\n?/,g=/^(?: {4}[^\n]+\n*)+(?:\n *)+\n?/,y=/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,k=/^(?:\n *)*\n/,v=/\r\n?/g,x=/^\[\^([^\]]+)](:.*)\n/,b=/^\[\^([^\]]+)]/,S=/\f/g,w=/^\s*?\[(x|\s)\]/,C=/^ *(#{1,6}) *([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,E=/^ *(#{1,6}) +([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,$=/^([^\n]+)\n *(=|-){3,} *(?:\n *)+\n/,A=/^ *(?!<[a-z][^ >/]* ?\/>)<([a-z][^ >/]*) ?([^>]*)\/{0}>\n?(\s*(?:<\1[^>]*?>[\s\S]*?<\/\1>|(?!<\1)[\s\S])*?)<\/\1>\n*/i,O=/&([a-z0-9]+|#[0-9]{1,6}|#x[0-9a-fA-F]{1,6});/gi,T=/^<!--[\s\S]*?(?:-->)/,L=/^(data|aria|x)-[a-z_][a-z\d_.-]*$/,z=/^ *<([a-z][a-z0-9:]*)(?:\s+((?:<.*?>|[^>])*))?\/?>(?!<\/\1>)(\s*\n)?/i,M=/^\{.*\}$/,I=/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,R=/^<([^ >]+@[^ >]+)>/,U=/^<([^ >]+:\/[^ >]+)>/,j=/-([a-z])?/gi,B=/^(.*\|?.*)\n *(\|? *[-:]+ *\|[-| :]*)\n((?:.*\|.*\n)*)\n?/,N=/^\[([^\]]*)\]:\s+<?([^\s>]+)>?\s*("([^"]*)")?/,H=/^!\[([^\]]*)\] ?\[([^\]]*)\]/,D=/^\[([^\]]*)\] ?\[([^\]]*)\]/,P=/(\[|\])/g,_=/(\n|^[-*]\s|^#|^ {2,}|^-{2,}|^>\s)/,F=/\t/g,W=/^ *\| */,G=/(^ *\||\| *$)/g,Z=/ *$/,q=/^ *:-+: *$/,V=/^ *:-+ *$/,X=/^ *-+: *$/,Q=/^([*_])\1((?:\[.*?\][([].*?[)\]]|<.*?>(?:.*?<.*?>)?|`.*?`|~+.*?~+|.)*?)\1\1(?!\1)/,J=/^([*_])((?:\[.*?\][([].*?[)\]]|<.*?>(?:.*?<.*?>)?|`.*?`|~+.*?~+|.)*?)\1(?!\1|\w)/,K=/^==((?:\[.*?\]|<.*?>(?:.*?<.*?>)?|`.*?`|.)*?)==/,Y=/^~~((?:\[.*?\]|<.*?>(?:.*?<.*?>)?|`.*?`|.)*?)~~/,ee=/^\\([^0-9A-Za-z\s])/,re=/^[\s\S]+?(?=[^0-9A-Z\s\u00c0-\uffff&#;.()'"]|\d+\.|\n\n| {2,}\n|\w+:\S|$)/i,ne=/^\n+/,te=/^([ \t]*)/,ie=/\\([^\\])/g,ae=/ *\n+$/,ce=/(?:^|\n)( *)$/,oe="(?:\\d+\\.)",le="(?:[*+-])";function ue(e){return"( *)("+(1===e?oe:le)+") +"}var se=ue(1),fe=ue(2);function de(e){return new RegExp("^"+(1===e?se:fe))}var pe=de(1),he=de(2);function me(e){return new RegExp("^"+(1===e?se:fe)+"[^\\n]*(?:\\n(?!\\1"+(1===e?oe:le)+" )[^\\n]*)*(\\n|$)","gm")}var ge=me(1),ye=me(2);function ke(e){var r=1===e?oe:le;return new RegExp("^( *)("+r+") [\\s\\S]+?(?:\\n{2,}(?! )(?!\\1"+r+" (?!"+r+" ))\\n*|\\s*\\n*$)")}var ve=ke(1),xe=ke(2);function be(e,r){var n=1===r,t=n?ve:xe,i=n?ge:ye,a=n?pe:he;return{match:function(e,r,n){var i=ce.exec(n);return i&&(r.list||!r.inline&&!r.simple)?t.exec(e=i[1]+e):null},order:1,parse:function(e,r,t){var c=n?+e[2]:void 0,o=e[0].replace(s,"\n").match(i),l=!1;return{items:o.map(function(e,n){var i=a.exec(e)[0].length,c=new RegExp("^ {1,"+i+"}","gm"),u=e.replace(c,"").replace(a,""),s=n===o.length-1,f=-1!==u.indexOf("\n\n")||s&&l;l=f;var d,p=t.inline,h=t.list;t.list=!0,f?(t.inline=!1,d=u.replace(ae,"\n\n")):(t.inline=!0,d=u.replace(ae,""));var m=r(d,t);return t.inline=p,t.list=h,m}),ordered:n,start:c}},render:function(r,n,t){return e(r.ordered?"ol":"ul",{key:t.key,start:"20"===r.type?r.start:void 0},r.items.map(function(r,i){return e("li",{key:i},n(r,t))}))}}}var Se=/^\[([^\]]*)]\( *((?:\([^)]*\)|[^() ])*) *"?([^)"]*)?"?\)/,we=/^!\[([^\]]*)]\( *((?:\([^)]*\)|[^() ])*) *"?([^)"]*)?"?\)/,Ce=[f,m,g,C,$,E,T,B,ge,ve,ye,xe],Ee=[].concat(Ce,[/^[^\n]+(?: \n|\n{2,})/,A,z]);function $e(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 Ae(e){return X.test(e)?"right":q.test(e)?"center":V.test(e)?"left":null}function Oe(e,r,n){var t=n.inTable;n.inTable=!0;var i=r(e.trim(),n);n.inTable=t;var a=[[]];return i.forEach(function(e,r){"26"===e.type?0!==r&&r!==i.length-1&&a.push([]):("27"!==e.type||null!=i[r+1]&&"26"!==i[r+1].type||(e.text=e.text.replace(Z,"")),a[a.length-1].push(e))}),a}function Te(e,r,n){n.inline=!0;var t=Oe(e[1],r,n),i=e[2].replace(G,"").split("|").map(Ae),a=function(e,r,n){return e.trim().split("\n").map(function(e){return Oe(e,r,n)})}(e[3],r,n);return n.inline=!1,{align:i,cells:a,header:t,type:"25"}}function Le(e,r){return null==e.align[r]?{}:{textAlign:e.align[r]}}function ze(e){return function(r,n){return n.inline?e.exec(r):null}}function Me(e){return function(r,n){return n.inline||n.simple?e.exec(r):null}}function Ie(e){return function(r,n){return n.inline||n.simple?null:e.exec(r)}}function Re(e){return function(r){return e.exec(r)}}function Ue(e,r,n){if(r.inline||r.simple)return null;if(n&&!n.endsWith("\n"))return null;var t="";e.split("\n").every(function(e){return!Ce.some(function(r){return r.test(e)})&&(t+=e+"\n",e.trim())});var i=t.trimEnd();return""==i?null:[t,i]}function je(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(ie,"$1")}function Ne(e,r,n){var t=n.inline||!1,i=n.simple||!1;n.inline=!0,n.simple=!0;var a=e(r,n);return n.inline=t,n.simple=i,a}function He(e,r,n){var t=n.inline||!1,i=n.simple||!1;n.inline=!1,n.simple=!0;var a=e(r,n);return n.inline=t,n.simple=i,a}function De(e,r,n){return n.inline=!1,e(r,n)}var Pe=function(e,r,n){return{children:Ne(r,e[1],n)}};function _e(){return{}}function Fe(){return null}function We(){return[].slice.call(arguments).filter(Boolean).join(" ")}function Ge(e,r,n){for(var t=e,i=r.split(".");i.length&&void 0!==(t=t[i[0]]);)i.shift();return t||n}function Ze(e,r){var n=Ge(r,e);return n?"function"==typeof n||"object"==typeof n&&"render"in n?n:Ge(r,e+".component",e):e}function qe(n,t){var i;void 0===t&&(t={}),t.overrides=t.overrides||{},t.slugify=t.slugify||$e,t.namedCodesToUnicode=t.namedCodesToUnicode?r({},c,t.namedCodesToUnicode):c;var s=t.createElement||e.createElement;function G(e,n){var i=Ge(t.overrides,e+".props",{});return s.apply(void 0,[Ze(e,t.overrides),r({},n,i,{className:We(null==n?void 0:n.className,i.className)||void 0})].concat([].slice.call(arguments,2)))}function Z(r){var n=!1;t.forceInline?n=!0:t.forceBlock||(n=!1===_.test(r));for(var i=oe(ce(n?r:r.trimEnd().replace(ne,"")+"\n\n",{inline:n}));"string"==typeof i[i.length-1]&&!i[i.length-1].trim();)i.pop();if(null===t.wrapper)return i;var a,c=t.wrapper||(n?"span":"div");if(i.length>1||t.forceWrapper)a=i;else{if(1===i.length)return"string"==typeof(a=i[0])?G("span",{key:"outer"},a):a;a=null}return e.createElement(c,{key:"outer"},a)}function q(r){var n=r.match(l);return n?n.reduce(function(r,n,t){var i=n.indexOf("=");if(-1!==i){var c=function(e){return-1!==e.indexOf("-")&&null===e.match(L)&&(e=e.replace(j,function(e,r){return r.toUpperCase()})),e}(n.slice(0,i)).trim(),o=function(e){var r=e[0];return('"'===r||"'"===r)&&e.length>=2&&e[e.length-1]===r?e.slice(1,-1):e}(n.slice(i+1).trim()),l=a[c]||c,u=r[l]=function(e,r){return"style"===e?r.split(/;\s?/).reduce(function(e,r){var n=r.slice(0,r.indexOf(":"));return e[n.replace(/(-[a-z])/g,function(e){return e[1].toUpperCase()})]=r.slice(n.length+1).trim(),e},{}):"href"===e||"src"===e?je(r):(r.match(M)&&(r=r.slice(1,r.length-1)),"true"===r||"false"!==r&&r)}(c,o);"string"==typeof u&&(A.test(u)||z.test(u))&&(r[l]=e.cloneElement(Z(u.trim()),{key:t}))}else"style"!==n&&(r[a[n]||n]=!0);return r},{}):null}var V=[],X={},ie=((i={})[0]={match:Ie(f),order:1,parse:function(e,r,n){return{children:r(e[0].replace(d,""),n)}},render:function(e,r,n){return G("blockquote",{key:n.key},r(e.children,n))}},i[1]={match:Re(p),order:1,parse:_e,render:function(e,r,n){return G("br",{key:n.key})}},i[2]={match:Ie(h),order:1,parse:_e,render:function(e,r,n){return G("hr",{key:n.key})}},i[3]={match:Ie(g),order:0,parse:function(e){return{lang:void 0,text:e[0].replace(/^ {4}/gm,"").replace(/\n+$/,"")}},render:function(e,n,t){return G("pre",{key:t.key},G("code",r({},e.attrs,{className:e.lang?"lang-"+e.lang:""}),e.text))}},i[4]={match:Ie(m),order:0,parse:function(e){return{attrs:q(e[3]||""),lang:e[2]||void 0,text:e[4],type:"3"}}},i[5]={match:Me(y),order:3,parse:function(e){return{text:e[2]}},render:function(e,r,n){return G("code",{key:n.key},e.text)}},i[6]={match:Ie(x),order:0,parse:function(e){return V.push({footnote:e[2],identifier:e[1]}),{}},render:Fe},i[7]={match:ze(b),order:1,parse:function(e){return{target:"#"+t.slugify(e[1]),text:e[1]}},render:function(e,r,n){return G("a",{key:n.key,href:je(e.target)},G("sup",{key:n.key},e.text))}},i[8]={match:ze(w),order:1,parse:function(e){return{completed:"x"===e[1].toLowerCase()}},render:function(e,r,n){return G("input",{checked:e.completed,key:n.key,readOnly:!0,type:"checkbox"})}},i[9]={match:Ie(t.enforceAtxHeadings?E:C),order:1,parse:function(e,r,n){return{children:Ne(r,e[2],n),id:t.slugify(e[2]),level:e[1].length}},render:function(e,r,n){return G("h"+e.level,{id:e.id,key:n.key},r(e.children,n))}},i[10]={match:Ie($),order:0,parse:function(e,r,n){return{children:Ne(r,e[1],n),level:"="===e[2]?1:2,type:"9"}}},i[11]={match:Re(A),order:1,parse:function(e,r,n){var t,i=e[3].match(te),a=new RegExp("^"+i[1],"gm"),c=e[3].replace(a,""),l=(t=c,Ee.some(function(e){return e.test(t)})?De:Ne),u=e[1].toLowerCase(),s=-1!==o.indexOf(u),f={attrs:q(e[2]),noInnerParse:s,tag:s?u:e[1]};return n.inAnchor=n.inAnchor||"a"===u,s?f.text=e[3]:f.children=l(r,c,n),n.inAnchor=!1,f},render:function(e,n,t){return G(e.tag,r({key:t.key},e.attrs),e.text||n(e.children,t))}},i[13]={match:Re(z),order:1,parse:function(e){return{attrs:q(e[2]||""),tag:e[1]}},render:function(e,n,t){return G(e.tag,r({},e.attrs,{key:t.key}))}},i[12]={match:Re(T),order:1,parse:function(){return{}},render:Fe},i[14]={match:Me(we),order:1,parse:function(e){return{alt:e[1],target:Be(e[2]),title:e[3]}},render:function(e,r,n){return G("img",{key:n.key,alt:e.alt||void 0,title:e.title||void 0,src:je(e.target)})}},i[15]={match:ze(Se),order:3,parse:function(e,r,n){return{children:He(r,e[1],n),target:Be(e[2]),title:e[3]}},render:function(e,r,n){return G("a",{key:n.key,href:je(e.target),title:e.title},r(e.children,n))}},i[16]={match:ze(U),order:0,parse:function(e){return{children:[{text:e[1],type:"27"}],target:e[1],type:"15"}}},i[17]={match:function(e,r){return r.inAnchor?null:ze(I)(e,r)},order:0,parse:function(e){return{children:[{text:e[1],type:"27"}],target:e[1],title:void 0,type:"15"}}},i[18]={match:ze(R),order:0,parse:function(e){var r=e[1],n=e[1];return u.test(n)||(n="mailto:"+n),{children:[{text:r.replace("mailto:",""),type:"27"}],target:n,type:"15"}}},i[20]=be(G,1),i[33]=be(G,2),i[19]={match:Ie(k),order:3,parse:_e,render:function(){return"\n"}},i[21]={match:Ue,order:3,parse:Pe,render:function(e,r,n){return G("p",{key:n.key},r(e.children,n))}},i[22]={match:ze(N),order:0,parse:function(e){return X[e[1]]={target:e[2],title:e[4]},{}},render:Fe},i[23]={match:Me(H),order:0,parse:function(e){return{alt:e[1]||void 0,ref:e[2]}},render:function(e,r,n){return G("img",{key:n.key,alt:e.alt,src:je(X[e.ref].target),title:X[e.ref].title})}},i[24]={match:ze(D),order:0,parse:function(e,r,n){return{children:r(e[1],n),fallbackChildren:r(e[0].replace(P,"\\$1"),n),ref:e[2]}},render:function(e,r,n){return X[e.ref]?G("a",{key:n.key,href:je(X[e.ref].target),title:X[e.ref].title},r(e.children,n)):G("span",{key:n.key},r(e.fallbackChildren,n))}},i[25]={match:Ie(B),order:1,parse:Te,render:function(e,r,n){return G("table",{key:n.key},G("thead",null,G("tr",null,e.header.map(function(t,i){return G("th",{key:i,style:Le(e,i)},r(t,n))}))),G("tbody",null,e.cells.map(function(t,i){return G("tr",{key:i},t.map(function(t,i){return G("td",{key:i,style:Le(e,i)},r(t,n))}))})))}},i[26]={match:function(e,r){return r.inTable?(r.inline=!0,W.exec(e)):null},order:1,parse:function(){return{type:"26"}},render:function(){return" | "}},i[27]={match:Re(re),order:4,parse:function(e){return{text:e[0].replace(O,function(e,r){return t.namedCodesToUnicode[r]?t.namedCodesToUnicode[r]:e})}},render:function(e){return e.text}},i[28]={match:Me(Q),order:2,parse:function(e,r,n){return{children:r(e[2],n)}},render:function(e,r,n){return G("strong",{key:n.key},r(e.children,n))}},i[29]={match:Me(J),order:3,parse:function(e,r,n){return{children:r(e[2],n)}},render:function(e,r,n){return G("em",{key:n.key},r(e.children,n))}},i[30]={match:Me(ee),order:1,parse:function(e){return{text:e[1],type:"27"}}},i[31]={match:Me(K),order:3,parse:Pe,render:function(e,r,n){return G("mark",{key:n.key},r(e.children,n))}},i[32]={match:Me(Y),order:3,parse:Pe,render:function(e,r,n){return G("del",{key:n.key},r(e.children,n))}},i);!0===t.disableParsingRawHTML&&(delete ie[11],delete ie[13]);var ae,ce=function(e){var r=Object.keys(e);function n(t,i){for(var a=[],c="";t;)for(var o=0;o<r.length;){var l=r[o],u=e[l],s=u.match(t,i,c);if(s){var f=s[0];t=t.substring(f.length);var d=u.parse(s,n,i);null==d.type&&(d.type=l),a.push(d),c=f;break}o++}return a}return r.sort(function(r,n){var t=e[r].order,i=e[n].order;return t!==i?t-i:1}),function(e,r){return n(function(e){return e.replace(v,"\n").replace(S,"").replace(F," ")}(e),r)}}(ie),oe=(ae=function(e,r){return function(n,t,i){var a=e[n.type].render;return r?r(function(){return a(n,t,i)},n,t,i):a(n,t,i)}}(ie,t.renderRule),function e(r,n){if(void 0===n&&(n={}),Array.isArray(r)){for(var t=n.key,i=[],a=!1,c=0;c<r.length;c++){n.key=c;var o=e(r[c],n),l="string"==typeof o;l&&a?i[i.length-1]+=o:null!==o&&i.push(o),a=l}return n.key=t,i}return ae(r,e,n)}),le=Z(n);return V.length?G("div",null,le,G("footer",{key:"footer"},V.map(function(e){return G("div",{id:t.slugify(e.identifier),key:e.identifier},e.identifier,oe(ce(e.footnote,{inline:!0})))}))):le}export default function(r){var n=r.children,t=r.options,a=function(e,r){if(null==e)return{};var n,t,i={},a=Object.keys(e);for(t=0;t<a.length;t++)r.indexOf(n=a[t])>=0||(i[n]=e[n]);return i}(r,i);return e.cloneElement(qe(n,t),a)}export{n as RuleType,qe as compiler}; | ||
import*as e from"react";function n(){return n=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])}return e},n.apply(this,arguments)}var r,t,i=["children","options"];!function(e){e.blockQuote="0",e.breakLine="1",e.breakThematic="2",e.codeBlock="3",e.codeFenced="4",e.codeInline="5",e.footnote="6",e.footnoteReference="7",e.gfmTask="8",e.heading="9",e.headingSetext="10",e.htmlBlock="11",e.htmlComment="12",e.htmlSelfClosing="13",e.image="14",e.link="15",e.linkAngleBraceStyleDetector="16",e.linkBareUrlDetector="17",e.linkMailtoDetector="18",e.newlineCoalescer="19",e.orderedList="20",e.paragraph="21",e.ref="22",e.refImage="23",e.refLink="24",e.table="25",e.tableSeparator="26",e.text="27",e.textBolded="28",e.textEmphasized="29",e.textEscaped="30",e.textMarked="31",e.textStrikethroughed="32",e.unorderedList="33"}(r||(r={})),function(e){e[e.MAX=0]="MAX",e[e.HIGH=1]="HIGH",e[e.MED=2]="MED",e[e.LOW=3]="LOW",e[e.MIN=4]="MIN"}(t||(t={}));var a=["allowFullScreen","allowTransparency","autoComplete","autoFocus","autoPlay","cellPadding","cellSpacing","charSet","className","classId","colSpan","contentEditable","contextMenu","crossOrigin","encType","formAction","formEncType","formMethod","formNoValidate","formTarget","frameBorder","hrefLang","inputMode","keyParams","keyType","marginHeight","marginWidth","maxLength","mediaGroup","minLength","noValidate","radioGroup","readOnly","rowSpan","spellCheck","srcDoc","srcLang","srcSet","tabIndex","useMap"].reduce(function(e,n){return e[n.toLowerCase()]=n,e},{for:"htmlFor"}),c={amp:"&",apos:"'",gt:">",lt:"<",nbsp:" ",quot:"“"},o=["style","script"],l=/([-A-Z0-9_:]+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|(?:\{((?:\\.|{[^}]*?}|[^}])*)\})))?/gi,u=/mailto:/i,s=/\n{2,}$/,f=/^( *>[^\n]+(\n[^\n]+)*\n*)+\n{2,}/,d=/^ *> ?/gm,p=/^ {2,}\n/,h=/^(?:( *[-*_])){3,} *(?:\n *)+\n/,m=/^\s*(`{3,}|~{3,}) *(\S+)?([^\n]*?)?\n([\s\S]+?)\s*\1 *(?:\n *)*\n?/,g=/^(?: {4}[^\n]+\n*)+(?:\n *)+\n?/,y=/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,k=/^(?:\n *)*\n/,v=/\r\n?/g,x=/^\[\^([^\]]+)](:.*)\n/,b=/^\[\^([^\]]+)]/,S=/\f/g,w=/^---[ \t]*\n(.|\n)*\n---[ \t]*\n/,C=/^\s*?\[(x|\s)\]/,E=/^ *(#{1,6}) *([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,$=/^ *(#{1,6}) +([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,A=/^([^\n]+)\n *(=|-){3,} *(?:\n *)+\n/,O=/^ *(?!<[a-z][^ >/]* ?\/>)<([a-z][^ >/]*) ?([^>]*)\/{0}>\n?(\s*(?:<\1[^>]*?>[\s\S]*?<\/\1>|(?!<\1)[\s\S])*?)<\/\1>\n*/i,T=/&([a-z0-9]+|#[0-9]{1,6}|#x[0-9a-fA-F]{1,6});/gi,L=/^<!--[\s\S]*?(?:-->)/,z=/^(data|aria|x)-[a-z_][a-z\d_.-]*$/,M=/^ *<([a-z][a-z0-9:]*)(?:\s+((?:<.*?>|[^>])*))?\/?>(?!<\/\1>)(\s*\n)?/i,I=/^\{.*\}$/,R=/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,U=/^<([^ >]+@[^ >]+)>/,j=/^<([^ >]+:\/[^ >]+)>/,B=/-([a-z])?/gi,N=/^(.*\|?.*)\n *(\|? *[-:]+ *\|[-| :]*)\n((?:.*\|.*\n)*)\n?/,H=/^\[([^\]]*)\]:\s+<?([^\s>]+)>?\s*("([^"]*)")?/,D=/^!\[([^\]]*)\] ?\[([^\]]*)\]/,P=/^\[([^\]]*)\] ?\[([^\]]*)\]/,_=/(\[|\])/g,F=/(\n|^[-*]\s|^#|^ {2,}|^-{2,}|^>\s)/,W=/\t/g,G=/^ *\| */,Z=/(^ *\||\| *$)/g,q=/ *$/,V=/^ *:-+: *$/,X=/^ *:-+ *$/,Q=/^ *-+: *$/,J=/^([*_])\1((?:\[.*?\][([].*?[)\]]|<.*?>(?:.*?<.*?>)?|`.*?`|~+.*?~+|.)*?)\1\1(?!\1)/,K=/^([*_])((?:\[.*?\][([].*?[)\]]|<.*?>(?:.*?<.*?>)?|`.*?`|~+.*?~+|.)*?)\1(?!\1|\w)/,Y=/^==((?:\[.*?\]|<.*?>(?:.*?<.*?>)?|`.*?`|.)*?)==/,ee=/^~~((?:\[.*?\]|<.*?>(?:.*?<.*?>)?|`.*?`|.)*?)~~/,ne=/^\\([^0-9A-Za-z\s])/,re=/^[\s\S]+?(?=[^0-9A-Z\s\u00c0-\uffff&#;.()'"]|\d+\.|\n\n| {2,}\n|\w+:\S|$)/i,te=/^\n+/,ie=/^([ \t]*)/,ae=/\\([^\\])/g,ce=/ *\n+$/,oe=/(?:^|\n)( *)$/,le="(?:\\d+\\.)",ue="(?:[*+-])";function se(e){return"( *)("+(1===e?le:ue)+") +"}var fe=se(1),de=se(2);function pe(e){return new RegExp("^"+(1===e?fe:de))}var he=pe(1),me=pe(2);function ge(e){return new RegExp("^"+(1===e?fe:de)+"[^\\n]*(?:\\n(?!\\1"+(1===e?le:ue)+" )[^\\n]*)*(\\n|$)","gm")}var ye=ge(1),ke=ge(2);function ve(e){var n=1===e?le:ue;return new RegExp("^( *)("+n+") [\\s\\S]+?(?:\\n{2,}(?! )(?!\\1"+n+" (?!"+n+" ))\\n*|\\s*\\n*$)")}var xe=ve(1),be=ve(2);function Se(e,n){var r=1===n,t=r?xe:be,i=r?ye:ke,a=r?he:me;return{match:function(e,n,r){var i=oe.exec(r);return i&&(n.list||!n.inline&&!n.simple)?t.exec(e=i[1]+e):null},order:1,parse:function(e,n,t){var c=r?+e[2]:void 0,o=e[0].replace(s,"\n").match(i),l=!1;return{items:o.map(function(e,r){var i=a.exec(e)[0].length,c=new RegExp("^ {1,"+i+"}","gm"),u=e.replace(c,"").replace(a,""),s=r===o.length-1,f=-1!==u.indexOf("\n\n")||s&&l;l=f;var d,p=t.inline,h=t.list;t.list=!0,f?(t.inline=!1,d=u.replace(ce,"\n\n")):(t.inline=!0,d=u.replace(ce,""));var m=n(d,t);return t.inline=p,t.list=h,m}),ordered:r,start:c}},render:function(n,r,t){return e(n.ordered?"ol":"ul",{key:t.key,start:"20"===n.type?n.start:void 0},n.items.map(function(n,i){return e("li",{key:i},r(n,t))}))}}}var we=/^\[([^\]]*)]\( *((?:\([^)]*\)|[^() ])*) *"?([^)"]*)?"?\)/,Ce=/^!\[([^\]]*)]\( *((?:\([^)]*\)|[^() ])*) *"?([^)"]*)?"?\)/,Ee=[f,m,g,E,A,$,L,N,ye,xe,ke,be],$e=[].concat(Ee,[/^[^\n]+(?: \n|\n{2,})/,O,M]);function Ae(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 Oe(e){return Q.test(e)?"right":V.test(e)?"center":X.test(e)?"left":null}function Te(e,n,r){var t=r.inTable;r.inTable=!0;var i=n(e.trim(),r);r.inTable=t;var a=[[]];return i.forEach(function(e,n){"26"===e.type?0!==n&&n!==i.length-1&&a.push([]):("27"!==e.type||null!=i[n+1]&&"26"!==i[n+1].type||(e.text=e.text.replace(q,"")),a[a.length-1].push(e))}),a}function Le(e,n,r){r.inline=!0;var t=Te(e[1],n,r),i=e[2].replace(Z,"").split("|").map(Oe),a=function(e,n,r){return e.trim().split("\n").map(function(e){return Te(e,n,r)})}(e[3],n,r);return r.inline=!1,{align:i,cells:a,header:t,type:"25"}}function ze(e,n){return null==e.align[n]?{}:{textAlign:e.align[n]}}function Me(e){return function(n,r){return r.inline?e.exec(n):null}}function Ie(e){return function(n,r){return r.inline||r.simple?e.exec(n):null}}function Re(e){return function(n,r){return r.inline||r.simple?null:e.exec(n)}}function Ue(e){return function(n){return e.exec(n)}}function je(e,n,r){if(n.inline||n.simple)return null;if(r&&!r.endsWith("\n"))return null;var t="";e.split("\n").every(function(e){return!Ee.some(function(n){return n.test(e)})&&(t+=e+"\n",e.trim())});var i=t.trimEnd();return""==i?null:[t,i]}function Be(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 Ne(e){return e.replace(ae,"$1")}function He(e,n,r){var t=r.inline||!1,i=r.simple||!1;r.inline=!0,r.simple=!0;var a=e(n,r);return r.inline=t,r.simple=i,a}function De(e,n,r){var t=r.inline||!1,i=r.simple||!1;r.inline=!1,r.simple=!0;var a=e(n,r);return r.inline=t,r.simple=i,a}function Pe(e,n,r){return r.inline=!1,e(n,r)}var _e=function(e,n,r){return{children:He(n,e[1],r)}};function Fe(){return{}}function We(){return null}function Ge(){return[].slice.call(arguments).filter(Boolean).join(" ")}function Ze(e,n,r){for(var t=e,i=n.split(".");i.length&&void 0!==(t=t[i[0]]);)i.shift();return t||r}function qe(e,n){var r=Ze(n,e);return r?"function"==typeof r||"object"==typeof r&&"render"in r?r:Ze(n,e+".component",e):e}function Ve(r,t){var i;void 0===t&&(t={}),t.overrides=t.overrides||{},t.slugify=t.slugify||Ae,t.namedCodesToUnicode=t.namedCodesToUnicode?n({},c,t.namedCodesToUnicode):c;var s=t.createElement||e.createElement;function Z(e,r){var i=Ze(t.overrides,e+".props",{});return s.apply(void 0,[qe(e,t.overrides),n({},r,i,{className:Ge(null==r?void 0:r.className,i.className)||void 0})].concat([].slice.call(arguments,2)))}function q(n){n=n.replace(w,"");var r=!1;t.forceInline?r=!0:t.forceBlock||(r=!1===F.test(n));for(var i=le(oe(r?n:n.trimEnd().replace(te,"")+"\n\n",{inline:r}));"string"==typeof i[i.length-1]&&!i[i.length-1].trim();)i.pop();if(null===t.wrapper)return i;var a,c=t.wrapper||(r?"span":"div");if(i.length>1||t.forceWrapper)a=i;else{if(1===i.length)return"string"==typeof(a=i[0])?Z("span",{key:"outer"},a):a;a=null}return e.createElement(c,{key:"outer"},a)}function V(n){var r=n.match(l);return r?r.reduce(function(n,r,t){var i=r.indexOf("=");if(-1!==i){var c=function(e){return-1!==e.indexOf("-")&&null===e.match(z)&&(e=e.replace(B,function(e,n){return n.toUpperCase()})),e}(r.slice(0,i)).trim(),o=function(e){var n=e[0];return('"'===n||"'"===n)&&e.length>=2&&e[e.length-1]===n?e.slice(1,-1):e}(r.slice(i+1).trim()),l=a[c]||c,u=n[l]=function(e,n){return"style"===e?n.split(/;\s?/).reduce(function(e,n){var r=n.slice(0,n.indexOf(":"));return e[r.replace(/(-[a-z])/g,function(e){return e[1].toUpperCase()})]=n.slice(r.length+1).trim(),e},{}):"href"===e||"src"===e?Be(n):(n.match(I)&&(n=n.slice(1,n.length-1)),"true"===n||"false"!==n&&n)}(c,o);"string"==typeof u&&(O.test(u)||M.test(u))&&(n[l]=e.cloneElement(q(u.trim()),{key:t}))}else"style"!==r&&(n[a[r]||r]=!0);return n},{}):null}var X=[],Q={},ae=((i={})[0]={match:Re(f),order:1,parse:function(e,n,r){return{children:n(e[0].replace(d,""),r)}},render:function(e,n,r){return Z("blockquote",{key:r.key},n(e.children,r))}},i[1]={match:Ue(p),order:1,parse:Fe,render:function(e,n,r){return Z("br",{key:r.key})}},i[2]={match:Re(h),order:1,parse:Fe,render:function(e,n,r){return Z("hr",{key:r.key})}},i[3]={match:Re(g),order:0,parse:function(e){return{lang:void 0,text:e[0].replace(/^ {4}/gm,"").replace(/\n+$/,"")}},render:function(e,r,t){return Z("pre",{key:t.key},Z("code",n({},e.attrs,{className:e.lang?"lang-"+e.lang:""}),e.text))}},i[4]={match:Re(m),order:0,parse:function(e){return{attrs:V(e[3]||""),lang:e[2]||void 0,text:e[4],type:"3"}}},i[5]={match:Ie(y),order:3,parse:function(e){return{text:e[2]}},render:function(e,n,r){return Z("code",{key:r.key},e.text)}},i[6]={match:Re(x),order:0,parse:function(e){return X.push({footnote:e[2],identifier:e[1]}),{}},render:We},i[7]={match:Me(b),order:1,parse:function(e){return{target:"#"+t.slugify(e[1]),text:e[1]}},render:function(e,n,r){return Z("a",{key:r.key,href:Be(e.target)},Z("sup",{key:r.key},e.text))}},i[8]={match:Me(C),order:1,parse:function(e){return{completed:"x"===e[1].toLowerCase()}},render:function(e,n,r){return Z("input",{checked:e.completed,key:r.key,readOnly:!0,type:"checkbox"})}},i[9]={match:Re(t.enforceAtxHeadings?$:E),order:1,parse:function(e,n,r){return{children:He(n,e[2],r),id:t.slugify(e[2]),level:e[1].length}},render:function(e,n,r){return Z("h"+e.level,{id:e.id,key:r.key},n(e.children,r))}},i[10]={match:Re(A),order:0,parse:function(e,n,r){return{children:He(n,e[1],r),level:"="===e[2]?1:2,type:"9"}}},i[11]={match:Ue(O),order:1,parse:function(e,n,r){var t,i=e[3].match(ie),a=new RegExp("^"+i[1],"gm"),c=e[3].replace(a,""),l=(t=c,$e.some(function(e){return e.test(t)})?Pe:He),u=e[1].toLowerCase(),s=-1!==o.indexOf(u),f={attrs:V(e[2]),noInnerParse:s,tag:s?u:e[1]};return r.inAnchor=r.inAnchor||"a"===u,s?f.text=e[3]:f.children=l(n,c,r),r.inAnchor=!1,f},render:function(e,r,t){return Z(e.tag,n({key:t.key},e.attrs),e.text||r(e.children,t))}},i[13]={match:Ue(M),order:1,parse:function(e){return{attrs:V(e[2]||""),tag:e[1]}},render:function(e,r,t){return Z(e.tag,n({},e.attrs,{key:t.key}))}},i[12]={match:Ue(L),order:1,parse:function(){return{}},render:We},i[14]={match:Ie(Ce),order:1,parse:function(e){return{alt:e[1],target:Ne(e[2]),title:e[3]}},render:function(e,n,r){return Z("img",{key:r.key,alt:e.alt||void 0,title:e.title||void 0,src:Be(e.target)})}},i[15]={match:Me(we),order:3,parse:function(e,n,r){return{children:De(n,e[1],r),target:Ne(e[2]),title:e[3]}},render:function(e,n,r){return Z("a",{key:r.key,href:Be(e.target),title:e.title},n(e.children,r))}},i[16]={match:Me(j),order:0,parse:function(e){return{children:[{text:e[1],type:"27"}],target:e[1],type:"15"}}},i[17]={match:function(e,n){return n.inAnchor?null:Me(R)(e,n)},order:0,parse:function(e){return{children:[{text:e[1],type:"27"}],target:e[1],title:void 0,type:"15"}}},i[18]={match:Me(U),order:0,parse:function(e){var n=e[1],r=e[1];return u.test(r)||(r="mailto:"+r),{children:[{text:n.replace("mailto:",""),type:"27"}],target:r,type:"15"}}},i[20]=Se(Z,1),i[33]=Se(Z,2),i[19]={match:Re(k),order:3,parse:Fe,render:function(){return"\n"}},i[21]={match:je,order:3,parse:_e,render:function(e,n,r){return Z("p",{key:r.key},n(e.children,r))}},i[22]={match:Me(H),order:0,parse:function(e){return Q[e[1]]={target:e[2],title:e[4]},{}},render:We},i[23]={match:Ie(D),order:0,parse:function(e){return{alt:e[1]||void 0,ref:e[2]}},render:function(e,n,r){return Z("img",{key:r.key,alt:e.alt,src:Be(Q[e.ref].target),title:Q[e.ref].title})}},i[24]={match:Me(P),order:0,parse:function(e,n,r){return{children:n(e[1],r),fallbackChildren:n(e[0].replace(_,"\\$1"),r),ref:e[2]}},render:function(e,n,r){return Q[e.ref]?Z("a",{key:r.key,href:Be(Q[e.ref].target),title:Q[e.ref].title},n(e.children,r)):Z("span",{key:r.key},n(e.fallbackChildren,r))}},i[25]={match:Re(N),order:1,parse:Le,render:function(e,n,r){return Z("table",{key:r.key},Z("thead",null,Z("tr",null,e.header.map(function(t,i){return Z("th",{key:i,style:ze(e,i)},n(t,r))}))),Z("tbody",null,e.cells.map(function(t,i){return Z("tr",{key:i},t.map(function(t,i){return Z("td",{key:i,style:ze(e,i)},n(t,r))}))})))}},i[26]={match:function(e,n){return n.inTable?(n.inline=!0,G.exec(e)):null},order:1,parse:function(){return{type:"26"}},render:function(){return" | "}},i[27]={match:Ue(re),order:4,parse:function(e){return{text:e[0].replace(T,function(e,n){return t.namedCodesToUnicode[n]?t.namedCodesToUnicode[n]:e})}},render:function(e){return e.text}},i[28]={match:Ie(J),order:2,parse:function(e,n,r){return{children:n(e[2],r)}},render:function(e,n,r){return Z("strong",{key:r.key},n(e.children,r))}},i[29]={match:Ie(K),order:3,parse:function(e,n,r){return{children:n(e[2],r)}},render:function(e,n,r){return Z("em",{key:r.key},n(e.children,r))}},i[30]={match:Ie(ne),order:1,parse:function(e){return{text:e[1],type:"27"}}},i[31]={match:Ie(Y),order:3,parse:_e,render:function(e,n,r){return Z("mark",{key:r.key},n(e.children,r))}},i[32]={match:Ie(ee),order:3,parse:_e,render:function(e,n,r){return Z("del",{key:r.key},n(e.children,r))}},i);!0===t.disableParsingRawHTML&&(delete ae[11],delete ae[13]);var ce,oe=function(e){var n=Object.keys(e);function r(t,i){for(var a=[],c="";t;)for(var o=0;o<n.length;){var l=n[o],u=e[l],s=u.match(t,i,c);if(s){var f=s[0];t=t.substring(f.length);var d=u.parse(s,r,i);null==d.type&&(d.type=l),a.push(d),c=f;break}o++}return a}return n.sort(function(n,r){var t=e[n].order,i=e[r].order;return t!==i?t-i:1}),function(e,n){return r(function(e){return e.replace(v,"\n").replace(S,"").replace(W," ")}(e),n)}}(ae),le=(ce=function(e,n){return function(r,t,i){var a=e[r.type].render;return n?n(function(){return a(r,t,i)},r,t,i):a(r,t,i)}}(ae,t.renderRule),function e(n,r){if(void 0===r&&(r={}),Array.isArray(n)){for(var t=r.key,i=[],a=!1,c=0;c<n.length;c++){r.key=c;var o=e(n[c],r),l="string"==typeof o;l&&a?i[i.length-1]+=o:null!==o&&i.push(o),a=l}return r.key=t,i}return ce(n,e,r)}),ue=q(r);return X.length?Z("div",null,ue,Z("footer",{key:"footer"},X.map(function(e){return Z("div",{id:t.slugify(e.identifier),key:e.identifier},e.identifier,le(oe(e.footnote,{inline:!0})))}))):ue}export default function(n){var r=n.children,t=n.options,a=function(e,n){if(null==e)return{};var r,t,i={},a=Object.keys(e);for(t=0;t<a.length;t++)n.indexOf(r=a[t])>=0||(i[r]=e[r]);return i}(n,i);return e.cloneElement(Ve(r,t),a)}export{r as RuleType,Ve as compiler}; | ||
//# sourceMappingURL=index.module.js.map |
@@ -1,2 +0,2 @@ | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n(require("react")):"function"==typeof define&&define.amd?define(["react"],n):(e||self).MarkdownToJSX=n(e.React)}(this,function(e){function n(e){if(e&&e.__esModule)return e;var n=Object.create(null);return e&&Object.keys(e).forEach(function(r){if("default"!==r){var t=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,t.get?t:{enumerable:!0,get:function(){return e[r]}})}}),n.default=e,n}var r=/*#__PURE__*/n(e);function t(){return t=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])}return e},t.apply(this,arguments)}var i,a,o=["children","options"];!function(e){e.blockQuote="0",e.breakLine="1",e.breakThematic="2",e.codeBlock="3",e.codeFenced="4",e.codeInline="5",e.footnote="6",e.footnoteReference="7",e.gfmTask="8",e.heading="9",e.headingSetext="10",e.htmlBlock="11",e.htmlComment="12",e.htmlSelfClosing="13",e.image="14",e.link="15",e.linkAngleBraceStyleDetector="16",e.linkBareUrlDetector="17",e.linkMailtoDetector="18",e.newlineCoalescer="19",e.orderedList="20",e.paragraph="21",e.ref="22",e.refImage="23",e.refLink="24",e.table="25",e.tableSeparator="26",e.text="27",e.textBolded="28",e.textEmphasized="29",e.textEscaped="30",e.textMarked="31",e.textStrikethroughed="32",e.unorderedList="33"}(i||(i={})),function(e){e[e.MAX=0]="MAX",e[e.HIGH=1]="HIGH",e[e.MED=2]="MED",e[e.LOW=3]="LOW",e[e.MIN=4]="MIN"}(a||(a={}));var c=["allowFullScreen","allowTransparency","autoComplete","autoFocus","autoPlay","cellPadding","cellSpacing","charSet","className","classId","colSpan","contentEditable","contextMenu","crossOrigin","encType","formAction","formEncType","formMethod","formNoValidate","formTarget","frameBorder","hrefLang","inputMode","keyParams","keyType","marginHeight","marginWidth","maxLength","mediaGroup","minLength","noValidate","radioGroup","readOnly","rowSpan","spellCheck","srcDoc","srcLang","srcSet","tabIndex","useMap"].reduce(function(e,n){return e[n.toLowerCase()]=n,e},{for:"htmlFor"}),l={amp:"&",apos:"'",gt:">",lt:"<",nbsp:" ",quot:"“"},u=["style","script"],f=/([-A-Z0-9_:]+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|(?:\{((?:\\.|{[^}]*?}|[^}])*)\})))?/gi,s=/mailto:/i,d=/\n{2,}$/,p=/^( *>[^\n]+(\n[^\n]+)*\n*)+\n{2,}/,h=/^ *> ?/gm,m=/^ {2,}\n/,g=/^(?:( *[-*_])){3,} *(?:\n *)+\n/,y=/^\s*(`{3,}|~{3,}) *(\S+)?([^\n]*?)?\n([\s\S]+?)\s*\1 *(?:\n *)*\n?/,v=/^(?: {4}[^\n]+\n*)+(?:\n *)+\n?/,k=/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,x=/^(?:\n *)*\n/,b=/\r\n?/g,O=/^\[\^([^\]]+)](:.*)\n/,w=/^\[\^([^\]]+)]/,S=/\f/g,E=/^\s*?\[(x|\s)\]/,T=/^ *(#{1,6}) *([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,C=/^ *(#{1,6}) +([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,$=/^([^\n]+)\n *(=|-){3,} *(?:\n *)+\n/,A=/^ *(?!<[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,M=/^<!--[\s\S]*?(?:-->)/,j=/^(data|aria|x)-[a-z_][a-z\d_.-]*$/,z=/^ *<([a-z][a-z0-9:]*)(?:\s+((?:<.*?>|[^>])*))?\/?>(?!<\/\1>)(\s*\n)?/i,I=/^\{.*\}$/,R=/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,U=/^<([^ >]+@[^ >]+)>/,B=/^<([^ >]+:\/[^ >]+)>/,N=/-([a-z])?/gi,P=/^(.*\|?.*)\n *(\|? *[-:]+ *\|[-| :]*)\n((?:.*\|.*\n)*)\n?/,_=/^\[([^\]]*)\]:\s+<?([^\s>]+)>?\s*("([^"]*)")?/,D=/^!\[([^\]]*)\] ?\[([^\]]*)\]/,H=/^\[([^\]]*)\] ?\[([^\]]*)\]/,F=/(\[|\])/g,W=/(\n|^[-*]\s|^#|^ {2,}|^-{2,}|^>\s)/,G=/\t/g,Z=/^ *\| */,q=/(^ *\||\| *$)/g,X=/ *$/,V=/^ *:-+: *$/,J=/^ *:-+ *$/,Q=/^ *-+: *$/,K=/^([*_])\1((?:\[.*?\][([].*?[)\]]|<.*?>(?:.*?<.*?>)?|`.*?`|~+.*?~+|.)*?)\1\1(?!\1)/,Y=/^([*_])((?:\[.*?\][([].*?[)\]]|<.*?>(?:.*?<.*?>)?|`.*?`|~+.*?~+|.)*?)\1(?!\1|\w)/,ee=/^==((?:\[.*?\]|<.*?>(?:.*?<.*?>)?|`.*?`|.)*?)==/,ne=/^~~((?:\[.*?\]|<.*?>(?:.*?<.*?>)?|`.*?`|.)*?)~~/,re=/^\\([^0-9A-Za-z\s])/,te=/^[\s\S]+?(?=[^0-9A-Z\s\u00c0-\uffff&#;.()'"]|\d+\.|\n\n| {2,}\n|\w+:\S|$)/i,ie=/^\n+/,ae=/^([ \t]*)/,oe=/\\([^\\])/g,ce=/ *\n+$/,le=/(?:^|\n)( *)$/,ue="(?:\\d+\\.)",fe="(?:[*+-])";function se(e){return"( *)("+(1===e?ue:fe)+") +"}var de=se(1),pe=se(2);function he(e){return new RegExp("^"+(1===e?de:pe))}var me=he(1),ge=he(2);function ye(e){return new RegExp("^"+(1===e?de:pe)+"[^\\n]*(?:\\n(?!\\1"+(1===e?ue:fe)+" )[^\\n]*)*(\\n|$)","gm")}var ve=ye(1),ke=ye(2);function xe(e){var n=1===e?ue:fe;return new RegExp("^( *)("+n+") [\\s\\S]+?(?:\\n{2,}(?! )(?!\\1"+n+" (?!"+n+" ))\\n*|\\s*\\n*$)")}var be=xe(1),Oe=xe(2);function we(e,n){var r=1===n,t=r?be:Oe,i=r?ve:ke,a=r?me:ge;return{match:function(e,n,r){var i=le.exec(r);return i&&(n.list||!n.inline&&!n.simple)?t.exec(e=i[1]+e):null},order:1,parse:function(e,n,t){var o=r?+e[2]:void 0,c=e[0].replace(d,"\n").match(i),l=!1;return{items:c.map(function(e,r){var i=a.exec(e)[0].length,o=new RegExp("^ {1,"+i+"}","gm"),u=e.replace(o,"").replace(a,""),f=r===c.length-1,s=-1!==u.indexOf("\n\n")||f&&l;l=s;var d,p=t.inline,h=t.list;t.list=!0,s?(t.inline=!1,d=u.replace(ce,"\n\n")):(t.inline=!0,d=u.replace(ce,""));var m=n(d,t);return t.inline=p,t.list=h,m}),ordered:r,start:o}},render:function(n,r,t){return e(n.ordered?"ol":"ul",{key:t.key,start:"20"===n.type?n.start:void 0},n.items.map(function(n,i){return e("li",{key:i},r(n,t))}))}}}var Se=/^\[([^\]]*)]\( *((?:\([^)]*\)|[^() ])*) *"?([^)"]*)?"?\)/,Ee=/^!\[([^\]]*)]\( *((?:\([^)]*\)|[^() ])*) *"?([^)"]*)?"?\)/,Te=[p,y,v,T,$,C,M,P,ve,be,ke,Oe],Ce=[].concat(Te,[/^[^\n]+(?: \n|\n{2,})/,A,z]);function $e(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 Ae(e){return Q.test(e)?"right":V.test(e)?"center":J.test(e)?"left":null}function Le(e,n,r){var t=r.inTable;r.inTable=!0;var i=n(e.trim(),r);r.inTable=t;var a=[[]];return i.forEach(function(e,n){"26"===e.type?0!==n&&n!==i.length-1&&a.push([]):("27"!==e.type||null!=i[n+1]&&"26"!==i[n+1].type||(e.text=e.text.replace(X,"")),a[a.length-1].push(e))}),a}function Me(e,n,r){r.inline=!0;var t=Le(e[1],n,r),i=e[2].replace(q,"").split("|").map(Ae),a=function(e,n,r){return e.trim().split("\n").map(function(e){return Le(e,n,r)})}(e[3],n,r);return r.inline=!1,{align:i,cells:a,header:t,type:"25"}}function je(e,n){return null==e.align[n]?{}:{textAlign:e.align[n]}}function ze(e){return function(n,r){return r.inline?e.exec(n):null}}function Ie(e){return function(n,r){return r.inline||r.simple?e.exec(n):null}}function Re(e){return function(n,r){return r.inline||r.simple?null:e.exec(n)}}function Ue(e){return function(n){return e.exec(n)}}function Be(e,n,r){if(n.inline||n.simple)return null;if(r&&!r.endsWith("\n"))return null;var t="";e.split("\n").every(function(e){return!Te.some(function(n){return n.test(e)})&&(t+=e+"\n",e.trim())});var i=t.trimEnd();return""==i?null:[t,i]}function Ne(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 Pe(e){return e.replace(oe,"$1")}function _e(e,n,r){var t=r.inline||!1,i=r.simple||!1;r.inline=!0,r.simple=!0;var a=e(n,r);return r.inline=t,r.simple=i,a}function De(e,n,r){var t=r.inline||!1,i=r.simple||!1;r.inline=!1,r.simple=!0;var a=e(n,r);return r.inline=t,r.simple=i,a}function He(e,n,r){return r.inline=!1,e(n,r)}var Fe=function(e,n,r){return{children:_e(n,e[1],r)}};function We(){return{}}function Ge(){return null}function Ze(){return[].slice.call(arguments).filter(Boolean).join(" ")}function qe(e,n,r){for(var t=e,i=n.split(".");i.length&&void 0!==(t=t[i[0]]);)i.shift();return t||r}function Xe(e,n){var r=qe(n,e);return r?"function"==typeof r||"object"==typeof r&&"render"in r?r:qe(n,e+".component",e):e}function Ve(e,n){var i;void 0===n&&(n={}),n.overrides=n.overrides||{},n.slugify=n.slugify||$e,n.namedCodesToUnicode=n.namedCodesToUnicode?t({},l,n.namedCodesToUnicode):l;var a=n.createElement||r.createElement;function o(e,r){var i=qe(n.overrides,e+".props",{});return a.apply(void 0,[Xe(e,n.overrides),t({},r,i,{className:Ze(null==r?void 0:r.className,i.className)||void 0})].concat([].slice.call(arguments,2)))}function d(e){var t=!1;n.forceInline?t=!0:n.forceBlock||(t=!1===W.test(e));for(var i=ce(oe(t?e:e.trimEnd().replace(ie,"")+"\n\n",{inline:t}));"string"==typeof i[i.length-1]&&!i[i.length-1].trim();)i.pop();if(null===n.wrapper)return i;var a,c=n.wrapper||(t?"span":"div");if(i.length>1||n.forceWrapper)a=i;else{if(1===i.length)return"string"==typeof(a=i[0])?o("span",{key:"outer"},a):a;a=null}return r.createElement(c,{key:"outer"},a)}function q(e){var n=e.match(f);return n?n.reduce(function(e,n,t){var i=n.indexOf("=");if(-1!==i){var a=function(e){return-1!==e.indexOf("-")&&null===e.match(j)&&(e=e.replace(N,function(e,n){return n.toUpperCase()})),e}(n.slice(0,i)).trim(),o=function(e){var n=e[0];return('"'===n||"'"===n)&&e.length>=2&&e[e.length-1]===n?e.slice(1,-1):e}(n.slice(i+1).trim()),l=c[a]||a,u=e[l]=function(e,n){return"style"===e?n.split(/;\s?/).reduce(function(e,n){var r=n.slice(0,n.indexOf(":"));return e[r.replace(/(-[a-z])/g,function(e){return e[1].toUpperCase()})]=n.slice(r.length+1).trim(),e},{}):"href"===e||"src"===e?Ne(n):(n.match(I)&&(n=n.slice(1,n.length-1)),"true"===n||"false"!==n&&n)}(a,o);"string"==typeof u&&(A.test(u)||z.test(u))&&(e[l]=r.cloneElement(d(u.trim()),{key:t}))}else"style"!==n&&(e[c[n]||n]=!0);return e},{}):null}var X=[],V={},J=((i={})[0]={match:Re(p),order:1,parse:function(e,n,r){return{children:n(e[0].replace(h,""),r)}},render:function(e,n,r){return o("blockquote",{key:r.key},n(e.children,r))}},i[1]={match:Ue(m),order:1,parse:We,render:function(e,n,r){return o("br",{key:r.key})}},i[2]={match:Re(g),order:1,parse:We,render:function(e,n,r){return o("hr",{key:r.key})}},i[3]={match:Re(v),order:0,parse:function(e){return{lang:void 0,text:e[0].replace(/^ {4}/gm,"").replace(/\n+$/,"")}},render:function(e,n,r){return o("pre",{key:r.key},o("code",t({},e.attrs,{className:e.lang?"lang-"+e.lang:""}),e.text))}},i[4]={match:Re(y),order:0,parse:function(e){return{attrs:q(e[3]||""),lang:e[2]||void 0,text:e[4],type:"3"}}},i[5]={match:Ie(k),order:3,parse:function(e){return{text:e[2]}},render:function(e,n,r){return o("code",{key:r.key},e.text)}},i[6]={match:Re(O),order:0,parse:function(e){return X.push({footnote:e[2],identifier:e[1]}),{}},render:Ge},i[7]={match:ze(w),order:1,parse:function(e){return{target:"#"+n.slugify(e[1]),text:e[1]}},render:function(e,n,r){return o("a",{key:r.key,href:Ne(e.target)},o("sup",{key:r.key},e.text))}},i[8]={match:ze(E),order:1,parse:function(e){return{completed:"x"===e[1].toLowerCase()}},render:function(e,n,r){return o("input",{checked:e.completed,key:r.key,readOnly:!0,type:"checkbox"})}},i[9]={match:Re(n.enforceAtxHeadings?C:T),order:1,parse:function(e,r,t){return{children:_e(r,e[2],t),id:n.slugify(e[2]),level:e[1].length}},render:function(e,n,r){return o("h"+e.level,{id:e.id,key:r.key},n(e.children,r))}},i[10]={match:Re($),order:0,parse:function(e,n,r){return{children:_e(n,e[1],r),level:"="===e[2]?1:2,type:"9"}}},i[11]={match:Ue(A),order:1,parse:function(e,n,r){var t,i=e[3].match(ae),a=new RegExp("^"+i[1],"gm"),o=e[3].replace(a,""),c=(t=o,Ce.some(function(e){return e.test(t)})?He:_e),l=e[1].toLowerCase(),f=-1!==u.indexOf(l),s={attrs:q(e[2]),noInnerParse:f,tag:f?l:e[1]};return r.inAnchor=r.inAnchor||"a"===l,f?s.text=e[3]:s.children=c(n,o,r),r.inAnchor=!1,s},render:function(e,n,r){return o(e.tag,t({key:r.key},e.attrs),e.text||n(e.children,r))}},i[13]={match:Ue(z),order:1,parse:function(e){return{attrs:q(e[2]||""),tag:e[1]}},render:function(e,n,r){return o(e.tag,t({},e.attrs,{key:r.key}))}},i[12]={match:Ue(M),order:1,parse:function(){return{}},render:Ge},i[14]={match:Ie(Ee),order:1,parse:function(e){return{alt:e[1],target:Pe(e[2]),title:e[3]}},render:function(e,n,r){return o("img",{key:r.key,alt:e.alt||void 0,title:e.title||void 0,src:Ne(e.target)})}},i[15]={match:ze(Se),order:3,parse:function(e,n,r){return{children:De(n,e[1],r),target:Pe(e[2]),title:e[3]}},render:function(e,n,r){return o("a",{key:r.key,href:Ne(e.target),title:e.title},n(e.children,r))}},i[16]={match:ze(B),order:0,parse:function(e){return{children:[{text:e[1],type:"27"}],target:e[1],type:"15"}}},i[17]={match:function(e,n){return n.inAnchor?null:ze(R)(e,n)},order:0,parse:function(e){return{children:[{text:e[1],type:"27"}],target:e[1],title:void 0,type:"15"}}},i[18]={match:ze(U),order:0,parse:function(e){var n=e[1],r=e[1];return s.test(r)||(r="mailto:"+r),{children:[{text:n.replace("mailto:",""),type:"27"}],target:r,type:"15"}}},i[20]=we(o,1),i[33]=we(o,2),i[19]={match:Re(x),order:3,parse:We,render:function(){return"\n"}},i[21]={match:Be,order:3,parse:Fe,render:function(e,n,r){return o("p",{key:r.key},n(e.children,r))}},i[22]={match:ze(_),order:0,parse:function(e){return V[e[1]]={target:e[2],title:e[4]},{}},render:Ge},i[23]={match:Ie(D),order:0,parse:function(e){return{alt:e[1]||void 0,ref:e[2]}},render:function(e,n,r){return o("img",{key:r.key,alt:e.alt,src:Ne(V[e.ref].target),title:V[e.ref].title})}},i[24]={match:ze(H),order:0,parse:function(e,n,r){return{children:n(e[1],r),fallbackChildren:n(e[0].replace(F,"\\$1"),r),ref:e[2]}},render:function(e,n,r){return V[e.ref]?o("a",{key:r.key,href:Ne(V[e.ref].target),title:V[e.ref].title},n(e.children,r)):o("span",{key:r.key},n(e.fallbackChildren,r))}},i[25]={match:Re(P),order:1,parse:Me,render:function(e,n,r){return o("table",{key:r.key},o("thead",null,o("tr",null,e.header.map(function(t,i){return o("th",{key:i,style:je(e,i)},n(t,r))}))),o("tbody",null,e.cells.map(function(t,i){return o("tr",{key:i},t.map(function(t,i){return o("td",{key:i,style:je(e,i)},n(t,r))}))})))}},i[26]={match:function(e,n){return n.inTable?(n.inline=!0,Z.exec(e)):null},order:1,parse:function(){return{type:"26"}},render:function(){return" | "}},i[27]={match:Ue(te),order:4,parse:function(e){return{text:e[0].replace(L,function(e,r){return n.namedCodesToUnicode[r]?n.namedCodesToUnicode[r]:e})}},render:function(e){return e.text}},i[28]={match:Ie(K),order:2,parse:function(e,n,r){return{children:n(e[2],r)}},render:function(e,n,r){return o("strong",{key:r.key},n(e.children,r))}},i[29]={match:Ie(Y),order:3,parse:function(e,n,r){return{children:n(e[2],r)}},render:function(e,n,r){return o("em",{key:r.key},n(e.children,r))}},i[30]={match:Ie(re),order:1,parse:function(e){return{text:e[1],type:"27"}}},i[31]={match:Ie(ee),order:3,parse:Fe,render:function(e,n,r){return o("mark",{key:r.key},n(e.children,r))}},i[32]={match:Ie(ne),order:3,parse:Fe,render:function(e,n,r){return o("del",{key:r.key},n(e.children,r))}},i);!0===n.disableParsingRawHTML&&(delete J[11],delete J[13]);var Q,oe=function(e){var n=Object.keys(e);function r(t,i){for(var a=[],o="";t;)for(var c=0;c<n.length;){var l=n[c],u=e[l],f=u.match(t,i,o);if(f){var s=f[0];t=t.substring(s.length);var d=u.parse(f,r,i);null==d.type&&(d.type=l),a.push(d),o=s;break}c++}return a}return n.sort(function(n,r){var t=e[n].order,i=e[r].order;return t!==i?t-i:1}),function(e,n){return r(function(e){return e.replace(b,"\n").replace(S,"").replace(G," ")}(e),n)}}(J),ce=(Q=function(e,n){return function(r,t,i){var a=e[r.type].render;return n?n(function(){return a(r,t,i)},r,t,i):a(r,t,i)}}(J,n.renderRule),function e(n,r){if(void 0===r&&(r={}),Array.isArray(n)){for(var t=r.key,i=[],a=!1,o=0;o<n.length;o++){r.key=o;var c=e(n[o],r),l="string"==typeof c;l&&a?i[i.length-1]+=c:null!==c&&i.push(c),a=l}return r.key=t,i}return Q(n,e,r)}),le=d(e);return X.length?o("div",null,le,o("footer",{key:"footer"},X.map(function(e){return o("div",{id:n.slugify(e.identifier),key:e.identifier},e.identifier,ce(oe(e.footnote,{inline:!0})))}))):le}function Je(e){var n=e.children,t=e.options,i=function(e,n){if(null==e)return{};var r,t,i={},a=Object.keys(e);for(t=0;t<a.length;t++)n.indexOf(r=a[t])>=0||(i[r]=e[r]);return i}(e,o);return r.cloneElement(Ve(n,t),i)}return Object.assign(Je,{compiler:Ve}),Je}); | ||
!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):(n||self).MarkdownToJSX=e(n.React)}(this,function(n){function e(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 t=/*#__PURE__*/e(n);function r(){return r=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},r.apply(this,arguments)}var u=["children","options"],o=["allowFullScreen","allowTransparency","autoComplete","autoFocus","autoPlay","cellPadding","cellSpacing","charSet","className","classId","colSpan","contentEditable","contextMenu","crossOrigin","encType","formAction","formEncType","formMethod","formNoValidate","formTarget","frameBorder","hrefLang","inputMode","keyParams","keyType","marginHeight","marginWidth","maxLength","mediaGroup","minLength","noValidate","radioGroup","readOnly","rowSpan","spellCheck","srcDoc","srcLang","srcSet","tabIndex","useMap"].reduce(function(n,e){return n[e.toLowerCase()]=e,n},{for:"htmlFor"}),i={amp:"&",apos:"'",gt:">",lt:"<",nbsp:" ",quot:"“"},c=["style","script"],l=/([-A-Z0-9_:]+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|(?:\{((?:\\.|{[^}]*?}|[^}])*)\})))?/gi,a=/mailto:/i,f=/\n{2,}$/,s=/^( *>[^\n]+(\n[^\n]+)*\n*)+\n{2,}/,p=/^ *> ?/gm,d=/^ {2,}\n/,v=/^(?:( *[-*_])){3,} *(?:\n *)+\n/,g=/^\s*(`{3,}|~{3,}) *(\S+)?([^\n]*?)?\n([\s\S]+?)\s*\1 *(?:\n *)*\n?/,h=/^(?: {4}[^\n]+\n*)+(?:\n *)+\n?/,y=/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,m=/^(?:\n *)*\n/,k=/\r\n?/g,S=/^\[\^([^\]]+)](:.*)\n/,H=/^\[\^([^\]]+)]/,x=/\f/g,_=/^\s*?\[(x|\s)\]/,b=/^ *(#{1,6}) *([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,M=/^ *(#{1,6}) +([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,O=/^([^\n]+)\n *(=|-){3,} *(?:\n *)+\n/,I=/^ *(?!<[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,j=/^<!--[\s\S]*?(?:-->)/,A=/^(data|aria|x)-[a-z_][a-z\d_.-]*$/,G=/^ *<([a-z][a-z0-9:]*)(?:\s+((?:<.*?>|[^>])*))?\/?>(?!<\/\1>)(\s*\n)?/i,w=/^\{.*\}$/,C=/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,E=/^<([^ >]+@[^ >]+)>/,$=/^<([^ >]+:\/[^ >]+)>/,T=/-([a-z])?/gi,D=/^(.*\|?.*)\n *(\|? *[-:]+ *\|[-| :]*)\n((?:.*\|.*\n)*)\n?/,N=/^\[([^\]]*)\]:\s+<?([^\s>]+)>?\s*("([^"]*)")?/,z=/^!\[([^\]]*)\] ?\[([^\]]*)\]/,X=/^\[([^\]]*)\] ?\[([^\]]*)\]/,W=/(\[|\])/g,B=/(\n|^[-*]\s|^#|^ {2,}|^-{2,}|^>\s)/,R=/\t/g,F=/^ *\| */,P=/(^ *\||\| *$)/g,U=/ *$/,Z=/^ *:-+: *$/,q=/^ *:-+ *$/,V=/^ *-+: *$/,J=/^([*_])\1((?:\[.*?\][([].*?[)\]]|<.*?>(?:.*?<.*?>)?|`.*?`|~+.*?~+|.)*?)\1\1(?!\1)/,Q=/^([*_])((?:\[.*?\][([].*?[)\]]|<.*?>(?:.*?<.*?>)?|`.*?`|~+.*?~+|.)*?)\1(?!\1|\w)/,K=/^==((?:\[.*?\]|<.*?>(?:.*?<.*?>)?|`.*?`|.)*?)==/,Y=/^~~((?:\[.*?\]|<.*?>(?:.*?<.*?>)?|`.*?`|.)*?)~~/,nn=/^\\([^0-9A-Za-z\s])/,en=/^[\s\S]+?(?=[^0-9A-Z\s\u00c0-\uffff&#;.()'"]|\d+\.|\n\n| {2,}\n|\w+:\S|$)/i,tn=/^\n+/,rn=/^([ \t]*)/,un=/\\([^\\])/g,on=/ *\n+$/,cn=/(?:^|\n)( *)$/,ln="(?:\\d+\\.)",an="(?:[*+-])";function fn(n){return"( *)("+(1===n?ln:an)+") +"}var sn=fn(1),pn=fn(2);function dn(n){return new RegExp("^"+(1===n?sn:pn))}var vn=dn(1),gn=dn(2);function hn(n){return new RegExp("^"+(1===n?sn:pn)+"[^\\n]*(?:\\n(?!\\1"+(1===n?ln:an)+" )[^\\n]*)*(\\n|$)","gm")}var yn=hn(1),mn=hn(2);function kn(n){var e=1===n?ln:an;return new RegExp("^( *)("+e+") [\\s\\S]+?(?:\\n{2,}(?! )(?!\\1"+e+" (?!"+e+" ))\\n*|\\s*\\n*$)")}var Sn=kn(1),Hn=kn(2);function xn(n,e){var t=1===e,r=t?Sn:Hn,u=t?yn:mn,o=t?vn:gn;return{t:function(n,e,t){var u=cn.exec(t);return u&&(e.o||!e.u&&!e.i)?r.exec(n=u[1]+n):null},_:Bn.HIGH,l:function(n,e,r){var i=t?+n[2]:void 0,c=n[0].replace(f,"\n").match(u),l=!1;return{p:c.map(function(n,t){var u=o.exec(n)[0].length,i=new RegExp("^ {1,"+u+"}","gm"),a=n.replace(i,"").replace(o,""),f=t===c.length-1,s=-1!==a.indexOf("\n\n")||f&&l;l=s;var p,d=r.u,v=r.o;r.o=!0,s?(r.u=!1,p=a.replace(on,"\n\n")):(r.u=!0,p=a.replace(on,""));var g=e(p,r);return r.u=d,r.o=v,g}),m:t,g:i}},v:function(e,t,r){return n(e.m?"ol":"ul",{key:r.h,start:e.g},e.p.map(function(e,u){return n("li",{key:u},t(e,r))}))}}}var _n=/^\[([^\]]*)]\( *((?:\([^)]*\)|[^() ])*) *"?([^)"]*)?"?\)/,bn=/^!\[([^\]]*)]\( *((?:\([^)]*\)|[^() ])*) *"?([^)"]*)?"?\)/,Mn=[s,g,h,b,O,M,j,D,yn,Sn,mn,Hn],On=[].concat(Mn,[/^[^\n]+(?: \n|\n{2,})/,I,G]);function In(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 Ln(n){return V.test(n)?"right":Z.test(n)?"center":q.test(n)?"left":null}function jn(n,e,t){var r=t.k;t.k=!0;var u=e(n.trim(),t);t.k=r;var o=[[]];return u.forEach(function(n,e){"tableSeparator"===n.type?0!==e&&e!==u.length-1&&o.push([]):("text"!==n.type||null!=u[e+1]&&"tableSeparator"!==u[e+1].type||(n.S=n.S.replace(U,"")),o[o.length-1].push(n))}),o}function An(n,e,t){t.u=!0;var r=jn(n[1],e,t),u=n[2].replace(P,"").split("|").map(Ln),o=function(n,e,t){return n.trim().split("\n").map(function(n){return jn(n,e,t)})}(n[3],e,t);return t.u=!1,{$:u,A:o,H:r,type:"table"}}function Gn(n,e){return null==n.$[e]?{}:{textAlign:n.$[e]}}function wn(n){return function(e,t){return t.u?n.exec(e):null}}function Cn(n){return function(e,t){return t.u||t.i?n.exec(e):null}}function En(n){return function(e,t){return t.u||t.i?null:n.exec(e)}}function $n(n){return function(e){return n.exec(e)}}function Tn(n,e,t){if(e.u||e.i)return null;if(t&&!t.endsWith("\n"))return null;var r="";n.split("\n").every(function(n){return!Mn.some(function(e){return e.test(n)})&&(r+=n+"\n",n.trim())});var u=r.trimEnd();return""==u?null:[r,u]}function Dn(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 Nn(n){return n.replace(un,"$1")}function zn(n,e,t){var r=t.u||!1,u=t.i||!1;t.u=!0,t.i=!0;var o=n(e,t);return t.u=r,t.i=u,o}function Xn(n,e,t){var r=t.u||!1,u=t.i||!1;t.u=!1,t.i=!0;var o=n(e,t);return t.u=r,t.i=u,o}function Wn(n,e,t){return t.u=!1,n(e,t)}var Bn,Rn=function(n,e,t){return{S:zn(e,n[1],t)}};function Fn(){return{}}function Pn(){return null}function Un(){return[].slice.call(arguments).filter(Boolean).join(" ")}function Zn(n,e,t){for(var r=n,u=e.split(".");u.length&&void 0!==(r=r[u[0]]);)u.shift();return r||t}function qn(n,e){var t=Zn(e,n);return t?"function"==typeof t||"object"==typeof t&&"render"in t?t:Zn(e,n+".component",n):n}function Vn(n,e){void 0===e&&(e={}),e.overrides=e.overrides||{},e.slugify=e.slugify||In,e.namedCodesToUnicode=e.namedCodesToUnicode?r({},i,e.namedCodesToUnicode):i;var u=e.createElement||t.createElement;function f(n,t){var o=Zn(e.overrides,n+".props",{});return u.apply(void 0,[qn(n,e.overrides),r({},t,o,{className:Un(null==t?void 0:t.className,o.className)||void 0})].concat([].slice.call(arguments,2)))}function P(n){var r=!1;e.forceInline?r=!0:e.forceBlock||(r=!1===B.test(n));for(var u=cn(on(r?n:n.trimEnd().replace(tn,"")+"\n\n",{u:r}));"string"==typeof u[u.length-1]&&!u[u.length-1].trim();)u.pop();if(null===e.wrapper)return u;var o,i=e.wrapper||(r?"span":"div");if(u.length>1||e.forceWrapper)o=u;else{if(1===u.length)return"string"==typeof(o=u[0])?f("span",{key:"outer"},o):o;o=null}return t.createElement(i,{key:"outer"},o)}function U(n){var e=n.match(l);return e?e.reduce(function(n,e,r){var u=e.indexOf("=");if(-1!==u){var i=function(n){return-1!==n.indexOf("-")&&null===n.match(A)&&(n=n.replace(T,function(n,e){return e.toUpperCase()})),n}(e.slice(0,u)).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(u+1).trim()),l=o[i]||i,a=n[l]=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?Dn(e):(e.match(w)&&(e=e.slice(1,e.length-1)),"true"===e||"false"!==e&&e)}(i,c);"string"==typeof a&&(I.test(a)||G.test(a))&&(n[l]=t.cloneElement(P(a.trim()),{key:r}))}else"style"!==e&&(n[o[e]||e]=!0);return n},{}):null}var Z=[],q={},V={blockQuote:{t:En(s),_:Bn.HIGH,l:function(n,e,t){return{S:e(n[0].replace(p,""),t)}},v:function(n,e,t){return f("blockquote",{key:t.h},e(n.S,t))}},breakLine:{t:$n(d),_:Bn.HIGH,l:Fn,v:function(n,e,t){return f("br",{key:t.h})}},breakThematic:{t:En(v),_:Bn.HIGH,l:Fn,v:function(n,e,t){return f("hr",{key:t.h})}},codeBlock:{t:En(h),_:Bn.MAX,l:function(n){return{S:n[0].replace(/^ {4}/gm,"").replace(/\n+$/,""),L:void 0}},v:function(n,e,t){return console.log("AHHHHHHHH"),"latex"===n.L?f("div",{key:t.h},n.S):f("pre",{key:t.h},f("code",r({},n.M,{className:n.L?"lang-"+n.L:""}),n.S))}},codeFenced:{t:En(g),_:Bn.MAX,l:function(n){return console.log(n),{M:U(n[3]||""),S:n[4],L:n[2]||void 0,type:"codeBlock"}}},codeInline:{t:Cn(y),_:Bn.LOW,l:function(n){return{S:n[2]}},v:function(n,e,t){return f("code",{key:t.h},n.S)}},footnote:{t:En(S),_:Bn.MAX,l:function(n){return Z.push({O:n[2],I:n[1]}),{}},v:Pn},footnoteReference:{t:wn(H),_:Bn.HIGH,l:function(n){return{S:n[1],j:"#"+e.slugify(n[1])}},v:function(n,e,t){return f("a",{key:t.h,href:Dn(n.j)},f("sup",{key:t.h},n.S))}},gfmTask:{t:wn(_),_:Bn.HIGH,l:function(n){return{B:"x"===n[1].toLowerCase()}},v:function(n,e,t){return f("input",{checked:n.B,key:t.h,readOnly:!0,type:"checkbox"})}},heading:{t:En(e.enforceAtxHeadings?M:b),_:Bn.HIGH,l:function(n,t,r){return{S:zn(t,n[2],r),R:e.slugify(n[2]),T:n[1].length}},v:function(n,e,t){return f("h"+n.T,{id:n.R,key:t.h},e(n.S,t))}},headingSetext:{t:En(O),_:Bn.MAX,l:function(n,e,t){return{S:zn(e,n[1],t),T:"="===n[2]?1:2,type:"heading"}}},htmlComment:{t:$n(j),_:Bn.HIGH,l:function(){return{}},v:Pn},image:{t:Cn(bn),_:Bn.HIGH,l:function(n){return{C:n[1],j:Nn(n[2]),D:n[3]}},v:function(n,e,t){return f("img",{key:t.h,alt:n.C||void 0,title:n.D||void 0,src:Dn(n.j)})}},link:{t:wn(_n),_:Bn.LOW,l:function(n,e,t){return{S:Xn(e,n[1],t),j:Nn(n[2]),D:n[3]}},v:function(n,e,t){return f("a",{key:t.h,href:Dn(n.j),title:n.D},e(n.S,t))}},linkAngleBraceStyleDetector:{t:wn($),_:Bn.MAX,l:function(n){return{S:[{S:n[1],type:"text"}],j:n[1],type:"link"}}},linkBareUrlDetector:{t:function(n,e){return e.F?null:wn(C)(n,e)},_:Bn.MAX,l:function(n){return{S:[{S:n[1],type:"text"}],j:n[1],D:void 0,type:"link"}}},linkMailtoDetector:{t:wn(E),_:Bn.MAX,l:function(n){var e=n[1],t=n[1];return a.test(t)||(t="mailto:"+t),{S:[{S:e.replace("mailto:",""),type:"text"}],j:t,type:"link"}}},orderedList:xn(f,1),unorderedList:xn(f,2),newlineCoalescer:{t:En(m),_:Bn.LOW,l:Fn,v:function(){return"\n"}},paragraph:{t:Tn,_:Bn.LOW,l:Rn,v:function(n,e,t){return f("p",{key:t.h},e(n.S,t))}},ref:{t:wn(N),_:Bn.MAX,l:function(n){return q[n[1]]={j:n[2],D:n[4]},{}},v:Pn},refImage:{t:Cn(z),_:Bn.MAX,l:function(n){return{C:n[1]||void 0,N:n[2]}},v:function(n,e,t){return f("img",{key:t.h,alt:n.C,src:Dn(q[n.N].j),title:q[n.N].D})}},refLink:{t:wn(X),_:Bn.MAX,l:function(n,e,t){return{S:e(n[1],t),P:e(n[0].replace(W,"\\$1"),t),N:n[2]}},v:function(n,e,t){return q[n.N]?f("a",{key:t.h,href:Dn(q[n.N].j),title:q[n.N].D},e(n.S,t)):f("span",{key:t.h},e(n.P,t))}},table:{t:En(D),_:Bn.HIGH,l:An,v:function(n,e,t){return f("table",{key:t.h},f("thead",null,f("tr",null,n.H.map(function(r,u){return f("th",{key:u,style:Gn(n,u)},e(r,t))}))),f("tbody",null,n.A.map(function(r,u){return f("tr",{key:u},r.map(function(r,u){return f("td",{key:u,style:Gn(n,u)},e(r,t))}))})))}},tableSeparator:{t:function(n,e){return e.k?(e.u=!0,F.exec(n)):null},_:Bn.HIGH,l:function(){return{type:"tableSeparator"}},v:function(){return" | "}},text:{t:$n(en),_:Bn.MIN,l:function(n){return{S:n[0].replace(L,function(n,t){return e.namedCodesToUnicode[t]?e.namedCodesToUnicode[t]:n})}},v:function(n){return n.S}},textBolded:{t:Cn(J),_:Bn.MED,l:function(n,e,t){return{S:e(n[2],t)}},v:function(n,e,t){return f("strong",{key:t.h},e(n.S,t))}},textEmphasized:{t:Cn(Q),_:Bn.LOW,l:function(n,e,t){return{S:e(n[2],t)}},v:function(n,e,t){return f("em",{key:t.h},e(n.S,t))}},textEscaped:{t:Cn(nn),_:Bn.HIGH,l:function(n){return{S:n[1],type:"text"}}},textMarked:{t:Cn(K),_:Bn.LOW,l:Rn,v:function(n,e,t){return f("mark",{key:t.h},e(n.S,t))}},textStrikethroughed:{t:Cn(Y),_:Bn.LOW,l:Rn,v:function(n,e,t){return f("del",{key:t.h},e(n.S,t))}}};!0!==e.disableParsingRawHTML&&(V.htmlBlock={t:$n(I),_:Bn.HIGH,l:function(n,e,t){var r,u=n[3].match(rn),o=new RegExp("^"+u[1],"gm"),i=n[3].replace(o,""),l=(r=i,On.some(function(n){return n.test(r)})?Wn:zn),a=n[1].toLowerCase(),f=-1!==c.indexOf(a);t.F=t.F||"a"===a;var s=f?n[3]:l(e,i,t);return t.F=!1,{M:U(n[2]),S:s,Z:f,G:f?a:n[1]}},v:function(n,e,t){return f(n.G,r({key:t.h},n.M),n.Z?n.S:e(n.S,t))}},V.htmlSelfClosing={t:$n(G),_:Bn.HIGH,l:function(n){return{M:U(n[2]||""),G:n[1]}},v:function(n,e,t){return f(n.G,r({},n.M,{key:t.h}))}});var un,on=function(n){var e=Object.keys(n);function t(r,u){for(var o=[],i="";r;)for(var c=0;c<e.length;){var l=e[c],a=n[l],f=a.t(r,u,i);if(f){var s=f[0];r=r.substring(s.length);var p=a.l(f,t,u);null==p.type&&(p.type=l),o.push(p),i=s;break}c++}return o}return e.sort(function(e,t){var r=n[e]._,u=n[t]._;return r!==u?r-u:e<t?-1:1}),function(n,e){return t(function(n){return n.replace(k,"\n").replace(x,"").replace(R," ")}(n),e)}}(V),cn=(un=function(n){return function(e,t,r){return n[e.type].v(e,t,r)}}(V),function n(e,t){if(void 0===t&&(t={}),Array.isArray(e)){for(var r=t.h,u=[],o=!1,i=0;i<e.length;i++){t.h=i;var c=n(e[i],t),l="string"==typeof c;l&&o?u[u.length-1]+=c:null!==c&&u.push(c),o=l}return t.h=r,u}return un(e,n,t)}),ln=P(n);return Z.length?f("div",null,ln,f("footer",{key:"footer"},Z.map(function(n){return f("div",{id:e.slugify(n.I),key:n.I},n.I,cn(on(n.O,{u:!0})))}))):ln}function Jn(n){var e=n.children,r=n.options,o=function(n,e){if(null==n)return{};var t,r,u={},o=Object.keys(n);for(r=0;r<o.length;r++)e.indexOf(t=o[r])>=0||(u[t]=n[t]);return u}(n,u);return t.cloneElement(Vn(e,r),o)}return function(n){n[n.MAX=0]="MAX",n[n.HIGH=1]="HIGH",n[n.MED=2]="MED",n[n.LOW=3]="LOW",n[n.MIN=4]="MIN"}(Bn||(Bn={})),Object.assign(Jn,{compiler:Vn}),Jn}); | ||
//# sourceMappingURL=index.umd.js.map |
@@ -6,3 +6,3 @@ { | ||
"license": "MIT", | ||
"version": "7.4.0", | ||
"version": "7.4.1", | ||
"engines": { | ||
@@ -9,0 +9,0 @@ "node": ">= 10" |
@@ -412,3 +412,3 @@ **markdown-to-jsx** | ||
````tsx | ||
import { Markdown, RuleType } from 'markdown-to-jsx' | ||
import Markdown, { RuleType } from 'markdown-to-jsx' | ||
import TeX from '@matejmazur/react-katex' | ||
@@ -424,3 +424,3 @@ | ||
options={{ | ||
renderRule(next, node, renderAST, state) { | ||
renderRule(next, node, renderChildren, state) { | ||
if (node.type === RuleType.codeBlock && node.lang === 'latex') { | ||
@@ -648,4 +648,4 @@ return ( | ||
Like this library? It's developed entirely on a volunteer basis; chip in a few bucks if you can at my [Patreon](https://www.patreon.com/bePatron?u=27436864). | ||
Like this library? It's developed entirely on a volunteer basis; chip in a few bucks if you can via the Sponsor link! | ||
MIT |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
437994
16
715
0
3