From 96ef4eaac0842c288dacca968034e807acf3bb35 Mon Sep 17 00:00:00 2001 From: Aria Buckles Date: Sun, 4 Aug 2019 18:27:08 -0700 Subject: [PATCH] v0.5.0 --- package.json | 2 +- simple-markdown.min.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 0c2fae6..2b4c8c0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "simple-markdown", - "version": "0.4.4", + "version": "0.5.0", "description": "Javascript markdown parsing, made simple", "main": "simple-markdown.js", "scripts": { diff --git a/simple-markdown.min.js b/simple-markdown.min.js index f3a0124..68c73f4 100644 --- a/simple-markdown.min.js +++ b/simple-markdown.min.js @@ -1 +1 @@ -!function(){var c,i,f,s,p,t,e,r,l,d,h,u=/\r\n?/g,a=/\t/g,o=/\f/g,k=function(n){return n.replace(u,"\n").replace(o,"").replace(a," ")},w=function(n,t){var e=n||{};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},n=function(m,e){var g,y=Object.keys(m).filter(function(n){var t=m[n];if(null==t||null==t.match)return!1;var e=t.order;return"number"==typeof e&&isFinite(e)||"undefined"==typeof console||console.warn("simple-markdown: Invalid order for rule `"+n+"`: "+String(e)),!0});y.sort(function(n,t){var e=m[n],r=m[t],l=e.order,u=r.order;if(l!==u)return l-u;var a=e.quality?0:1,o=r.quality?0:1;return a!==o?a-o:n";return r?o+t+"":o},_={},S=function(n){if(null==n)return null;try{var t=decodeURIComponent(n).replace(/[^A-Za-z0-9/:]/g,"").toLowerCase();if(0===t.indexOf("javascript:")||0===t.indexOf("vbscript:")||0===t.indexOf("data:"))return null}catch(n){return null}return n},E=/[<>&"']/g,R={"<":"<",">":">","&":"&",'"':""","'":"'","/":"/","`":"`"},A=function(n){return String(n).replace(E,function(n){return R[n]})},$=/\\([^0-9A-Za-z\s])/g,O=function(n){return n.replace($,"$1")},P=function(n,t,e){var r=e.inline||!1;e.inline=!0;var l=n(t,e);return e.inline=r,l},j=function(n,t,e){return{content:P(t,n[1],e)}},q=function(){return{}},T="(?:[*+-]|\\d+\\.)",F="( *)("+T+") +",N=new RegExp("^"+F),B=new RegExp(F+"[^\\n]*(?:\\n(?!\\1"+T+" )[^\\n]*)*(\n|$)","gm"),C=/\n{2,}$/,I=C,z=/ *\n+$/,L=new RegExp("^( *)("+T+") [\\s\\S]+?(?:\n{2,}(?! )(?!\\1"+T+" )\\n*|\\s*\n*$)"),Z=/(?:^|\n)( *)$/,G=(c=/^ *| *\| *$/g,i=/\n+$/,f=/^ *\| *| *\| *$/g,s=/^ *| *$/g,p=/ *\| */,t=/^ *-+: *$/,e=/^ *:-+: *$/,r=/^ *:-+ *$/,l=function(n){return t.test(n)?"right":e.test(n)?"center":r.test(n)?"left":null},d=function(n,t,e,r){return t[1].replace(n,"").split(p).map(function(n){return e(n,r)})},h=function(n,t,e,r){return t[2].replace(n,"").split(p).map(l)},{parseTable:function(n,t,e){e.inline=!0;var r,l,u=d(c,n,t,e),a=h(c,n),o=(r=t,l=e,n[3].replace(i,"").split("\n").map(function(n){return n.replace(f,"").split(p).map(function(n){return r(n,l)})}));return e.inline=!1,{type:"table",header:u,align:a,cells:o}},parseNpTable:function(n,t,e){e.inline=!0;var r,l,u=d(s,n,t,e),a=h(s,n),o=(r=t,l=e,n[3].replace(i,"").split("\n").map(function(n){return n.split(p).map(function(n){return r(n,l)})}));return e.inline=!1,{type:"table",header:u,align:a,cells:o}},NPTABLE_REGEX:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/}),M="(?:\\[[^\\]]*\\]|[^\\[\\]]|\\](?=[^\\[]*\\]))*",U="\\s*?(?:\\s+['\"]([\\s\\S]*?)['\"])?\\s*",H=/mailto:/i,X=function(n,t,e){var r=(n[2]||n[1]).replace(/\s+/g," ").toLowerCase();if(t._defs&&t._defs[r]){var l=t._defs[r];e.target=l.target,e.title=l.title}return t._refs=t._refs||{},t._refs[r]=t._refs[r]||[],t._refs[r].push(e),e},D=0,Q={Array:{react:function(n,t,e){for(var r=e.key,l=[],u=0,a=0;u"}},codeBlock:{order:D++,match:g(/^(?: [^\n]+\n*)+(?:\n *)+\n/),parse:function(n,t,e){return{lang:void 0,content:n[0].replace(/^ /gm,"").replace(/\n+$/,"")}},react:function(n,t,e){var r=n.lang?"markdown-code-"+n.lang:void 0;return x("pre",e.key,{children:x("code",null,{className:r,children:n.content})})},html:function(n,t,e){var r=n.lang?"markdown-code-"+n.lang:void 0,l=b("code",A(n.content),{class:r});return b("pre",l)}},fence:{order:D++,match:g(/^ *(`{3,}|~{3,}) *(\S+)? *\n([\s\S]+?)\s*\1 *(?:\n *)+\n/),parse:function(n,t,e){return{type:"codeBlock",lang:n[2]||void 0,content:n[3]}},react:null,html:null},blockQuote:{order:D++,match:g(/^( *>[^\n]+(\n[^\n]+)*\n*)+\n{2,}/),parse:function(n,t,e){return{content:t(n[0].replace(/^ *> ?/gm,""),e)}},react:function(n,t,e){return x("blockquote",e.key,{children:t(n.content,e)})},html:function(n,t,e){return b("blockquote",t(n.content,e))}},list:{order:D++,match:function(n,t,e){var r=Z.exec(e),l=t._list||!t.inline;return r&&l?(n=r[1]+n,L.exec(n),L.exec(n)):null},parse:function(n,p,d){var t=n[2],e=1]*)>?(?: +["(]([^\n]+)[")])? *\n(?: *\n)*/),parse:function(n,t,e){var r=n[1].replace(/\s+/g," ").toLowerCase(),l=n[2],u=n[3];return e._refs&&e._refs[r]&&e._refs[r].forEach(function(n){n.target=l,n.title=u}),e._defs=e._defs||{},e._defs[r]={target:l,title:u},{def:r,target:l,title:u}},react:function(){return null},html:function(){return""}},table:{order:D++,match:g(/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/),parse:G.parseTable,react:function(t,e,r){var l=function(n){return null==t.align[n]?{}:{textAlign:t.align[n]}},n=t.header.map(function(n,t){return x("th",""+t,{style:l(t),scope:"col",children:e(n,r)})}),u=t.cells.map(function(n,t){return x("tr",""+t,{children:n.map(function(n,t){return x("td",""+t,{style:l(t),children:e(n,r)})})})});return x("table",r.key,{children:[x("thead","thead",{children:x("tr",null,{children:n})}),x("tbody","tbody",{children:u})]})},html:function(t,e,r){var l=function(n){return null==t.align[n]?"":"text-align:"+t.align[n]+";"},n=t.header.map(function(n,t){return b("th",e(n,r),{style:l(t),scope:"col"})}).join(""),u=t.cells.map(function(n){var t=n.map(function(n,t){return b("td",e(n,r),{style:l(t)})}).join("");return b("tr",t)}).join(""),a=b("thead",b("tr",n)),o=b("tbody",u);return b("table",a+o)}},newline:{order:D++,match:g(/^(?:\n *)*\n/),parse:q,react:function(n,t,e){return"\n"},html:function(n,t,e){return"\n"}},paragraph:{order:D++,match:g(/^((?:[^\n]|\n(?! *\n))+)(?:\n *)+\n/),parse:j,react:function(n,t,e){return x("div",e.key,{className:"paragraph",children:t(n.content,e)})},html:function(n,t,e){return b("div",t(n.content,e),{class:"paragraph"})}},escape:{order:D++,match:m(/^\\([^0-9A-Za-z\s])/),parse:function(n,t,e){return{type:"text",content:n[1]}},react:null,html:null},autolink:{order:D++,match:m(/^<([^ >]+:\/[^ >]+)>/),parse:function(n,t,e){return{type:"link",content:[{type:"text",content:n[1]}],target:n[1]}},react:null,html:null},mailto:{order:D++,match:m(/^<([^ >]+@[^ >]+)>/),parse:function(n,t,e){var r=n[1],l=n[1];return H.test(l)||(l="mailto:"+l),{type:"link",content:[{type:"text",content:r}],target:l}},react:null,html:null},url:{order:D++,match:m(/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/),parse:function(n,t,e){return{type:"link",content:[{type:"text",content:n[1]}],target:n[1],title:void 0}},react:null,html:null},link:{order:D++,match:m(new RegExp("^\\[("+M+")\\]\\("+U+"\\)")),parse:function(n,t,e){return{content:t(n[1],e),target:O(n[2]),title:n[3]}},react:function(n,t,e){return x("a",e.key,{href:S(n.target),title:n.title,children:t(n.content,e)})},html:function(n,t,e){var r={href:S(n.target),title:n.title};return b("a",t(n.content,e),r)}},image:{order:D++,match:m(new RegExp("^!\\[("+M+")\\]\\("+U+"\\)")),parse:function(n,t,e){return{alt:n[1],target:O(n[2]),title:n[3]}},react:function(n,t,e){return x("img",e.key,{src:S(n.target),alt:n.alt,title:n.title})},html:function(n,t,e){var r={src:S(n.target),alt:n.alt,title:n.title};return b("img","",r,!1)}},reflink:{order:D++,match:m(new RegExp("^\\[("+M+")\\]\\s*\\[([^\\]]*)\\]")),parse:function(n,t,e){return X(n,e,{type:"link",content:t(n[1],e)})},react:null,html:null},refimage:{order:D++,match:m(new RegExp("^!\\[("+M+")\\]\\s*\\[([^\\]]*)\\]")),parse:function(n,t,e){return X(n,e,{type:"image",alt:n[1]})},react:null,html:null},em:{order:D,match:m(new RegExp("^\\b_((?:__|\\\\[\\s\\S]|[^\\\\_])+?)_\\b|^\\*(?=\\S)((?:\\*\\*|\\\\[\\s\\S]|\\s+(?:\\\\[\\s\\S]|[^\\s\\*\\\\]|\\*\\*)|[^\\s\\*\\\\])+?)\\*(?!\\*)")),quality:function(n){return n[0].length+.2},parse:function(n,t,e){return{content:t(n[2]||n[1],e)}},react:function(n,t,e){return x("em",e.key,{children:t(n.content,e)})},html:function(n,t,e){return b("em",t(n.content,e))}},strong:{order:D,match:m(/^\*\*((?:\\[\s\S]|[^\\])+?)\*\*(?!\*)/),quality:function(n){return n[0].length+.1},parse:j,react:function(n,t,e){return x("strong",e.key,{children:t(n.content,e)})},html:function(n,t,e){return b("strong",t(n.content,e))}},u:{order:D++,match:m(/^__((?:\\[\s\S]|[^\\])+?)__(?!_)/),quality:function(n){return n[0].length},parse:j,react:function(n,t,e){return x("u",e.key,{children:t(n.content,e)})},html:function(n,t,e){return b("u",t(n.content,e))}},del:{order:D++,match:m(/^~~(?=\S)((?:\\[\s\S]|~(?!~)|[^\s\\~]|\s+(?!~~))+?)~~/),parse:j,react:function(n,t,e){return x("del",e.key,{children:t(n.content,e)})},html:function(n,t,e){return b("del",t(n.content,e))}},inlineCode:{order:D++,match:m(/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/),parse:function(n,t,e){return{content:n[2]}},react:function(n,t,e){return x("code",e.key,{children:n.content})},html:function(n,t,e){return b("code",A(n.content))}},br:{order:D++,match:y(/^ {2,}\n/),parse:q,react:function(n,t,e){return x("br",e.key,_)},html:function(n,t,e){return"
"}},text:{order:D++,match:y(/^[\s\S]+?(?=[^0-9A-Za-z\s\u00c0-\uffff]|\n\n| {2,}\n|\w+:\S|$)/),parse:function(n,t,e){return{content:n[0]}},react:function(n,t,e){return n.content},html:function(n,t,e){return A(n.content)}}},J=function(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 u,a=e.Array||Q.Array,o=function(n,t){return u=t=t||u,Array.isArray(n)?a[r](n,o,t):e[n.type][r](n,o,t)};return function(n,t){return u=w(t,l),o(n,u)}},K=n(Q),V=function(n,t){return(t=t||{}).inline=!1,K(n,t)},W=function(n,t){var e=C.test(n);return(t=t||{}).inline=!e,K(n,t)},Y=J(Q,"react"),nn=J(Q,"html"),tn=function(n,t){return Y(V(n,t),t)},en={defaultRules:Q,parserFor:n,outputFor:J,inlineRegex:m,blockRegex:g,anyScopeRegex:y,parseInline:P,parseBlock:function(n,t,e){var r=e.inline||!1;e.inline=!1;var l=n(t+"\n\n",e);return e.inline=r,l},markdownToReact:tn,markdownToHtml:function(n,t){return nn(V(n,t),t)},ReactMarkdown:function(n){var t={};for(var e in n)"source"!==e&&Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e]);return t.children=tn(n.source),x("div",null,t)},defaultBlockParse:V,defaultInlineParse:function(n,t){return(t=t||{}).inline=!0,K(n,t)},defaultImplicitParse:W,defaultReactOutput:Y,defaultHtmlOutput:nn,preprocess:k,sanitizeText:A,sanitizeUrl:S,unescapeUrl:O,htmlTag:b,reactElement:x,defaultRawParse:K,ruleOutput:function(r,l){return l||"undefined"==typeof console||console.warn("simple-markdown ruleOutput should take 'react' or 'html' as the second argument."),function(n,t,e){return r[n.type][l](n,t,e)}},reactFor:function(o){var c=function(n,t){if(t=t||{},Array.isArray(n)){for(var e=t.key,r=[],l=null,u=0;u";return r?u+n+"":u},x={},w=function(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},b=/[<>&"']/g,_={"<":"<",">":">","&":"&",'"':""","'":"'","/":"/","`":"`"},E=function(t){return String(t).replace(b,function(t){return _[t]})},S=/\\([^0-9A-Za-z\s])/g,R=function(t){return t.replace(S,"$1")},A=function(t,n,e){var r=e.inline||!1;e.inline=!0;var a=t(n,e);return e.inline=r,a},O=function(t,n,e){return{content:A(n,t[1],e)}},T=function(){return{}},$="(?:[*+-]|\\d+\\.)",P="( *)("+$+") +",j=new RegExp("^"+P),q=new RegExp(P+"[^\\n]*(?:\\n(?!\\1"+$+" )[^\\n]*)*(\n|$)","gm"),B=/\n{2,}$/,F=B,N=/ *\n+$/,C=new RegExp("^( *)("+$+") [\\s\\S]+?(?:\n{2,}(?! )(?!\\1"+$+" )\\n*|\\s*\n*$)"),I=/(?:^|\n)( *)$/,L=(p=/^ *\| *| *\| *$/g,u=/ *$/,n=/^ *-+: *$/,e=/^ *:-+: *$/,r=/^ *:-+ *$/,d=function(t){return n.test(t)?"right":e.test(t)?"center":r.test(t)?"left":null},h=function(t,n,e,r){var a=e.inTable;e.inTable=!0;var l=n(t.trim(),e);e.inTable=a;var o=[[]];return l.forEach(function(t,n){"tableSeparator"===t.type?(!r||0!==n&&n!==l.length-1)&&o.push([]):("text"!==t.type||null!=l[n+1]&&"tableSeparator"!==l[n+1].type||(t.content=t.content.replace(u,"")),o[o.length-1].push(t))}),o},{parseTable:(t=function(s){return function(t,n,e){e.inline=!0;var r,a,l,o,u,c=h(t[1],n,e,s),i=(r=t[2],s&&(r=r.replace(p,"")),r.trim().split("|").map(d)),f=(a=t[3],l=n,o=e,u=s,a.trim().split("\n").map(function(t){return h(t,l,o,u)}));return e.inline=!1,{type:"table",header:c,align:i,cells:f}}})(!0),parseNpTable:t(!1),TABLE_REGEX:/^ *(\|.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/,NPTABLE_REGEX:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/}),z="(?:\\[[^\\]]*\\]|[^\\[\\]]|\\](?=[^\\[]*\\]))*",G="\\s*?(?:\\s+['\"]([\\s\\S]*?)['\"])?\\s*",X=/mailto:/i,Z=function(t,n,e){var r=(t[2]||t[1]).replace(/\s+/g," ").toLowerCase();if(n._defs&&n._defs[r]){var a=n._defs[r];e.target=a.target,e.title=a.title}return n._refs=n._refs||{},n._refs[r]=n._refs[r]||[],n._refs[r].push(e),e},M=0,U={Array:{react:function(t,n,e){for(var r=e.key,a=[],l=0,o=0;l"}},codeBlock:{order:M++,match:m(/^(?: [^\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 v("pre",e.key,{children:v("code",null,{className:r,children:t.content})})},html:function(t,n,e){var r=t.lang?"markdown-code-"+t.lang:void 0,a=k("code",E(t.content),{class:r});return k("pre",a)}},fence:{order:M++,match:m(/^ *(`{3,}|~{3,}) *(\S+)? *\n([\s\S]+?)\s*\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:M++,match:m(/^( *>[^\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 v("blockquote",e.key,{children:n(t.content,e)})},html:function(t,n,e){return k("blockquote",n(t.content,e))}},list:{order:M++,match:function(t,n,e){var r=I.exec(e),a=n._list||!n.inline;return r&&a?(t=r[1]+t,C.exec(t),C.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(),a=t[2],l=t[3];return e._refs&&e._refs[r]&&e._refs[r].forEach(function(t){t.target=a,t.title=l}),e._defs=e._defs||{},e._defs[r]={target:a,title:l},{def:r,target:a,title:l}},react:function(){return null},html:function(){return""}},table:{order:M++,match:m(L.TABLE_REGEX),parse:L.parseTable,react:function(n,e,r){var a=function(t){return null==n.align[t]?{}:{textAlign:n.align[t]}},t=n.header.map(function(t,n){return v("th",""+n,{style:a(n),scope:"col",children:e(t,r)})}),l=n.cells.map(function(t,n){return v("tr",""+n,{children:t.map(function(t,n){return v("td",""+n,{style:a(n),children:e(t,r)})})})});return v("table",r.key,{children:[v("thead","thead",{children:v("tr",null,{children:t})}),v("tbody","tbody",{children:l})]})},html:function(n,e,r){var a=function(t){return null==n.align[t]?"":"text-align:"+n.align[t]+";"},t=n.header.map(function(t,n){return k("th",e(t,r),{style:a(n),scope:"col"})}).join(""),l=n.cells.map(function(t){var n=t.map(function(t,n){return k("td",e(t,r),{style:a(n)})}).join("");return k("tr",n)}).join(""),o=k("thead",k("tr",t)),u=k("tbody",l);return k("table",o+u)}},newline:{order:M++,match:m(/^(?:\n *)*\n/),parse:T,react:function(t,n,e){return"\n"},html:function(t,n,e){return"\n"}},paragraph:{order:M++,match:m(/^((?:[^\n]|\n(?! *\n))+)(?:\n *)+\n/),parse:O,react:function(t,n,e){return v("div",e.key,{className:"paragraph",children:n(t.content,e)})},html:function(t,n,e){return k("div",n(t.content,e),{class:"paragraph"})}},escape:{order:M++,match:s(/^\\([^0-9A-Za-z\s])/),parse:function(t,n,e){return{type:"text",content:t[1]}},react:null,html:null},tableSeparator:{order:M++,match:function(t,n){return n.inTable?/^ *\| */.exec(t):null},parse:function(){return{type:"tableSeparator"}},react:function(){return" | "},html:function(){return" | "}},autolink:{order:M++,match:s(/^<([^ >]+:\/[^ >]+)>/),parse:function(t,n,e){return{type:"link",content:[{type:"text",content:t[1]}],target:t[1]}},react:null,html:null},mailto:{order:M++,match:s(/^<([^ >]+@[^ >]+)>/),parse:function(t,n,e){var r=t[1],a=t[1];return X.test(a)||(a="mailto:"+a),{type:"link",content:[{type:"text",content:r}],target:a}},react:null,html:null},url:{order:M++,match:s(/^(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:M++,match:s(new RegExp("^\\[("+z+")\\]\\("+G+"\\)")),parse:function(t,n,e){return{content:n(t[1],e),target:R(t[2]),title:t[3]}},react:function(t,n,e){return v("a",e.key,{href:w(t.target),title:t.title,children:n(t.content,e)})},html:function(t,n,e){var r={href:w(t.target),title:t.title};return k("a",n(t.content,e),r)}},image:{order:M++,match:s(new RegExp("^!\\[("+z+")\\]\\("+G+"\\)")),parse:function(t,n,e){return{alt:t[1],target:R(t[2]),title:t[3]}},react:function(t,n,e){return v("img",e.key,{src:w(t.target),alt:t.alt,title:t.title})},html:function(t,n,e){var r={src:w(t.target),alt:t.alt,title:t.title};return k("img","",r,!1)}},reflink:{order:M++,match:s(new RegExp("^\\[("+z+")\\]\\s*\\[([^\\]]*)\\]")),parse:function(t,n,e){return Z(t,e,{type:"link",content:n(t[1],e)})},react:null,html:null},refimage:{order:M++,match:s(new RegExp("^!\\[("+z+")\\]\\s*\\[([^\\]]*)\\]")),parse:function(t,n,e){return Z(t,e,{type:"image",alt:t[1]})},react:null,html:null},em:{order:M,match:s(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 v("em",e.key,{children:n(t.content,e)})},html:function(t,n,e){return k("em",n(t.content,e))}},strong:{order:M,match:s(/^\*\*((?:\\[\s\S]|[^\\])+?)\*\*(?!\*)/),quality:function(t){return t[0].length+.1},parse:O,react:function(t,n,e){return v("strong",e.key,{children:n(t.content,e)})},html:function(t,n,e){return k("strong",n(t.content,e))}},u:{order:M++,match:s(/^__((?:\\[\s\S]|[^\\])+?)__(?!_)/),quality:function(t){return t[0].length},parse:O,react:function(t,n,e){return v("u",e.key,{children:n(t.content,e)})},html:function(t,n,e){return k("u",n(t.content,e))}},del:{order:M++,match:s(/^~~(?=\S)((?:\\[\s\S]|~(?!~)|[^\s\\~]|\s+(?!~~))+?)~~/),parse:O,react:function(t,n,e){return v("del",e.key,{children:n(t.content,e)})},html:function(t,n,e){return k("del",n(t.content,e))}},inlineCode:{order:M++,match:s(/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/),parse:function(t,n,e){return{content:t[2]}},react:function(t,n,e){return v("code",e.key,{children:t.content})},html:function(t,n,e){return k("code",E(t.content))}},br:{order:M++,match:y(/^ {2,}\n/),parse:T,react:function(t,n,e){return v("br",e.key,x)},html:function(t,n,e){return"
"}},text:{order:M++,match:y(/^[\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 E(t.content)}}},H=function(e,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,o=e.Array||U.Array,u=function(t,n){return l=n=n||l,Array.isArray(t)?o[r](t,u,n):e[t.type][r](t,u,n)};return function(t,n){return l=i(n,a),u(t,l)}},D=f(U),Q=function(t,n){return(n=n||{}).inline=!1,D(t,n)},J=function(t,n){var e=B.test(t);return(n=n||{}).inline=!e,D(t,n)},K=H(U,"react"),V=H(U,"html"),W=function(t,n){return K(Q(t,n),n)},Y={defaultRules:U,parserFor:f,outputFor:H,inlineRegex:s,blockRegex:m,anyScopeRegex:y,parseInline:A,parseBlock:function(t,n,e){var r=e.inline||!1;e.inline=!1;var a=t(n+"\n\n",e);return e.inline=r,a},markdownToReact:W,markdownToHtml:function(t,n){return V(Q(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=W(t.source),v("div",null,n)},defaultBlockParse:Q,defaultInlineParse:function(t,n){return(n=n||{}).inline=!0,D(t,n)},defaultImplicitParse:J,defaultReactOutput:K,defaultHtmlOutput:V,preprocess:c,sanitizeText:E,sanitizeUrl:w,unescapeUrl:R,htmlTag:k,reactElement:v,defaultRawParse:D,ruleOutput:function(r,a){return a||"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][a](t,n,e)}},reactFor:function(u){var c=function(t,n){if(n=n||{},Array.isArray(t)){for(var e=n.key,r=[],a=null,l=0;l