diff --git a/simple-markdown.min.js b/simple-markdown.min.js index e6a5d65..a005b88 100644 --- a/simple-markdown.min.js +++ b/simple-markdown.min.js @@ -1 +1 @@ -!function(){function r(t){return t.replace(k,"\n").replace(w,"").replace(x," ")}function c(t,n){var e=t||{};if(null!=n)for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r]);return e}function t(m,e){var y=Object.keys(m).filter(function(t){var n=m[t];if(null==n||null==n.match)return!1;var e=n.order;return"number"==typeof e&&isFinite(e)||"undefined"==typeof console||console.warn("simple-markdown: Invalid order for rule `"+t+"`: "+String(e)),!0});y.sort(function(t,n){var e=m[t],r=m[n],l=e.order,a=r.order;if(l!==a)return l-a;var o=e.quality?0:1,u=r.quality?0:1;return o!=u?o-u:t";return r?u+n+"":u}function a(t){if(null==t)return null;try{var n=decodeURIComponent(t).replace(/[^A-Za-z0-9/:]/g,"").toLowerCase();if(0===n.indexOf("javascript:")||0===n.indexOf("vbscript:")||0===n.indexOf("data:"))return null}catch(t){return null}return t}function i(t){return t.replace(R,"$1")}function f(t,n,e){var r=e.inline||!1;e.inline=!0;var l=t(n,e);return e.inline=r,l}function s(t,n,e){return{content:f(n,t[1],e)}}function p(){return{}}function d(t){return String(t).replace(E,function(t){return S[t]})}var h,m,y,g,v,k=/\r\n?/g,x=/\t/g,w=/\f/g,b="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,_={},E=/[<>&"']/g,S={"<":"<",">":">","&":"&",'"':""","'":"'","/":"/","`":"`"},R=/\\([^0-9A-Za-z\s])/g,A="(?:[*+-]|\\d+\\.)",$="( *)("+A+") +",O=new RegExp("^"+$),T=new RegExp($+"[^\\n]*(?:\\n(?!\\1"+A+" )[^\\n]*)*(\n|$)","gm"),P=/\n{2,}$/,j=/^ ( *` *) $|^ ( *`)|(` *) $/g,q=P,B=/ *\n+$/,F=new RegExp("^( *)("+A+") [\\s\\S]+?(?:\n{2,}(?! )(?!\\1"+A+" )\\n*|\\s*\n*$)"),N=/(?:^|\n)( *)$/,C=(h=/^ *\| *| *\| *$/g,m=/ *$/,y=/^ *-+: *$/,g=/^ *:-+: *$/,v=/^ *:-+ *$/,{parseTable:z(!0),parseNpTable:z(!1),TABLE_REGEX:/^ *(\|.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/,NPTABLE_REGEX:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/});function I(t){return y.test(t)?"right":g.test(t)?"center":v.test(t)?"left":null}function L(t,n,e,r){var l=e.inTable;e.inTable=!0;var a=n(t.trim(),e);e.inTable=l;var o=[[]];return a.forEach(function(t,n){"tableSeparator"===t.type?r&&(0===n||n===a.length-1)||o.push([]):("text"!==t.type||null!=a[n+1]&&"tableSeparator"!==a[n+1].type||(t.content=t.content.replace(m,"")),o[o.length-1].push(t))}),o}function z(s){return function(t,n,e){e.inline=!0;var r,l,a,o,u,c=L(t[1],n,e,s),i=(u=t[2],s&&(u=u.replace(h,"")),u.trim().split("|").map(I)),f=(r=t[3],l=n,a=e,o=s,r.trim().split("\n").map(function(t){return L(t,l,a,o)}));return e.inline=!1,{type:"table",header:c,align:i,cells:f}}}function G(t,n,e){var r=(t[2]||t[1]).replace(/\s+/g," ").toLowerCase();if(n._defs&&n._defs[r]){var l=n._defs[r];e.target=l.target,e.title=l.title}return n._refs=n._refs||{},n._refs[r]=n._refs[r]||[],n._refs[r].push(e),e}function X(e,r,l){if(!r)throw new Error("simple-markdown: outputFor: `property` must be defined. if you just upgraded, you probably need to replace `outputFor` with `reactFor`");var a,o=e.Array||K.Array,u=function(t,n){return a=n=n||a,Array.isArray(t)?o[r](t,u,n):e[t.type][r](t,u,n)};return function(t,n){return a=c(n,l),u(t,a)}}function Z(t,n){return(n=n||{}).inline=!1,V(t,n)}function M(t,n){var e=P.test(t);return(n=n||{}).inline=!e,V(t,n)}function U(t,n){return W(Z(t,n),n)}var H="(?:\\[[^\\]]*\\]|[^\\[\\]]|\\](?=[^\\[]*\\]))*",D="\\s*?(?:\\s+['\"]([\\s\\S]*?)['\"])?\\s*",Q=/mailto:/i,J=0,K={Array:{react:function(t,n,e){for(var r=e.key,l=[],a=0;a"}},codeBlock:{order:J++,match:e(/^(?: [^\n]+\n*)+(?:\n *)+\n/),parse:function(t,n,e){return{lang:void 0,content:t[0].replace(/^ /gm,"").replace(/\n+$/,"")}},react:function(t,n,e){var r=t.lang?"markdown-code-"+t.lang:void 0;return o("pre",e.key,{children:o("code",null,{className:r,children:t.content})})},html:function(t,n,e){var r=t.lang?"markdown-code-"+t.lang:void 0;return u("pre",u("code",d(t.content),{class:r}))}},fence:{order:J++,match:e(/^ *(`{3,}|~{3,}) *(?:(\S+) *)?\n([\s\S]+?)\n?\1 *(?:\n *)+\n/),parse:function(t,n,e){return{type:"codeBlock",lang:t[2]||void 0,content:t[3]}},react:null,html:null},blockQuote:{order:J++,match:e(/^( *>[^\n]+(\n[^\n]+)*\n*)+\n{2,}/),parse:function(t,n,e){return{content:n(t[0].replace(/^ *> ?/gm,""),e)}},react:function(t,n,e){return o("blockquote",e.key,{children:n(t.content,e)})},html:function(t,n,e){return u("blockquote",n(t.content,e))}},list:{order:J++,match:function(t,n,e){var r=N.exec(e),l=n._list||!n.inline;return r&&l?(t=r[1]+t,F.exec(t),F.exec(t)):null},parse:function(t,p,d){var n=t[2],e=1]*)>?(?: +["(]([^\n]+)[")])? *\n(?: *\n)*/),parse:function(t,n,e){var r=t[1].replace(/\s+/g," ").toLowerCase(),l=t[2],a=t[3];return e._refs&&e._refs[r]&&e._refs[r].forEach(function(t){t.target=l,t.title=a}),e._defs=e._defs||{},e._defs[r]={target:l,title:a},{def:r,target:l,title:a}},react:function(){return null},html:function(){return""}},table:{order:J++,match:e(C.TABLE_REGEX),parse:C.parseTable,react:function(n,e,r){function l(t){return null==n.align[t]?{}:{textAlign:n.align[t]}}var t=n.header.map(function(t,n){return o("th",""+n,{style:l(n),scope:"col",children:e(t,r)})}),a=n.cells.map(function(t,n){return o("tr",""+n,{children:t.map(function(t,n){return o("td",""+n,{style:l(n),children:e(t,r)})})})});return o("table",r.key,{children:[o("thead","thead",{children:o("tr",null,{children:t})}),o("tbody","tbody",{children:a})]})},html:function(n,e,r){function l(t){return null==n.align[t]?"":"text-align:"+n.align[t]+";"}var t=n.header.map(function(t,n){return u("th",e(t,r),{style:l(n),scope:"col"})}).join(""),a=n.cells.map(function(t){return u("tr",t.map(function(t,n){return u("td",e(t,r),{style:l(n)})}).join(""))}).join("");return u("table",u("thead",u("tr",t))+u("tbody",a))}},newline:{order:J++,match:e(/^(?:\n *)*\n/),parse:p,react:function(t,n,e){return"\n"},html:function(t,n,e){return"\n"}},paragraph:{order:J++,match:e(/^((?:[^\n]|\n(?! *\n))+)(?:\n *)+\n/),parse:s,react:function(t,n,e){return o("div",e.key,{className:"paragraph",children:n(t.content,e)})},html:function(t,n,e){return u("div",n(t.content,e),{class:"paragraph"})}},escape:{order:J++,match:n(/^\\([^0-9A-Za-z\s])/),parse:function(t,n,e){return{type:"text",content:t[1]}},react:null,html:null},tableSeparator:{order:J++,match:function(t,n){return n.inTable?/^ *\| */.exec(t):null},parse:function(){return{type:"tableSeparator"}},react:function(){return" | "},html:function(){return" | "}},autolink:{order:J++,match:n(/^<([^ >]+:\/[^ >]+)>/),parse:function(t,n,e){return{type:"link",content:[{type:"text",content:t[1]}],target:t[1]}},react:null,html:null},mailto:{order:J++,match:n(/^<([^ >]+@[^ >]+)>/),parse:function(t,n,e){var r=t[1],l=t[1];return Q.test(l)||(l="mailto:"+l),{type:"link",content:[{type:"text",content:r}],target:l}},react:null,html:null},url:{order:J++,match:n(/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/),parse:function(t,n,e){return{type:"link",content:[{type:"text",content:t[1]}],target:t[1],title:void 0}},react:null,html:null},link:{order:J++,match:n(new RegExp("^\\[("+H+")\\]\\("+D+"\\)")),parse:function(t,n,e){return{content:n(t[1],e),target:i(t[2]),title:t[3]}},react:function(t,n,e){return o("a",e.key,{href:a(t.target),title:t.title,children:n(t.content,e)})},html:function(t,n,e){var r={href:a(t.target),title:t.title};return u("a",n(t.content,e),r)}},image:{order:J++,match:n(new RegExp("^!\\[("+H+")\\]\\("+D+"\\)")),parse:function(t,n,e){return{alt:t[1],target:i(t[2]),title:t[3]}},react:function(t,n,e){return o("img",e.key,{src:a(t.target),alt:t.alt,title:t.title})},html:function(t,n,e){return u("img","",{src:a(t.target),alt:t.alt,title:t.title},!1)}},reflink:{order:J++,match:n(new RegExp("^\\[("+H+")\\]\\s*\\[([^\\]]*)\\]")),parse:function(t,n,e){return G(t,e,{type:"link",content:n(t[1],e)})},react:null,html:null},refimage:{order:J++,match:n(new RegExp("^!\\[("+H+")\\]\\s*\\[([^\\]]*)\\]")),parse:function(t,n,e){return G(t,e,{type:"image",alt:t[1]})},react:null,html:null},em:{order:J,match:n(new RegExp("^\\b_((?:__|\\\\[\\s\\S]|[^\\\\_])+?)_\\b|^\\*(?=\\S)((?:\\*\\*|\\\\[\\s\\S]|\\s+(?:\\\\[\\s\\S]|[^\\s\\*\\\\]|\\*\\*)|[^\\s\\*\\\\])+?)\\*(?!\\*)")),quality:function(t){return t[0].length+.2},parse:function(t,n,e){return{content:n(t[2]||t[1],e)}},react:function(t,n,e){return o("em",e.key,{children:n(t.content,e)})},html:function(t,n,e){return u("em",n(t.content,e))}},strong:{order:J,match:n(/^\*\*((?:\\[\s\S]|[^\\])+?)\*\*(?!\*)/),quality:function(t){return t[0].length+.1},parse:s,react:function(t,n,e){return o("strong",e.key,{children:n(t.content,e)})},html:function(t,n,e){return u("strong",n(t.content,e))}},u:{order:J++,match:n(/^__((?:\\[\s\S]|[^\\])+?)__(?!_)/),quality:function(t){return t[0].length},parse:s,react:function(t,n,e){return o("u",e.key,{children:n(t.content,e)})},html:function(t,n,e){return u("u",n(t.content,e))}},del:{order:J++,match:n(/^~~(?=\S)((?:\\[\s\S]|~(?!~)|[^\s~]|\s(?!~~))+?)~~/),parse:s,react:function(t,n,e){return o("del",e.key,{children:n(t.content,e)})},html:function(t,n,e){return u("del",n(t.content,e))}},inlineCode:{order:J++,match:n(/^(`+)([\s\S]*?[^`])\1(?!`)/),parse:function(t,n,e){return{content:t[2].replace(j,"$1")}},react:function(t,n,e){return o("code",e.key,{children:t.content})},html:function(t,n,e){return u("code",d(t.content))}},br:{order:J++,match:l(/^ {2,}\n/),parse:p,react:function(t,n,e){return o("br",e.key,_)},html:function(t,n,e){return"
"}},text:{order:J++,match:l(/^[\s\S]+?(?=[^0-9A-Za-z\s\u00c0-\uffff]|\n\n| {2,}\n|\w+:\S|$)/),parse:function(t,n,e){return{content:t[0]}},react:function(t,n,e){return t.content},html:function(t,n,e){return d(t.content)}}},V=t(K),W=X(K,"react"),Y=X(K,"html"),tt={defaultRules:K,parserFor:t,outputFor:X,inlineRegex:n,blockRegex:e,anyScopeRegex:l,parseInline:f,parseBlock:function(t,n,e){var r=e.inline||!1;e.inline=!1;var l=t(n+"\n\n",e);return e.inline=r,l},markdownToReact:U,markdownToHtml:function(t,n){return Y(Z(t,n),n)},ReactMarkdown:function(t){var n={};for(var e in t)"source"!==e&&Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n.children=U(t.source),o("div",null,n)},defaultBlockParse:Z,defaultInlineParse:function(t,n){return(n=n||{}).inline=!0,V(t,n)},defaultImplicitParse:M,defaultReactOutput:W,defaultHtmlOutput:Y,preprocess:r,sanitizeText:d,sanitizeUrl:a,unescapeUrl:i,htmlTag:u,reactElement:o,defaultRawParse:V,ruleOutput:function(r,l){return l||"undefined"==typeof console||console.warn("simple-markdown ruleOutput should take 'react' or 'html' as the second argument."),function(t,n,e){return r[t.type][l](t,n,e)}},reactFor:function(u){var c=function(t,n){if(n=n||{},Array.isArray(t)){for(var e=n.key,r=[],l=null,a=0;a";return r?o+t+"":o},x={},w=function(e){if(null==e)return null;try{var t=decodeURIComponent(e).replace(/[^A-Za-z0-9/:]/g,"").toLowerCase();if(0===t.indexOf("javascript:")||0===t.indexOf("vbscript:")||0===t.indexOf("data:"))return null}catch(e){return null}return e},b=/[<>&"']/g,_={"<":"<",">":">","&":"&",'"':""","'":"'","/":"/","`":"`"},E=function(e){return String(e).replace(b,function(e){return _[e]})},S=/\\([^0-9A-Za-z\s])/g,R=function(e){return e.replace(S,"$1")},A=function(e,t,n){var r=n.inline||!1;n.inline=!0;var a=e(t,n);return n.inline=r,a},$=function(e,t,n){return{content:A(t,e[1],n)}},O=function(){return{}},T="(?:[*+-]|\\d+\\.)",C="( *)("+T+") +",P=new RegExp("^"+C),j=new RegExp(C+"[^\\n]*(?:\\n(?!\\1"+T+" )[^\\n]*)*(\n|$)","gm"),q=/\n{2,}$/,B=/^ (?= *`)|(` *) $/g,F=q,N=/ *\n+$/,I=new RegExp("^( *)("+T+") [\\s\\S]+?(?:\n{2,}(?! )(?!\\1"+T+" )\\n*|\\s*\n*$)"),L=/(?:^|\n)( *)$/,z=(s=/^ *\| *| *\| *$/g,o=/ *$/,t=/^ *-+: *$/,n=/^ *:-+: *$/,r=/^ *:-+ *$/,d=function(e){return t.test(e)?"right":n.test(e)?"center":r.test(e)?"left":null},h=function(e,t,n,r){var a=n.inTable;n.inTable=!0;var l=t(e.trim(),n);n.inTable=a;var u=[[]];return l.forEach(function(e,t){"tableSeparator"===e.type?(!r||0!==t&&t!==l.length-1)&&u.push([]):("text"!==e.type||null!=l[t+1]&&"tableSeparator"!==l[t+1].type||(e.content=e.content.replace(o,"")),u[u.length-1].push(e))}),u},{parseTable:(e=function(p){return function(e,t,n){n.inline=!0;var r,a,l,u,o,c=h(e[1],t,n,p),i=(r=e[2],p&&(r=r.replace(s,"")),r.trim().split("|").map(d)),f=(a=e[3],l=t,u=n,o=p,a.trim().split("\n").map(function(e){return h(e,l,u,o)}));return n.inline=!1,{type:"table",header:c,align:i,cells:f}}})(!0),parseNpTable:e(!1),TABLE_REGEX:/^ *(\|.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/,NPTABLE_REGEX:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/}),G="(?:\\[[^\\]]*\\]|[^\\[\\]]|\\](?=[^\\[]*\\]))*",X="\\s*?(?:\\s+['\"]([\\s\\S]*?)['\"])?\\s*",Z=/mailto:/i,M=function(e,t,n){var r=(e[2]||e[1]).replace(/\s+/g," ").toLowerCase();if(t._defs&&t._defs[r]){var a=t._defs[r];n.target=a.target,n.title=a.title}return t._refs=t._refs||{},t._refs[r]=t._refs[r]||[],t._refs[r].push(n),n},U=0,H={Array:{react:function(e,t,n){for(var r=n.key,a=[],l=0,u=0;l"}},codeBlock:{order:U++,match:m(/^(?: [^\n]+\n*)+(?:\n *)+\n/),parse:function(e,t,n){return{lang:void 0,content:e[0].replace(/^ /gm,"").replace(/\n+$/,"")}},react:function(e,t,n){var r=e.lang?"markdown-code-"+e.lang:void 0;return v("pre",n.key,{children:v("code",null,{className:r,children:e.content})})},html:function(e,t,n){var r=e.lang?"markdown-code-"+e.lang:void 0,a=k("code",E(e.content),{class:r});return k("pre",a)}},fence:{order:U++,match:m(/^ *(`{3,}|~{3,}) *(?:(\S+) *)?\n([\s\S]+?)\n?\1 *(?:\n *)+\n/),parse:function(e,t,n){return{type:"codeBlock",lang:e[2]||void 0,content:e[3]}},react:null,html:null},blockQuote:{order:U++,match:m(/^( *>[^\n]+(\n[^\n]+)*\n*)+\n{2,}/),parse:function(e,t,n){return{content:t(e[0].replace(/^ *> ?/gm,""),n)}},react:function(e,t,n){return v("blockquote",n.key,{children:t(e.content,n)})},html:function(e,t,n){return k("blockquote",t(e.content,n))}},list:{order:U++,match:function(e,t){var n=null==t.prevCapture?"":t.prevCapture[0],r=L.exec(n),a=t._list||!t.inline;return r&&a?(e=r[1]+e,I.exec(e),I.exec(e)):null},parse:function(e,s,d){var t=e[2],n=1]*)>?(?: +["(]([^\n]+)[")])? *\n(?: *\n)*/),parse:function(e,t,n){var r=e[1].replace(/\s+/g," ").toLowerCase(),a=e[2],l=e[3];return n._refs&&n._refs[r]&&n._refs[r].forEach(function(e){e.target=a,e.title=l}),n._defs=n._defs||{},n._defs[r]={target:a,title:l},{def:r,target:a,title:l}},react:function(){return null},html:function(){return""}},table:{order:U++,match:m(z.TABLE_REGEX),parse:z.parseTable,react:function(t,n,r){var a=function(e){return null==t.align[e]?{}:{textAlign:t.align[e]}},e=t.header.map(function(e,t){return v("th",""+t,{style:a(t),scope:"col",children:n(e,r)})}),l=t.cells.map(function(e,t){return v("tr",""+t,{children:e.map(function(e,t){return v("td",""+t,{style:a(t),children:n(e,r)})})})});return v("table",r.key,{children:[v("thead","thead",{children:v("tr",null,{children:e})}),v("tbody","tbody",{children:l})]})},html:function(t,n,r){var a=function(e){return null==t.align[e]?"":"text-align:"+t.align[e]+";"},e=t.header.map(function(e,t){return k("th",n(e,r),{style:a(t),scope:"col"})}).join(""),l=t.cells.map(function(e){var t=e.map(function(e,t){return k("td",n(e,r),{style:a(t)})}).join("");return k("tr",t)}).join(""),u=k("thead",k("tr",e)),o=k("tbody",l);return k("table",u+o)}},newline:{order:U++,match:m(/^(?:\n *)*\n/),parse:O,react:function(e,t,n){return"\n"},html:function(e,t,n){return"\n"}},paragraph:{order:U++,match:m(/^((?:[^\n]|\n(?! *\n))+)(?:\n *)+\n/),parse:$,react:function(e,t,n){return v("div",n.key,{className:"paragraph",children:t(e.content,n)})},html:function(e,t,n){return k("div",t(e.content,n),{class:"paragraph"})}},escape:{order:U++,match:p(/^\\([^0-9A-Za-z\s])/),parse:function(e,t,n){return{type:"text",content:e[1]}},react:null,html:null},tableSeparator:{order:U++,match:function(e,t){return t.inTable?/^ *\| */.exec(e):null},parse:function(){return{type:"tableSeparator"}},react:function(){return" | "},html:function(){return" | "}},autolink:{order:U++,match:p(/^<([^ >]+:\/[^ >]+)>/),parse:function(e,t,n){return{type:"link",content:[{type:"text",content:e[1]}],target:e[1]}},react:null,html:null},mailto:{order:U++,match:p(/^<([^ >]+@[^ >]+)>/),parse:function(e,t,n){var r=e[1],a=e[1];return Z.test(a)||(a="mailto:"+a),{type:"link",content:[{type:"text",content:r}],target:a}},react:null,html:null},url:{order:U++,match:p(/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/),parse:function(e,t,n){return{type:"link",content:[{type:"text",content:e[1]}],target:e[1],title:void 0}},react:null,html:null},link:{order:U++,match:p(new RegExp("^\\[("+G+")\\]\\("+X+"\\)")),parse:function(e,t,n){return{content:t(e[1],n),target:R(e[2]),title:e[3]}},react:function(e,t,n){return v("a",n.key,{href:w(e.target),title:e.title,children:t(e.content,n)})},html:function(e,t,n){var r={href:w(e.target),title:e.title};return k("a",t(e.content,n),r)}},image:{order:U++,match:p(new RegExp("^!\\[("+G+")\\]\\("+X+"\\)")),parse:function(e,t,n){return{alt:e[1],target:R(e[2]),title:e[3]}},react:function(e,t,n){return v("img",n.key,{src:w(e.target),alt:e.alt,title:e.title})},html:function(e,t,n){var r={src:w(e.target),alt:e.alt,title:e.title};return k("img","",r,!1)}},reflink:{order:U++,match:p(new RegExp("^\\[("+G+")\\]\\s*\\[([^\\]]*)\\]")),parse:function(e,t,n){return M(e,n,{type:"link",content:t(e[1],n)})},react:null,html:null},refimage:{order:U++,match:p(new RegExp("^!\\[("+G+")\\]\\s*\\[([^\\]]*)\\]")),parse:function(e,t,n){return M(e,n,{type:"image",alt:e[1]})},react:null,html:null},em:{order:U,match:p(new RegExp("^\\b_((?:__|\\\\[\\s\\S]|[^\\\\_])+?)_\\b|^\\*(?=\\S)((?:\\*\\*|\\\\[\\s\\S]|\\s+(?:\\\\[\\s\\S]|[^\\s\\*\\\\]|\\*\\*)|[^\\s\\*\\\\])+?)\\*(?!\\*)")),quality:function(e){return e[0].length+.2},parse:function(e,t,n){return{content:t(e[2]||e[1],n)}},react:function(e,t,n){return v("em",n.key,{children:t(e.content,n)})},html:function(e,t,n){return k("em",t(e.content,n))}},strong:{order:U,match:p(/^\*\*((?:\\[\s\S]|[^\\])+?)\*\*(?!\*)/),quality:function(e){return e[0].length+.1},parse:$,react:function(e,t,n){return v("strong",n.key,{children:t(e.content,n)})},html:function(e,t,n){return k("strong",t(e.content,n))}},u:{order:U++,match:p(/^__((?:\\[\s\S]|[^\\])+?)__(?!_)/),quality:function(e){return e[0].length},parse:$,react:function(e,t,n){return v("u",n.key,{children:t(e.content,n)})},html:function(e,t,n){return k("u",t(e.content,n))}},del:{order:U++,match:p(/^~~(?=\S)((?:\\[\s\S]|~(?!~)|[^\s~]|\s(?!~~))+?)~~/),parse:$,react:function(e,t,n){return v("del",n.key,{children:t(e.content,n)})},html:function(e,t,n){return k("del",t(e.content,n))}},inlineCode:{order:U++,match:p(/^(`+)([\s\S]*?[^`])\1(?!`)/),parse:function(e,t,n){return{content:e[2].replace(B,"$1")}},react:function(e,t,n){return v("code",n.key,{children:e.content})},html:function(e,t,n){return k("code",E(e.content))}},br:{order:U++,match:y(/^ {2,}\n/),parse:O,react:function(e,t,n){return v("br",n.key,x)},html:function(e,t,n){return"
"}},text:{order:U++,match:y(/^[\s\S]+?(?=[^0-9A-Za-z\s\u00c0-\uffff]|\n\n| {2,}\n|\w+:\S|$)/),parse:function(e,t,n){return{content:e[0]}},react:function(e,t,n){return e.content},html:function(e,t,n){return E(e.content)}}},D=function(n,r,a){if(!r)throw new Error("simple-markdown: outputFor: `property` must be defined. if you just upgraded, you probably need to replace `outputFor` with `reactFor`");var l,u=n.Array||H.Array,o=function(e,t){return l=t=t||l,Array.isArray(e)?u[r](e,o,t):n[e.type][r](e,o,t)};return function(e,t){return l=i(t,a),o(e,l)}},Q=f(H),J=function(e,t){return(t=t||{}).inline=!1,Q(e,t)},K=function(e,t){var n=q.test(e);return(t=t||{}).inline=!n,Q(e,t)},V=D(H,"react"),W=D(H,"html"),Y=function(e,t){return V(J(e,t),t)},ee={defaultRules:H,parserFor:f,outputFor:D,inlineRegex:p,blockRegex:m,anyScopeRegex:y,parseInline:A,parseBlock:function(e,t,n){var r=n.inline||!1;n.inline=!1;var a=e(t+"\n\n",n);return n.inline=r,a},markdownToReact:Y,markdownToHtml:function(e,t){return W(J(e,t),t)},ReactMarkdown:function(e){var t={};for(var n in e)"source"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.children=Y(e.source),v("div",null,t)},defaultBlockParse:J,defaultInlineParse:function(e,t){return(t=t||{}).inline=!0,Q(e,t)},defaultImplicitParse:K,defaultReactOutput:V,defaultHtmlOutput:W,preprocess:c,sanitizeText:E,sanitizeUrl:w,unescapeUrl:R,htmlTag:k,reactElement:v,defaultRawParse:Q,ruleOutput:function(r,a){return a||"undefined"==typeof console||console.warn("simple-markdown ruleOutput should take 'react' or 'html' as the second argument."),function(e,t,n){return r[e.type][a](e,t,n)}},reactFor:function(o){var c=function(e,t){if(t=t||{},Array.isArray(e)){for(var n=t.key,r=[],a=null,l=0;l