Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

markdown-to-jsx

Package Overview
Dependencies
Maintainers
2
Versions
114
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

markdown-to-jsx - npm Package Compare versions

Comparing version 7.3.1 to 7.3.2

dist/index.js

1

dist/index.cjs.d.ts

@@ -18,3 +18,2 @@ /// <reference types="react" />

slugify: (source: string) => string;
enforceAtxHeadings: boolean;
}>;

@@ -21,0 +20,0 @@ }> & {

@@ -1,2 +0,2 @@

!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):(n||self).MarkdownToJSX=t(n.React)}(this,function(n){function t(n){if(n&&n._)return n;var t=Object.create(null);return n&&Object.keys(n).forEach(function(r){if("default"!==r){var e=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(t,r,e.get?e:{enumerable:!0,get:function(){return n[r]}})}}),t.default=n,t}var r=/*#__PURE__*/t(n);function e(){return e=Object.assign?Object.assign.bind():function(n){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&(n[e]=r[e])}return n},e.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,t){return n[t.toLowerCase()]=t,n},{for:"htmlFor"}),i={amp:"&",apos:"'",gt:">",lt:"<",nbsp:" ",quot:"“"},c=["style","script"],f=/([-A-Z0-9_:]+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|(?:\{((?:\\.|{[^}]*?}|[^}])*)\})))?/gi,a=/mailto:/i,l=/\n{2,}$/,v=/^( *>[^\n]+(\n[^\n]+)*\n*)+\n{2,}/,s=/^ *> ?/gm,d=/^ {2,}\n/,y=/^(?:( *[-*_])){3,} *(?:\n *)+\n/,p=/^\s*(`{3,}|~{3,}) *(\S+)?([^\n]*?)?\n([\s\S]+?)\s*\1 *(?:\n *)*\n?/,g=/^(?: {4}[^\n]+\n*)+(?:\n *)+\n?/,k=/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,m=/^(?:\n *)*\n/,S=/\r\n?/g,_=/^\[\^([^\]]+)](:.*)\n/,h=/^\[\^([^\]]+)]/,b=/\f/g,x=/^\s*?\[(x|\s)\]/,$=/^ *(#{1,6}) *([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,O=/^ *(#{1,6}) +([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,j=/^([^\n]+)\n *(=|-){3,} *(?:\n *)+\n/,B=/^ *(?!<[a-z][^ >/]* ?\/>)<([a-z][^ >/]*) ?([^>]*)\/{0}>\n?(\s*(?:<\1[^>]*?>[\s\S]*?<\/\1>|(?!<\1)[\s\S])*?)<\/\1>\n*/i,z=/&([a-z0-9]+|#[0-9]{1,6}|#x[0-9a-fA-F]{1,6});/gi,w=/^<!--[\s\S]*?(?:-->)/,A=/^(data|aria|x)-[a-z_][a-z\d_.-]*$/,M=/^ *<([a-z][a-z0-9:]*)(?:\s+((?:<.*?>|[^>])*))?\/?>(?!<\/\1>)(\s*\n)?/i,E=/^\{.*\}$/,L=/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,T=/^<([^ >]+@[^ >]+)>/,F=/^<([^ >]+:\/[^ >]+)>/,I=/-([a-z])?/gi,R=/^(.*\|?.*)\n *(\|? *[-:]+ *\|[-| :]*)\n((?:.*\|.*\n)*)\n?/,C=/^\[([^\]]*)\]:\s+<?([^\s>]+)>?\s*("([^"]*)")?/,D=/^!\[([^\]]*)\] ?\[([^\]]*)\]/,H=/^\[([^\]]*)\] ?\[([^\]]*)\]/,N=/(\[|\])/g,P=/(\n|^[-*]\s|^#|^ {2,}|^-{2,}|^>\s)/,Z=/\t/g,G=/^ *\| */,q=/(^ *\||\| *$)/g,U=/ *$/,V=/^ *:-+: *$/,W=/^ *:-+ *$/,Q=/^ *-+: *$/,X=/^([*_])\1((?:\[.*?\][([].*?[)\]]|<.*?>(?:.*?<.*?>)?|`.*?`|~+.*?~+|.)*?)\1\1(?!\1)/,J=/^([*_])((?:\[.*?\][([].*?[)\]]|<.*?>(?:.*?<.*?>)?|`.*?`|~+.*?~+|.)*?)\1(?!\1|\w)/,K=/^==((?:\[.*?\]|<.*?>(?:.*?<.*?>)?|`.*?`|.)*?)==/,Y=/^~~((?:\[.*?\]|<.*?>(?:.*?<.*?>)?|`.*?`|.)*?)~~/,nn=/^\\([^0-9A-Za-z\s])/,tn=/^[\s\S]+?(?=[^0-9A-Z\s\u00c0-\uffff&#;.()'"]|\d+\.|\n\n| {2,}\n|\w+:\S|$)/i,rn=/^\n+/,en=/^([ \t]*)/,un=/\\([^\\])/g,on=/ *\n+$/,cn=/(?:^|\n)( *)$/,fn="(?:\\d+\\.)",an="(?:[*+-])";function ln(n){return"( *)("+(1===n?fn:an)+") +"}var vn=ln(1),sn=ln(2);function dn(n){return new RegExp("^"+(1===n?vn:sn))}var yn=dn(1),pn=dn(2);function gn(n){return new RegExp("^"+(1===n?vn:sn)+"[^\\n]*(?:\\n(?!\\1"+(1===n?fn:an)+" )[^\\n]*)*(\\n|$)","gm")}var kn=gn(1),mn=gn(2);function Sn(n){var t=1===n?fn:an;return new RegExp("^( *)("+t+") [\\s\\S]+?(?:\\n{2,}(?! )(?!\\1"+t+" (?!"+t+" ))\\n*|\\s*\\n*$)")}var _n=Sn(1),hn=Sn(2);function bn(n,t){var r=1===t,e=r?_n:hn,u=r?kn:mn,o=r?yn:pn;return{t:function(n,t,r){var u=cn.exec(r);return u&&(t.o||!t.u&&!t.i)?e.exec(n=u[1]+n):null},q:Pn.HIGH,l:function(n,t,e){var i=r?+n[2]:void 0,c=n[0].replace(l,"\n").match(u),f=!1;return{p:c.map(function(n,r){var u=o.exec(n)[0].length,i=new RegExp("^ {1,"+u+"}","gm"),a=n.replace(i,"").replace(o,""),l=r===c.length-1,v=-1!==a.indexOf("\n\n")||l&&f;f=v;var s,d=e.u,y=e.o;e.o=!0,v?(e.u=!1,s=a.replace(on,"\n\n")):(e.u=!0,s=a.replace(on,""));var p=t(s,e);return e.u=d,e.o=y,p}),m:r,g:i}},v:function(t,r,e){return n(t.m?"ol":"ul",{key:e.h,start:t.g},t.p.map(function(t,u){return n("li",{key:u},r(t,e))}))}}}var xn=/^\[([^\]]*)]\( *((?:\([^)]*\)|[^() ])*) *"?([^)"]*)?"?\)/,$n=/^!\[([^\]]*)]\( *((?:\([^)]*\)|[^() ])*) *"?([^)"]*)?"?\)/,On=[v,p,g,$,j,O,w,R,kn,_n,mn,hn],jn=[].concat(On,[/^[^\n]+(?: \n|\n{2,})/,B,M]);function Bn(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 zn(n){return Q.test(n)?"right":V.test(n)?"center":W.test(n)?"left":null}function wn(n,t,r){var e=r.k;r.k=!0;var u=t(n.trim(),r);r.k=e;var o=[[]];return u.forEach(function(n,t){"tableSeparator"===n.type?0!==t&&t!==u.length-1&&o.push([]):("text"!==n.type||null!=u[t+1]&&"tableSeparator"!==u[t+1].type||(n.S=n.S.replace(U,"")),o[o.length-1].push(n))}),o}function An(n,t,r){r.u=!0;var e=wn(n[1],t,r),u=n[2].replace(q,"").split("|").map(zn),o=function(n,t,r){return n.trim().split("\n").map(function(n){return wn(n,t,r)})}(n[3],t,r);return r.u=!1,{$:u,A:o,L:e,type:"table"}}function Mn(n,t){return null==n.$[t]?{}:{textAlign:n.$[t]}}function En(n){return function(t,r){return r.u?n.exec(t):null}}function Ln(n){return function(t,r){return r.u||r.i?n.exec(t):null}}function Tn(n){return function(t,r){return r.u||r.i?null:n.exec(t)}}function Fn(n){return function(t){return n.exec(t)}}function In(n,t,r){if(t.u||t.i)return null;if(r&&!r.endsWith("\n"))return null;var e="";n.split("\n").every(function(n){return!On.some(function(t){return t.test(n)})&&(e+=n+"\n",n.trim())});var u=e.trimEnd();return""==u?null:[e,u]}function Rn(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 Cn(n){return n.replace(un,"$1")}function Dn(n,t,r){var e=r.u||!1,u=r.i||!1;r.u=!0,r.i=!0;var o=n(t,r);return r.u=e,r.i=u,o}function Hn(n,t,r){var e=r.u||!1,u=r.i||!1;r.u=!1,r.i=!0;var o=n(t,r);return r.u=e,r.i=u,o}function Nn(n,t,r){return r.u=!1,n(t,r)}var Pn,Zn=function(n,t,r){return{S:Dn(t,n[1],r)}};function Gn(){return{}}function qn(){return null}function Un(){return[].slice.call(arguments).filter(Boolean).join(" ")}function Vn(n,t,r){for(var e=n,u=t.split(".");u.length&&void 0!==(e=e[u[0]]);)u.shift();return e||r}function Wn(n,t){var r=Vn(t,n);return r?"function"==typeof r||"object"==typeof r&&"render"in r?r:Vn(t,n+".component",n):n}function Qn(n,t){void 0===t&&(t={}),t.overrides=t.overrides||{},t.slugify=t.slugify||Bn,t.namedCodesToUnicode=t.namedCodesToUnicode?e({},i,t.namedCodesToUnicode):i;var u=t.createElement||r.createElement;function l(n,r){var o=Vn(t.overrides,n+".props",{});return u.apply(void 0,[Wn(n,t.overrides),e({},r,o,{className:Un(null==r?void 0:r.className,o.className)||void 0})].concat([].slice.call(arguments,2)))}function q(n){var e=!1;t.forceInline?e=!0:t.forceBlock||(e=!1===P.test(n));for(var u=cn(on(e?n:n.trimEnd().replace(rn,"")+"\n\n",{u:e}));"string"==typeof u[u.length-1]&&!u[u.length-1].trim();)u.pop();if(null===t.wrapper)return u;var o,i=t.wrapper||(e?"span":"div");if(u.length>1||t.forceWrapper)o=u;else{if(1===u.length)return"string"==typeof(o=u[0])?l("span",{key:"outer"},o):o;o=null}return r.createElement(i,{key:"outer"},o)}function U(n){var t=n.match(f);return t?t.reduce(function(n,t,e){var u=t.indexOf("=");if(-1!==u){var i=function(n){return-1!==n.indexOf("-")&&null===n.match(A)&&(n=n.replace(I,function(n,t){return t.toUpperCase()})),n}(t.slice(0,u)).trim(),c=function(n){var t=n[0];return('"'===t||"'"===t)&&n.length>=2&&n[n.length-1]===t?n.slice(1,-1):n}(t.slice(u+1).trim()),f=o[i]||i,a=n[f]=function(n,t){return"style"===n?t.split(/;\s?/).reduce(function(n,t){var r=t.slice(0,t.indexOf(":"));return n[r.replace(/(-[a-z])/g,function(n){return n[1].toUpperCase()})]=t.slice(r.length+1).trim(),n},{}):"href"===n?Rn(t):(t.match(E)&&(t=t.slice(1,t.length-1)),"true"===t||"false"!==t&&t)}(i,c);"string"==typeof a&&(B.test(a)||M.test(a))&&(n[f]=r.cloneElement(q(a.trim()),{key:e}))}else"style"!==t&&(n[o[t]||t]=!0);return n},{}):null}var V=[],W={},Q={blockQuote:{t:Tn(v),q:Pn.HIGH,l:function(n,t,r){return{S:t(n[0].replace(s,""),r)}},v:function(n,t,r){return l("blockquote",{key:r.h},t(n.S,r))}},breakLine:{t:Fn(d),q:Pn.HIGH,l:Gn,v:function(n,t,r){return l("br",{key:r.h})}},breakThematic:{t:Tn(y),q:Pn.HIGH,l:Gn,v:function(n,t,r){return l("hr",{key:r.h})}},codeBlock:{t:Tn(g),q:Pn.MAX,l:function(n){return{S:n[0].replace(/^ {4}/gm,"").replace(/\n+$/,""),M:void 0}},v:function(n,t,r){return l("pre",{key:r.h},l("code",e({},n.O,{className:n.M?"lang-"+n.M:""}),n.S))}},codeFenced:{t:Tn(p),q:Pn.MAX,l:function(n){return{O:U(n[3]||""),S:n[4],M:n[2]||void 0,type:"codeBlock"}}},codeInline:{t:Ln(k),q:Pn.LOW,l:function(n){return{S:n[2]}},v:function(n,t,r){return l("code",{key:r.h},n.S)}},footnote:{t:Tn(_),q:Pn.MAX,l:function(n){return V.push({I:n[2],j:n[1]}),{}},v:qn},footnoteReference:{t:En(h),q:Pn.HIGH,l:function(n){return{S:n[1],B:"#"+t.slugify(n[1])}},v:function(n,t,r){return l("a",{key:r.h,href:Rn(n.B)},l("sup",{key:r.h},n.S))}},gfmTask:{t:En(x),q:Pn.HIGH,l:function(n){return{R:"x"===n[1].toLowerCase()}},v:function(n,t,r){return l("input",{checked:n.R,key:r.h,readOnly:!0,type:"checkbox"})}},heading:{t:Tn(t.enforceAtxHeadings?O:$),q:Pn.HIGH,l:function(n,r,e){return{S:Dn(r,n[2],e),T:t.slugify(n[2]),C:n[1].length}},v:function(n,t,r){return l("h"+n.C,{id:n.T,key:r.h},t(n.S,r))}},headingSetext:{t:Tn(j),q:Pn.MAX,l:function(n,t,r){return{S:Dn(t,n[1],r),C:"="===n[2]?1:2,type:"heading"}}},htmlComment:{t:Fn(w),q:Pn.HIGH,l:function(){return{}},v:qn},image:{t:Ln($n),q:Pn.HIGH,l:function(n){return{D:n[1],B:Cn(n[2]),F:n[3]}},v:function(n,t,r){return l("img",{key:r.h,alt:n.D||void 0,title:n.F||void 0,src:Rn(n.B)})}},link:{t:En(xn),q:Pn.LOW,l:function(n,t,r){return{S:Hn(t,n[1],r),B:Cn(n[2]),F:n[3]}},v:function(n,t,r){return l("a",{key:r.h,href:Rn(n.B),title:n.F},t(n.S,r))}},linkAngleBraceStyleDetector:{t:En(F),q:Pn.MAX,l:function(n){return{S:[{S:n[1],type:"text"}],B:n[1],type:"link"}}},linkBareUrlDetector:{t:function(n,t){return t.N?null:En(L)(n,t)},q:Pn.MAX,l:function(n){return{S:[{S:n[1],type:"text"}],B:n[1],F:void 0,type:"link"}}},linkMailtoDetector:{t:En(T),q:Pn.MAX,l:function(n){var t=n[1],r=n[1];return a.test(r)||(r="mailto:"+r),{S:[{S:t.replace("mailto:",""),type:"text"}],B:r,type:"link"}}},orderedList:bn(l,1),unorderedList:bn(l,2),newlineCoalescer:{t:Tn(m),q:Pn.LOW,l:Gn,v:function(){return"\n"}},paragraph:{t:In,q:Pn.LOW,l:Zn,v:function(n,t,r){return l("p",{key:r.h},t(n.S,r))}},ref:{t:En(C),q:Pn.MAX,l:function(n){return W[n[1]]={B:n[2],F:n[4]},{}},v:qn},refImage:{t:Ln(D),q:Pn.MAX,l:function(n){return{D:n[1]||void 0,P:n[2]}},v:function(n,t,r){return l("img",{key:r.h,alt:n.D,src:Rn(W[n.P].B),title:W[n.P].F})}},refLink:{t:En(H),q:Pn.MAX,l:function(n,t,r){return{S:t(n[1],r),Z:t(n[0].replace(N,"\\$1"),r),P:n[2]}},v:function(n,t,r){return W[n.P]?l("a",{key:r.h,href:Rn(W[n.P].B),title:W[n.P].F},t(n.S,r)):l("span",{key:r.h},t(n.Z,r))}},table:{t:Tn(R),q:Pn.HIGH,l:An,v:function(n,t,r){return l("table",{key:r.h},l("thead",null,l("tr",null,n.L.map(function(e,u){return l("th",{key:u,style:Mn(n,u)},t(e,r))}))),l("tbody",null,n.A.map(function(e,u){return l("tr",{key:u},e.map(function(e,u){return l("td",{key:u,style:Mn(n,u)},t(e,r))}))})))}},tableSeparator:{t:function(n,t){return t.k?(t.u=!0,G.exec(n)):null},q:Pn.HIGH,l:function(){return{type:"tableSeparator"}},v:function(){return" | "}},text:{t:Fn(tn),q:Pn.MIN,l:function(n){return{S:n[0].replace(z,function(n,r){return t.namedCodesToUnicode[r]?t.namedCodesToUnicode[r]:n})}},v:function(n){return n.S}},textBolded:{t:Ln(X),q:Pn.MED,l:function(n,t,r){return{S:t(n[2],r)}},v:function(n,t,r){return l("strong",{key:r.h},t(n.S,r))}},textEmphasized:{t:Ln(J),q:Pn.LOW,l:function(n,t,r){return{S:t(n[2],r)}},v:function(n,t,r){return l("em",{key:r.h},t(n.S,r))}},textEscaped:{t:Ln(nn),q:Pn.HIGH,l:function(n){return{S:n[1],type:"text"}}},textMarked:{t:Ln(K),q:Pn.LOW,l:Zn,v:function(n,t,r){return l("mark",{key:r.h},t(n.S,r))}},textStrikethroughed:{t:Ln(Y),q:Pn.LOW,l:Zn,v:function(n,t,r){return l("del",{key:r.h},t(n.S,r))}}};!0!==t.disableParsingRawHTML&&(Q.htmlBlock={t:Fn(B),q:Pn.HIGH,l:function(n,t,r){var e,u=n[3].match(en),o=new RegExp("^"+u[1],"gm"),i=n[3].replace(o,""),f=(e=i,jn.some(function(n){return n.test(e)})?Nn:Dn),a=n[1].toLowerCase(),l=-1!==c.indexOf(a);r.N=r.N||"a"===a;var v=l?n[3]:f(t,i,r);return r.N=!1,{O:U(n[2]),S:v,G:l,H:l?a:n[1]}},v:function(n,t,r){return l(n.H,e({key:r.h},n.O),n.G?n.S:t(n.S,r))}},Q.htmlSelfClosing={t:Fn(M),q:Pn.HIGH,l:function(n){return{O:U(n[2]||""),H:n[1]}},v:function(n,t,r){return l(n.H,e({},n.O,{key:r.h}))}});var un,on=function(n){var t=Object.keys(n);function r(e,u){for(var o=[],i="";e;)for(var c=0;c<t.length;){var f=t[c],a=n[f],l=a.t(e,u,i);if(l){var v=l[0];e=e.substring(v.length);var s=a.l(l,r,u);null==s.type&&(s.type=f),o.push(s),i=v;break}c++}return o}return t.sort(function(t,r){var e=n[t].q,u=n[r].q;return e!==u?e-u:t<r?-1:1}),function(n,t){return r(function(n){return n.replace(S,"\n").replace(b,"").replace(Z," ")}(n),t)}}(Q),cn=(un=function(n){return function(t,r,e){return n[t.type].v(t,r,e)}}(Q),function n(t,r){if(void 0===r&&(r={}),Array.isArray(t)){for(var e=r.h,u=[],o=!1,i=0;i<t.length;i++){r.h=i;var c=n(t[i],r),f="string"==typeof c;f&&o?u[u.length-1]+=c:null!==c&&u.push(c),o=f}return r.h=e,u}return un(t,n,r)}),fn=q(n);return V.length?l("div",null,fn,l("footer",{key:"footer"},V.map(function(n){return l("div",{id:t.slugify(n.j),key:n.j},n.j,cn(on(n.I,{u:!0})))}))):fn}function Xn(n){var t=n.children,e=n.options,o=function(n,t){if(null==n)return{};var r,e,u={},o=Object.keys(n);for(e=0;e<o.length;e++)t.indexOf(r=o[e])>=0||(u[r]=n[r]);return u}(n,u);return r.cloneElement(Qn(t,e),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"}(Pn||(Pn={})),Object.assign(Xn,{compiler:Qn}),Xn});
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):(n||self).MarkdownToJSX=t(n.React)}(this,function(n){function t(n){if(n&&n._)return n;var t=Object.create(null);return n&&Object.keys(n).forEach(function(r){if("default"!==r){var e=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(t,r,e.get?e:{enumerable:!0,get:function(){return n[r]}})}}),t.default=n,t}var r=/*#__PURE__*/t(n);function e(){return e=Object.assign||function(n){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&(n[e]=r[e])}return n},e.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,t){return n[t.toLowerCase()]=t,n},{for:"htmlFor"}),i={amp:"&",apos:"'",gt:">",lt:"<",nbsp:" ",quot:"“"},c=["style","script"],f=/([-A-Z0-9_:]+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|(?:\{((?:\\.|{[^}]*?}|[^}])*)\})))?/gi,a=/mailto:/i,l=/\n{2,}$/,v=/^( *>[^\n]+(\n[^\n]+)*\n*)+\n{2,}/,s=/^ *> ?/gm,d=/^ {2,}\n/,y=/^(?:( *[-*_])){3,} *(?:\n *)+\n/,p=/^\s*(`{3,}|~{3,}) *(\S+)?([^\n]*?)?\n([\s\S]+?)\s*\1 *(?:\n *)*\n?/,g=/^(?: {4}[^\n]+\n*)+(?:\n *)+\n?/,k=/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,m=/^(?:\n *)*\n/,S=/\r\n?/g,_=/^\[\^([^\]]+)](:.*)\n/,h=/^\[\^([^\]]+)]/,b=/\f/g,x=/^\s*?\[(x|\s)\]/,$=/^ *(#{1,6}) *([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,O=/^([^\n]+)\n *(=|-){3,} *(?:\n *)+\n/,R=/^ *(?!<[a-z][^ >/]* ?\/>)<([a-z][^ >/]*) ?([^>]*)\/{0}>\n?(\s*(?:<\1[^>]*?>[\s\S]*?<\/\1>|(?!<\1)[\s\S])*?)<\/\1>\n*/i,j=/&([a-zA-Z]+);/g,z=/^<!--[\s\S]*?(?:-->)/,w=/^(data|aria|x)-[a-z_][a-z\d_.-]*$/,A=/^ *<([a-z][a-z0-9:]*)(?:\s+((?:<.*?>|[^>])*))?\/?>(?!<\/\1>)(\s*\n)?/i,M=/^\{.*\}$/,E=/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,I=/^<([^ >]+@[^ >]+)>/,L=/^<([^ >]+:\/[^ >]+)>/,T=/-([a-z])?/gi,N=/^(.*\|?.*)\n *(\|? *[-:]+ *\|[-| :]*)\n((?:.*\|.*\n)*)\n?/,B=/^\[([^\]]*)\]:\s+<?([^\s>]+)>?\s*("([^"]*)")?/,C=/^!\[([^\]]*)\] ?\[([^\]]*)\]/,D=/^\[([^\]]*)\] ?\[([^\]]*)\]/,F=/(\[|\])/g,H=/(\n|^[-*]\s|^#|^ {2,}|^-{2,}|^>\s)/,Z=/\t/g,G=/^ *\| */,P=/(^ *\||\| *$)/g,q=/ *$/,U=/^ *:-+: *$/,V=/^ *:-+ *$/,W=/^ *-+: *$/,Q=/^([*_])\1((?:\[.*?\][([].*?[)\]]|<.*?>(?:.*?<.*?>)?|`.*?`|~+.*?~+|.)*?)\1\1(?!\1)/,X=/^([*_])((?:\[.*?\][([].*?[)\]]|<.*?>(?:.*?<.*?>)?|`.*?`|~+.*?~+|.)*?)\1(?!\1|\w)/,J=/^==((?:\[.*?\]|<.*?>(?:.*?<.*?>)?|`.*?`|.)*?)==/,K=/^~~((?:\[.*?\]|<.*?>(?:.*?<.*?>)?|`.*?`|.)*?)~~/,Y=/^\\([^0-9A-Za-z\s])/,nn=/^[\s\S]+?(?=[^0-9A-Z\s\u00c0-\uffff&;.()'"]|\d+\.|\n\n| {2,}\n|\w+:\S|$)/i,tn=/^\n+/,rn=/^([ \t]*)/,en=/\\([^\\])/g,un=/ *\n+$/,on=/(?:^|\n)( *)$/,cn="(?:\\d+\\.)",fn="(?:[*+-])";function an(n){return"( *)("+(1===n?cn:fn)+") +"}var ln=an(1),vn=an(2);function sn(n){return new RegExp("^"+(1===n?ln:vn))}var dn=sn(1),yn=sn(2);function pn(n){return new RegExp("^"+(1===n?ln:vn)+"[^\\n]*(?:\\n(?!\\1"+(1===n?cn:fn)+" )[^\\n]*)*(\\n|$)","gm")}var gn=pn(1),kn=pn(2);function mn(n){var t=1===n?cn:fn;return new RegExp("^( *)("+t+") [\\s\\S]+?(?:\\n{2,}(?! )(?!\\1"+t+" (?!"+t+" ))\\n*|\\s*\\n*$)")}var Sn=mn(1),_n=mn(2);function hn(n,t){var r=1===t,e=r?Sn:_n,u=r?gn:kn,o=r?dn:yn;return{t:function(n,t,r){var u=on.exec(r);return u&&(t.o||!t.u&&!t.i)?e.exec(n=u[1]+n):null},q:Hn.HIGH,l:function(n,t,e){var i=r?+n[2]:void 0,c=n[0].replace(l,"\n").match(u),f=!1;return{p:c.map(function(n,r){var u=o.exec(n)[0].length,i=new RegExp("^ {1,"+u+"}","gm"),a=n.replace(i,"").replace(o,""),l=r===c.length-1,v=-1!==a.indexOf("\n\n")||l&&f;f=v;var s,d=e.u,y=e.o;e.o=!0,v?(e.u=!1,s=a.replace(un,"\n\n")):(e.u=!0,s=a.replace(un,""));var p=t(s,e);return e.u=d,e.o=y,p}),m:r,g:i}},v:function(t,r,e){return n(t.m?"ol":"ul",{key:e.h,start:t.g},t.p.map(function(t,u){return n("li",{key:u},r(t,e))}))}}}var bn=/^\[([^\]]*)]\( *((?:\([^)]*\)|[^() ])*) *"?([^)"]*)?"?\)/,xn=/^!\[([^\]]*)]\( *((?:\([^)]*\)|[^() ])*) *"?([^)"]*)?"?\)/,$n=[v,p,g,$,O,z,N,gn,Sn,kn,_n],On=[].concat($n,[/^[^\n]+(?: \n|\n{2,})/,R,A]);function Rn(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 jn(n){return W.test(n)?"right":U.test(n)?"center":V.test(n)?"left":null}function zn(n,t,r){var e=r.k;r.k=!0;var u=t(n.trim(),r);r.k=e;var o=[[]];return u.forEach(function(n,t){"tableSeparator"===n.type?0!==t&&t!==u.length-1&&o.push([]):("text"!==n.type||null!=u[t+1]&&"tableSeparator"!==u[t+1].type||(n.S=n.S.replace(q,"")),o[o.length-1].push(n))}),o}function wn(n,t,r){r.u=!0;var e=zn(n[1],t,r),u=n[2].replace(P,"").split("|").map(jn),o=function(n,t,r){return n.trim().split("\n").map(function(n){return zn(n,t,r)})}(n[3],t,r);return r.u=!1,{$:u,A:o,L:e,type:"table"}}function An(n,t){return null==n.$[t]?{}:{textAlign:n.$[t]}}function Mn(n){return function(t,r){return r.u?n.exec(t):null}}function En(n){return function(t,r){return r.u||r.i?n.exec(t):null}}function In(n){return function(t,r){return r.u||r.i?null:n.exec(t)}}function Ln(n){return function(t){return n.exec(t)}}function Tn(n,t,r){if(t.u||t.i)return null;if(r&&!r.endsWith("\n"))return null;var e="";n.split("\n").every(function(n){return!$n.some(function(t){return t.test(n)})&&(e+=n+"\n",n.trim())});var u=e.trimEnd();return""==u?null:[e,u]}function Nn(n){try{if(decodeURIComponent(n).replace(/[^A-Za-z0-9/:]/g,"").match(/^\s*(javascript|vbscript|data(?!:image)):/i))return null}catch(n){return null}return n}function Bn(n){return n.replace(en,"$1")}function Cn(n,t,r){var e=r.u||!1,u=r.i||!1;r.u=!0,r.i=!0;var o=n(t,r);return r.u=e,r.i=u,o}function Dn(n,t,r){var e=r.u||!1,u=r.i||!1;r.u=!1,r.i=!0;var o=n(t,r);return r.u=e,r.i=u,o}function Fn(n,t,r){return r.u=!1,n(t+"\n\n",r)}var Hn,Zn=function(n,t,r){return{S:Cn(t,n[1],r)}};function Gn(){return{}}function Pn(){return null}function qn(){return[].slice.call(arguments).filter(Boolean).join(" ")}function Un(n,t,r){for(var e=n,u=t.split(".");u.length&&void 0!==(e=e[u[0]]);)u.shift();return e||r}function Vn(n,t){var r=Un(t,n);return r?"function"==typeof r||"object"==typeof r&&"render"in r?r:Un(t,n+".component",n):n}function Wn(n,t){void 0===t&&(t={}),t.overrides=t.overrides||{},t.slugify=t.slugify||Rn,t.namedCodesToUnicode=t.namedCodesToUnicode?e({},i,t.namedCodesToUnicode):i;var u=t.createElement||r.createElement;function l(n,r){var o=Un(t.overrides,n+".props",{});return u.apply(void 0,[Vn(n,t.overrides),e({},r,o,{className:qn(null==r?void 0:r.className,o.className)||void 0})].concat([].slice.call(arguments,2)))}function P(n){var e=!1;t.forceInline?e=!0:t.forceBlock||(e=!1===H.test(n));for(var u=on(un(e?n:n.trimEnd().replace(tn,"")+"\n\n",{u:e}));"string"==typeof u[u.length-1]&&!u[u.length-1].trim();)u.pop();if(null===t.wrapper)return u;var o,i=t.wrapper||(e?"span":"div");if(u.length>1||t.forceWrapper)o=u;else{if(1===u.length)return"string"==typeof(o=u[0])?l("span",{key:"outer"},o):o;o=null}return r.createElement(i,{key:"outer"},o)}function q(n){var t=n.match(f);return t?t.reduce(function(n,t,e){var u=t.indexOf("=");if(-1!==u){var i=function(n){return-1!==n.indexOf("-")&&null===n.match(w)&&(n=n.replace(T,function(n,t){return t.toUpperCase()})),n}(t.slice(0,u)).trim(),c=function(n){var t=n[0];return('"'===t||"'"===t)&&n.length>=2&&n[n.length-1]===t?n.slice(1,-1):n}(t.slice(u+1).trim()),f=o[i]||i,a=n[f]=function(n,t){return"style"===n?t.split(/;\s?/).reduce(function(n,t){var r=t.slice(0,t.indexOf(":"));return n[r.replace(/(-[a-z])/g,function(n){return n[1].toUpperCase()})]=t.slice(r.length+1).trim(),n},{}):"href"===n?Nn(t):(t.match(M)&&(t=t.slice(1,t.length-1)),"true"===t||"false"!==t&&t)}(i,c);"string"==typeof a&&(R.test(a)||A.test(a))&&(n[f]=r.cloneElement(P(a.trim()),{key:e}))}else"style"!==t&&(n[o[t]||t]=!0);return n},{}):null}var U=[],V={},W={blockQuote:{t:In(v),q:Hn.HIGH,l:function(n,t,r){return{S:t(n[0].replace(s,""),r)}},v:function(n,t,r){return l("blockquote",{key:r.h},t(n.S,r))}},breakLine:{t:Ln(d),q:Hn.HIGH,l:Gn,v:function(n,t,r){return l("br",{key:r.h})}},breakThematic:{t:In(y),q:Hn.HIGH,l:Gn,v:function(n,t,r){return l("hr",{key:r.h})}},codeBlock:{t:In(g),q:Hn.MAX,l:function(n){return{S:n[0].replace(/^ {4}/gm,"").replace(/\n+$/,""),M:void 0}},v:function(n,t,r){return l("pre",{key:r.h},l("code",e({},n.I,{className:n.M?"lang-"+n.M:""}),n.S))}},codeFenced:{t:In(p),q:Hn.MAX,l:function(n){return{I:q(n[3]||""),S:n[4],M:n[2]||void 0,type:"codeBlock"}}},codeInline:{t:En(k),q:Hn.LOW,l:function(n){return{S:n[2]}},v:function(n,t,r){return l("code",{key:r.h},n.S)}},footnote:{t:In(_),q:Hn.MAX,l:function(n){return U.push({O:n[2],B:n[1]}),{}},v:Pn},footnoteReference:{t:Mn(h),q:Hn.HIGH,l:function(n){return{S:n[1],R:"#"+t.slugify(n[1])}},v:function(n,t,r){return l("a",{key:r.h,href:Nn(n.R)},l("sup",{key:r.h},n.S))}},gfmTask:{t:Mn(x),q:Hn.HIGH,l:function(n){return{T:"x"===n[1].toLowerCase()}},v:function(n,t,r){return l("input",{checked:n.T,key:r.h,readOnly:!0,type:"checkbox"})}},heading:{t:In($),q:Hn.HIGH,l:function(n,r,e){return{S:Cn(r,n[2],e),j:t.slugify(n[2]),C:n[1].length}},v:function(n,t,r){return l("h"+n.C,{id:n.j,key:r.h},t(n.S,r))}},headingSetext:{t:In(O),q:Hn.MAX,l:function(n,t,r){return{S:Cn(t,n[1],r),C:"="===n[2]?1:2,type:"heading"}}},htmlComment:{t:Ln(z),q:Hn.HIGH,l:function(){return{}},v:Pn},image:{t:En(xn),q:Hn.HIGH,l:function(n){return{D:n[1],R:Bn(n[2]),N:n[3]}},v:function(n,t,r){return l("img",{key:r.h,alt:n.D||void 0,title:n.N||void 0,src:Nn(n.R)})}},link:{t:Mn(bn),q:Hn.LOW,l:function(n,t,r){return{S:Dn(t,n[1],r),R:Bn(n[2]),N:n[3]}},v:function(n,t,r){return l("a",{key:r.h,href:Nn(n.R),title:n.N},t(n.S,r))}},linkAngleBraceStyleDetector:{t:Mn(L),q:Hn.MAX,l:function(n){return{S:[{S:n[1],type:"text"}],R:n[1],type:"link"}}},linkBareUrlDetector:{t:function(n,t){return t.Z?null:Mn(E)(n,t)},q:Hn.MAX,l:function(n){return{S:[{S:n[1],type:"text"}],R:n[1],N:void 0,type:"link"}}},linkMailtoDetector:{t:Mn(I),q:Hn.MAX,l:function(n){var t=n[1],r=n[1];return a.test(r)||(r="mailto:"+r),{S:[{S:t.replace("mailto:",""),type:"text"}],R:r,type:"link"}}},orderedList:hn(l,1),unorderedList:hn(l,2),newlineCoalescer:{t:In(m),q:Hn.LOW,l:Gn,v:function(){return"\n"}},paragraph:{t:Tn,q:Hn.LOW,l:Zn,v:function(n,t,r){return l("p",{key:r.h},t(n.S,r))}},ref:{t:Mn(B),q:Hn.MAX,l:function(n){return V[n[1]]={R:n[2],N:n[4]},{}},v:Pn},refImage:{t:En(C),q:Hn.MAX,l:function(n){return{D:n[1]||void 0,F:n[2]}},v:function(n,t,r){return l("img",{key:r.h,alt:n.D,src:Nn(V[n.F].R),title:V[n.F].N})}},refLink:{t:Mn(D),q:Hn.MAX,l:function(n,t,r){return{S:t(n[1],r),P:t(n[0].replace(F,"\\$1"),r),F:n[2]}},v:function(n,t,r){return V[n.F]?l("a",{key:r.h,href:Nn(V[n.F].R),title:V[n.F].N},t(n.S,r)):l("span",{key:r.h},t(n.P,r))}},table:{t:In(N),q:Hn.HIGH,l:wn,v:function(n,t,r){return l("table",{key:r.h},l("thead",null,l("tr",null,n.L.map(function(e,u){return l("th",{key:u,style:An(n,u)},t(e,r))}))),l("tbody",null,n.A.map(function(e,u){return l("tr",{key:u},e.map(function(e,u){return l("td",{key:u,style:An(n,u)},t(e,r))}))})))}},tableSeparator:{t:function(n,t){return t.k?G.exec(n):null},q:Hn.HIGH,l:function(){return{type:"tableSeparator"}},v:function(){return" | "}},text:{t:Ln(nn),q:Hn.MIN,l:function(n){return{S:n[0].replace(j,function(n,r){return t.namedCodesToUnicode[r]?t.namedCodesToUnicode[r]:n})}},v:function(n){return n.S}},textBolded:{t:En(Q),q:Hn.MED,l:function(n,t,r){return{S:t(n[2],r)}},v:function(n,t,r){return l("strong",{key:r.h},t(n.S,r))}},textEmphasized:{t:En(X),q:Hn.LOW,l:function(n,t,r){return{S:t(n[2],r)}},v:function(n,t,r){return l("em",{key:r.h},t(n.S,r))}},textEscaped:{t:En(Y),q:Hn.HIGH,l:function(n){return{S:n[1],type:"text"}}},textMarked:{t:En(J),q:Hn.LOW,l:Zn,v:function(n,t,r){return l("mark",{key:r.h},t(n.S,r))}},textStrikethroughed:{t:En(K),q:Hn.LOW,l:Zn,v:function(n,t,r){return l("del",{key:r.h},t(n.S,r))}}};!0!==t.disableParsingRawHTML&&(W.htmlBlock={t:Ln(R),q:Hn.HIGH,l:function(n,t,r){var e,u=n[3].match(rn),o=new RegExp("^"+u[1],"gm"),i=n[3].replace(o,""),f=(e=i,On.some(function(n){return n.test(e)})?Fn:Cn),a=n[1].toLowerCase(),l=-1!==c.indexOf(a);r.Z=r.Z||"a"===a;var v=l?n[3]:f(t,i,r);return r.Z=!1,{I:q(n[2]),S:v,G:l,H:l?a:n[1]}},v:function(n,t,r){return l(n.H,e({key:r.h},n.I),n.G?n.S:t(n.S,r))}},W.htmlSelfClosing={t:Ln(A),q:Hn.HIGH,l:function(n){return{I:q(n[2]||""),H:n[1]}},v:function(n,t,r){return l(n.H,e({},n.I,{key:r.h}))}});var en,un=function(n){var t=Object.keys(n);function r(e,u){for(var o=[],i="";e;)for(var c=0;c<t.length;){var f=t[c],a=n[f],l=a.t(e,u,i);if(l){var v=l[0];e=e.substring(v.length);var s=a.l(l,r,u);null==s.type&&(s.type=f),o.push(s),i=v;break}c++}return o}return t.sort(function(t,r){var e=n[t].q,u=n[r].q;return e!==u?e-u:t<r?-1:1}),function(n,t){return r(function(n){return n.replace(S,"\n").replace(b,"").replace(Z," ")}(n),t)}}(W),on=(en=function(n){return function(t,r,e){return n[t.type].v(t,r,e)}}(W),function n(t,r){if(void 0===r&&(r={}),Array.isArray(t)){for(var e=r.h,u=[],o=!1,i=0;i<t.length;i++){r.h=i;var c=n(t[i],r),f="string"==typeof c;f&&o?u[u.length-1]+=c:null!==c&&u.push(c),o=f}return r.h=e,u}return en(t,n,r)}),cn=P(n);return U.length?l("div",null,cn,l("footer",{key:"footer"},U.map(function(n){return l("div",{id:t.slugify(n.B),key:n.B},n.B,on(un(n.O,{u:!0})))}))):cn}function Qn(n){var t=n.children,e=n.options,o=function(n,t){if(null==n)return{};var r,e,u={},o=Object.keys(n);for(e=0;e<o.length;e++)t.indexOf(r=o[e])>=0||(u[r]=n[r]);return u}(n,u);return r.cloneElement(Wn(t,e),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"}(Hn||(Hn={})),Object.assign(Qn,{compiler:Wn}),Qn});
//# sourceMappingURL=index.umd.js.map

@@ -0,0 +0,0 @@ import { CSSProp } from 'styled-components';

@@ -6,3 +6,3 @@ {

"license": "MIT",
"version": "7.3.1",
"version": "7.3.2",
"engines": {

@@ -31,3 +31,3 @@ "node": ">= 10"

"import": {
"types": "./index.d.ts",
"types": "./dist/index.d.ts",
"node": "./dist/index.module.js",

@@ -34,0 +34,0 @@ "default": "./dist/index.modern.js"

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc