|
|
|
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).markdownit=t()}(this,(function(){"use strict";function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var t={},r={};function n(e,t,i){var s,o,a,c,u,l="";for("string"!=typeof t&&(i=t,t=n.defaultChars),void 0===i&&(i=!0),u=function(e){var t,n,i=r[e];if(i)return i;for(i=r[e]=[],t=0;t<128;t++)n=String.fromCharCode(t),/^[0-9a-z]$/i.test(n)?i.push(n):i.push("%"+("0"+t.toString(16).toUpperCase()).slice(-2));for(t=0;t<e.length;t++)i[e.charCodeAt(t)]=e[t];return i}(t),s=0,o=e.length;s<o;s++)if(a=e.charCodeAt(s),i&&37===a&&s+2<o&&/^[0-9a-f]{2}$/i.test(e.slice(s+1,s+3)))l+=e.slice(s,s+3),s+=2;else if(a<128)l+=u[a];else if(a>=55296&&a<=57343){if(a>=55296&&a<=56319&&s+1<o&&(c=e.charCodeAt(s+1))>=56320&&c<=57343){l+=encodeURIComponent(e[s]+e[s+1]),s++;continue}l+="%EF%BF%BD"}else l+=encodeURIComponent(e[s]);return l}n.defaultChars=";/?:@&=+$,-_.!~*'()#",n.componentChars="-_.!~*'()";var i=n,s={};function o(e,t){var r;return"string"!=typeof t&&(t=o.defaultChars),r=function(e){var t,r,n=s[e];if(n)return n;for(n=s[e]=[],t=0;t<128;t++)r=String.fromCharCode(t),n.push(r);for(t=0;t<e.length;t++)n[r=e.charCodeAt(t)]="%"+("0"+r.toString(16).toUpperCase()).slice(-2);return n}(t),e.replace(/(%[a-f0-9]{2})+/gi,(function(e){var t,n,i,s,o,a,c,u="";for(t=0,n=e.length;t<n;t+=3)(i=parseInt(e.slice(t+1,t+3),16))<128?u+=r[i]:192==(224&i)&&t+3<n&&128==(192&(s=parseInt(e.slice(t+4,t+6),16)))?(u+=(c=i<<6&1984|63&s)<128?"\ufffd\ufffd":String.fromCharCode(c),t+=3):224==(240&i)&&t+6<n&&(s=parseInt(e.slice(t+4,t+6),16),o=parseInt(e.slice(t+7,t+9),16),128==(192&s)&&128==(192&o))?(u+=(c=i<<12&61440|s<<6&4032|63&o)<2048||c>=55296&&c<=57343?"\ufffd\ufffd\ufffd":String.fromCharCode(c),t+=6):240==(248&i)&&t+9<n&&(s=parseInt(e.slice(t+4,t+6),16),o=parseInt(e.slice(t+7,t+9),16),a=parseInt(e.slice(t+10,t+12),16),128==(192&s)&&128==(192&o)&&128==(192&a))?((c=i<<18&1835008|s<<12&258048|o<<6&4032|63&a)<65536||c>1114111?u+="\ufffd\ufffd\ufffd\ufffd":(c-=65536,u+=String.fromCharCode(55296+(c>>10),56320+(1023&c))),t+=9):u+="\ufffd";return u}))}o.defaultChars=";/?:@&=+$,#",o.componentChars="";var a=o;function c(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}var u=/^([a-z0-9.+-]+:)/i,l=/:[0-9]*$/,h=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,p=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),f=["'"].concat(p),d=["%","/","?",";","#"].concat(f),_=["/","?","#"],m=/^[+a-z0-9A-Z_-]{0,63}$/,g=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,k={javascript:!0,"javascript:":!0},y={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};c.prototype.parse=function(e,t){var r,n,i,s,o,a=e;if(a=a.trim(),!t&&1===e.split("#").length){var c=h.exec(a);if(c)return this.pathname=c[1],c[2]&&(this.search=c[2]),this}var l=u.exec(a);if(l&&(i=(l=l[0]).toLowerCase(),this.protocol=l,a=a.substr(l.length)),(t||l||a.match(/^\/\/[^@\/]+@[^@\/]+/))&&(!(o="//"===a.substr(0,2))||l&&k[l]||(a=a.substr(2),this.slashes=!0)),!k[l]&&(o||l&&!y[l])){var p,f,C=-1;for(r=0;r<_.length;r++)-1!==(s=a.indexOf(_[r]))&&(-1===C||s<C)&&(C=s);for(-1!==(f=-1===C?a.lastIndexOf("@"):a.lastIndexOf("@",C))&&(p=a.slice(0,f),a=a.slice(f+1),this.auth=p),C=-1,r=0;r<d.length;r++)-1!==(s=a.indexOf(d[r]))&&(-1===C||s<C)&&(C=s);-1===C&&(C=a.length),":"===a[C-1]&&C--;var b=a.slice(0,C);a=a.slice(C),this.parseHost(b),this.hostname=this.hostname||"";var v="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!v){var A=this.hostname.split(/\./);for(r=0,n=A.length;r<n;r++){var E=A[r];if(E&&!E.match(m)){for(var x="",D=0,w=E.length;D<w;D++)E.charCodeAt(D)>127?x+="x":x+=E[D];if(!x.match(m)){var F=A.slice(0,r),S=A.slice(r+1),z=E.match(g);z&&(F.push(z[1]),S.unshift(z[2])),S.length&&(a=S.join(".")+a),this.hostname=F.join(".");break}}}}this.hostname.length>255&&(this.hostname="
|