github-pages-deploy-action/node_modules/prettier/parser-markdown.js

20 lines
170 KiB
JavaScript
Raw Normal View History

2020-09-13 06:19:45 +08:00
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define(r):((e="undefined"!=typeof globalThis?globalThis:e||self).prettierPlugins=e.prettierPlugins||{},e.prettierPlugins.markdown=r())}(this,(function(){"use strict";var e=function(){for(var e={},t=0;t<arguments.length;t++){var n=arguments[t];for(var u in n)r.call(n,u)&&(e[u]=n[u])}return e},r=Object.prototype.hasOwnProperty;function t(e,r,t){return e(t={path:r,exports:{},require:function(e,r){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==r&&t.path)}},t.exports),t.exports}function n(e){return e&&e.default||e}var u=Object.freeze({__proto__:null,default:{}}),i=t((function(e){"function"==typeof Object.create?e.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,r){if(r){e.super_=r;var t=function(){};t.prototype=r.prototype,e.prototype=new t,e.prototype.constructor=e}}})),o=n(u),a=t((function(e){try{var r=o;if("function"!=typeof r.inherits)throw"";e.exports=r.inherits}catch(r){e.exports=i}})),s=function(r){var t,n,u;for(n in a(o,r),a(i,o),t=o.prototype)(u=t[n])&&"object"==typeof u&&(t[n]="concat"in u?u.concat():e(u));return o;function i(e){return r.apply(this,e)}function o(){return this instanceof o?r.apply(this,arguments):new i(arguments)}};var c=function(e,r,t){return function(){var n=t||this,u=n[e];return n[e]=!r,i;function i(){n[e]=u}}};var l=function(e){var r=function(e){var r=[],t=e.indexOf("\n");for(;-1!==t;)r.push(t+1),t=e.indexOf("\n",t+1);return r.push(e.length+1),r}(String(e));return{toPosition:f(r),toOffset:p(r)}};function f(e){return function(r){var t=-1,n=e.length;if(r<0)return{};for(;++t<n;)if(e[t]>r)return{line:t+1,column:r-(e[t-1]||0)+1,offset:r};return{}}}function p(e){return function(r){var t=r&&r.line,n=r&&r.column;if(!isNaN(t)&&!isNaN(n)&&t-1 in e)return(e[t-2]||0)+n-1||0;return-1}}var D=function(e,r){return function(t){var n,u=0,i=t.indexOf("\\"),o=e[r],a=[];for(;-1!==i;)a.push(t.slice(u,i)),u=i+1,(n=t.charAt(u))&&-1!==o.indexOf(n)||a.push("\\"),i=t.indexOf("\\",u+1);return a.push(t.slice(u)),a.join("")}};var d={AElig:"Æ",AMP:"&",Aacute:"Á",Acirc:"Â",Agrave:"À",Aring:"Å",Atilde:"Ã",Auml:"Ä",COPY:"©",Ccedil:"Ç",ETH:"Ð",Eacute:"É",Ecirc:"Ê",Egrave:"È",Euml:"Ë",GT:">",Iacute:"Í",Icirc:"Î",Igrave:"Ì",Iuml:"Ï",LT:"<",Ntilde:"Ñ",Oacute:"Ó",Ocirc:"Ô",Ograve:"Ò",Oslash:"Ø",Otilde:"Õ",Ouml:"Ö",QUOT:'"',REG:"®",THORN:"Þ",Uacute:"Ú",Ucirc:"Û",Ugrave:"Ù",Uuml:"Ü",Yacute:"Ý",aacute:"á",acirc:"â",acute:"´",aelig:"æ",agrave:"à",amp:"&",aring:"å",atilde:"ã",auml:"ä",brvbar:"¦",ccedil:"ç",cedil:"¸",cent:"¢",copy:"©",curren:"¤",deg:"°",divide:"÷",eacute:"é",ecirc:"ê",egrave:"è",eth:"ð",euml:"ë",frac12:"½",frac14:"¼",frac34:"¾",gt:">",iacute:"í",icirc:"î",iexcl:"¡",igrave:"ì",iquest:"¿",iuml:"ï",laquo:"«",lt:"<",macr:"¯",micro:"µ",middot:"·",nbsp:" ",not:"¬",ntilde:"ñ",oacute:"ó",ocirc:"ô",ograve:"ò",ordf:"ª",ordm:"º",oslash:"ø",otilde:"õ",ouml:"ö",para:"¶",plusmn:"±",pound:"£",quot:'"',raquo:"»",reg:"®",sect:"§",shy:"­",sup1:"¹",sup2:"²",sup3:"³",szlig:"ß",thorn:"þ",times:"×",uacute:"ú",ucirc:"û",ugrave:"ù",uml:"¨",uuml:"ü",yacute:"ý",yen:"¥",yuml:"ÿ"},h=Object.freeze({__proto__:null,AElig:"Æ",AMP:"&",Aacute:"Á",Acirc:"Â",Agrave:"À",Aring:"Å",Atilde:"Ã",Auml:"Ä",COPY:"©",Ccedil:"Ç",ETH:"Ð",Eacute:"É",Ecirc:"Ê",Egrave:"È",Euml:"Ë",GT:">",Iacute:"Í",Icirc:"Î",Igrave:"Ì",Iuml:"Ï",LT:"<",Ntilde:"Ñ",Oacute:"Ó",Ocirc:"Ô",Ograve:"Ò",Oslash:"Ø",Otilde:"Õ",Ouml:"Ö",QUOT:'"',REG:"®",THORN:"Þ",Uacute:"Ú",Ucirc:"Û",Ugrave:"Ù",Uuml:"Ü",Yacute:"Ý",aacute:"á",acirc:"â",acute:"´",aelig:"æ",agrave:"à",amp:"&",aring:"å",atilde:"ã",auml:"ä",brvbar:"¦",ccedil:"ç",cedil:"¸",cent:"¢",copy:"©",curren:"¤",deg:"°",divide:"÷",eacute:"é",ecirc:"ê",egrave:"è",eth:"ð",euml:"ë",frac12:"½",frac14:"<EFBFBD>
2020-01-28 13:07:56 +08:00
/*!
2020-03-31 20:40:00 +08:00
* repeat-string <https://github.com/jonschlinkert/repeat-string>
2020-01-28 13:07:56 +08:00
*
2020-03-31 20:40:00 +08:00
* Copyright (c) 2014-2015, Jon Schlinkert.
* Licensed under the MIT License.
2020-09-13 06:19:45 +08:00
*/;var be,Ee="",ve=function(e,r){if("string"!=typeof e)throw new TypeError("expected a string");if(1===r)return e;if(2===r)return e+e;var t=e.length*r;if(be!==e||void 0===be)be=e,Ee="";else if(Ee.length>=t)return Ee.substr(0,t);for(;t>Ee.length&&r>1;)1&r&&(Ee+=e),r>>=1,e+=e;return Ee=(Ee+=e).substr(0,t)};var ye=function(e){var r=String(e),t=r.length;for(;"\n"===r.charAt(--t););return r.slice(0,t+1)};var Ce=function(e,r,t){var n,u,i,o=-1,a=r.length,s="",c="",l="",f="";for(;++o<a;)if(n=r.charAt(o),i)if(i=!1,s+=l,c+=f,l="",f="","\n"===n)l=n,f=n;else for(s+=n,c+=n;++o<a;){if(!(n=r.charAt(o))||"\n"===n){f=n,l=n;break}s+=n,c+=n}else if(" "===n&&r.charAt(o+1)===n&&r.charAt(o+2)===n&&r.charAt(o+3)===n)l+=Ae,o+=3,i=!0;else if("\t"===n)l+=n,i=!0;else{for(u="";"\t"===n||" "===n;)u+=n,n=r.charAt(++o);if("\n"!==n)break;l+=u+n,f+=n}if(c)return!!t||e(s)({type:"code",lang:null,meta:null,value:ye(c)})},Ae=ve(" ",4);var we=function(e,r,t){var n,u,i,o,a,s,c,l,f,p,D,d,h,g=this.options.gfm,m=r.length+1,b=0,E="";if(!g)return;for(;b<m&&(" "===(i=r.charAt(b))||"\t"===i);)E+=i,b++;if(d=b,"~"!==(i=r.charAt(b))&&"`"!==i)return;b++,u=i,n=1,E+=i;for(;b<m&&(i=r.charAt(b))===u;)E+=i,n++,b++;if(n<3)return;for(;b<m&&(" "===(i=r.charAt(b))||"\t"===i);)E+=i,b++;o="",c="";for(;b<m&&"\n"!==(i=r.charAt(b))&&("`"!==u||i!==u);)" "===i||"\t"===i?c+=i:(o+=c+i,c=""),b++;if((i=r.charAt(b))&&"\n"!==i)return;if(t)return!0;(h=e.now()).column+=E.length,h.offset+=E.length,E+=o,o=this.decode.raw(this.unescape(o),h),c&&(E+=c);c="",p="",D="",l="",f="";var v=!0;for(;b<m;)if(i=r.charAt(b),l+=p,f+=D,p="",D="","\n"===i){for(v?(E+=i,v=!1):(p+=i,D+=i),c="",b++;b<m&&" "===(i=r.charAt(b));)c+=i,b++;if(p+=c,D+=c.slice(d),!(c.length>=4)){for(c="";b<m&&(i=r.charAt(b))===u;)c+=i,b++;if(p+=c,D+=c,!(c.length<n)){for(c="";b<m&&(" "===(i=r.charAt(b))||"\t"===i);)p+=i,D+=i,b++;if(!i||"\n"===i)break}}}else l+=i,D+=i,b++;E+=l+p,b=-1,m=o.length;for(;++b<m;)if(" "===(i=o.charAt(b))||"\t"===i)a||(a=o.slice(0,b));else if(a){s=o.slice(b);break}return e(E)({type:"code",lang:a||o||null,meta:s||null,value:f})};var Fe=t((function(e,r){(r=e.exports=function(e){return e.replace(/^\s*|\s*$/g,"")}).left=function(e){return e.replace(/^\s*/,"")},r.right=function(e){return e.replace(/\s*$/,"")}})),ke=function(e,r,t,n){var u,i,o=e.length,a=-1;for(;++a<o;)if(u=e[a],(void 0===(i=u[1]||{}).pedantic||i.pedantic===t.options.pedantic)&&(void 0===i.commonmark||i.commonmark===t.options.commonmark)&&r[u[0]].apply(t,n))return!0;return!1};var qe=function(e,r,t){var n,u,i,o,a,s,c,l,f,p=this.offset,D=this.blockTokenizers,d=this.interruptBlockquote,h=e.now(),g=h.line,m=r.length,b=[],E=[],v=[],y=0;for(;y<m&&(" "===(u=r.charAt(y))||"\t"===u);)y++;if(">"!==r.charAt(y))return;if(t)return!0;y=0;for(;y<m;){for(o=r.indexOf("\n",y),c=y,l=!1,-1===o&&(o=m);y<m&&(" "===(u=r.charAt(y))||"\t"===u);)y++;if(">"===r.charAt(y)?(y++,l=!0," "===r.charAt(y)&&y++):y=c,a=r.slice(y,o),!l&&!Fe(a)){y=c;break}if(!l&&(i=r.slice(y),ke(d,D,this,[e,i,!0])))break;s=c===y?a:r.slice(c,o),v.push(y-c),b.push(s),E.push(a),y=o+1}y=-1,m=v.length,n=e(b.join("\n"));for(;++y<m;)p[g]=(p[g]||0)+v[y],g++;return f=this.enterBlock(),E=this.tokenizeBlock(E.join("\n"),h),f(),n({type:"blockquote",children:E})};var xe=function(e,r,t){var n,u,i,o=this.options.pedantic,a=r.length+1,s=-1,c=e.now(),l="",f="";for(;++s<a;){if(" "!==(n=r.charAt(s))&&"\t"!==n){s--;break}l+=n}i=0;for(;++s<=a;){if("#"!==(n=r.charAt(s))){s--;break}l+=n,i++}if(i>6)return;if(!i||!o&&"#"===r.charAt(s+1))return;a=r.length+1,u="";for(;++s<a;){if(" "!==(n=r.charAt(s))&&"\t"!==n){s--;break}u+=n}if(!o&&0===u.length&&n&&"\n"!==n)return;if(t)return!0;l+=u,u="",f="";for(;++s<a&&(n=r.charAt(s))&&"\n"!==n;)if(" "===n||"\t"===n||"#"===n){for(;" "===n||"\t"===n;)u+=n,n=r.charAt(++s);if(o||!f||u||"#"!==n){for(;"#"===n;)u+=n,n=r.charAt(++s);for(;" "===n||"\t"===n;)u+=n,n=r.charAt(++s);s--}else f+=n}else f+=u+n,u="";return c.column+=l.length,c.offset+=l.length,e(l+=f+u)({type:"heading",depth:i,children:this.tokenizeInline(f,c)})};var Le=function(e,r,t){var n,u,i,o,a=-1,s=r.length+1,c="";for(;++a<s&&("\t"===(n
2020-03-31 20:40:00 +08:00
/*!
* Determine if an object is a Buffer
2020-01-28 13:07:56 +08:00
*
2020-03-31 20:40:00 +08:00
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
2020-09-13 06:19:45 +08:00
*/;var pt=Object.prototype.hasOwnProperty,Dt=Object.prototype.toString,dt=Object.defineProperty,ht=Object.getOwnPropertyDescriptor,gt=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===Dt.call(e)},mt=function(e){if(!e||"[object Object]"!==Dt.call(e))return!1;var r,t=pt.call(e,"constructor"),n=e.constructor&&e.constructor.prototype&&pt.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!t&&!n)return!1;for(r in e);return void 0===r||pt.call(e,r)},bt=function(e,r){dt&&"__proto__"===r.name?dt(e,r.name,{enumerable:!0,configurable:!0,value:r.newValue,writable:!0}):e[r.name]=r.newValue},Et=function(e,r){if("__proto__"===r){if(!pt.call(e,r))return;if(ht)return ht(e,r).value}return e[r]},vt=function e(){var r,t,n,u,i,o,a=arguments[0],s=1,c=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[1]||{},s=2),(null==a||"object"!=typeof a&&"function"!=typeof a)&&(a={});s<c;++s)if(null!=(r=arguments[s]))for(t in r)n=Et(a,t),a!==(u=Et(r,t))&&(l&&u&&(mt(u)||(i=gt(u)))?(i?(i=!1,o=n&&gt(n)?n:[]):o=n&&mt(n)?n:{},bt(a,{name:t,newValue:e(l,o,u)})):void 0!==u&&bt(a,{name:t,newValue:u}));return a},yt=e=>{if("[object Object]"!==Object.prototype.toString.call(e))return!1;const r=Object.getPrototypeOf(e);return null===r||r===Object.prototype},Ct=[].slice,At=function(e,r){var t;return function(){var r,i=Ct.call(arguments,0),o=e.length>i.length;o&&i.push(n);try{r=e.apply(null,i)}catch(e){if(o&&t)throw e;return n(e)}o||(r&&"function"==typeof r.then?r.then(u,n):r instanceof Error?n(r):u(r))};function n(){t||(t=!0,r.apply(null,arguments))}function u(e){n(null,e)}};var wt=kt;kt.wrap=At;var Ft=[].slice;function kt(){var e=[],r={run:function(){var r=-1,t=Ft.call(arguments,0,-1),n=arguments[arguments.length-1];if("function"!=typeof n)throw new Error("Expected function as last argument, not "+n);function u(i){var o=e[++r],a=Ft.call(arguments,0),s=a.slice(1),c=t.length,l=-1;if(i)n(i);else{for(;++l<c;)null!==s[l]&&void 0!==s[l]||(s[l]=t[l]);t=s,o?At(o,u).apply(null,t):n.apply(null,[null].concat(t))}}u.apply(null,[null].concat(t))},use:function(t){if("function"!=typeof t)throw new Error("Expected `fn` to be a function, not "+t);return e.push(t),r}};return r}var qt={}.hasOwnProperty,xt=function(e){if(!e||"object"!=typeof e)return"";if(qt.call(e,"position")||qt.call(e,"type"))return Nt(e.position);if(qt.call(e,"start")||qt.call(e,"end"))return Nt(e);if(qt.call(e,"line")||qt.call(e,"column"))return Lt(e);return""};function Lt(e){return e&&"object"==typeof e||(e={}),Tt(e.line)+":"+Tt(e.column)}function Nt(e){return e&&"object"==typeof e||(e={}),Lt(e.start)+"-"+Lt(e.end)}function Tt(e){return e&&"number"==typeof e?e:1}var St=Rt;function Ot(){}Ot.prototype=Error.prototype,Rt.prototype=new Ot;var Bt=Rt.prototype;function Rt(e,r,t){var n,u,i;"string"==typeof r&&(t=r,r=null),n=function(e){var r,t=[null,null];"string"==typeof e&&(-1===(r=e.indexOf(":"))?t[1]=e:(t[0]=e.slice(0,r),t[1]=e.slice(r+1)));return t}(t),u=xt(r)||"1:1",i={start:{line:null,column:null},end:{line:null,column:null}},r&&r.position&&(r=r.position),r&&(r.start?(i=r,r=r.start):i.start=r),e.stack&&(this.stack=e.stack,e=e.message),this.message=e,this.name=u,this.reason=e,this.line=r?r.line:null,this.column=r?r.column:null,this.location=i,this.source=n[0],this.ruleId=n[1]}Bt.file="",Bt.name="",Bt.reason="",Bt.message="",Bt.stack="",Bt.fatal=null,Bt.column=null,Bt.line=null;var It="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function Pt(){throw new Error("setTimeout has not been defined")}function jt(){throw new Error("clearTimeout has not been defined")}var Ut=Pt,Gt=jt;function Vt(e){if(Ut===setTimeout)return setTimeout(e,0);if((Ut===Pt||!Ut)&&setTimeout)return Ut=setTimeout,setTimeout(e,0);try{return Ut(e,0)}catch(r){try{return Ut.call(null,e,0)}catch(r){return Ut.call(this,e,0)}}}"function"==typeof It.setTimeout&&(Ut=setTimeout),"function"==typeof It.clearTimeout&&(Gt=clearTimeout);var zt,Mt=[],_t=!1,Ht=-1;function $t(){_t&&zt&&(_t=!1,zt.length?Mt=zt.concat(Mt):Ht=-1,Mt.length&&Xt())}fu
2020-04-30 20:40:07 +08:00
/*!
* Determine if an object is a Buffer
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
2020-09-13 06:19:45 +08:00
*/function mn(e){var r,t,n;if(e){if("string"==typeof e||pn(e))e={contents:e};else if("message"in e&&"messages"in e)return e}else e={};if(!(this instanceof mn))return new mn(e);for(this.data={},this.messages=[],this.history=[],this.cwd=an.cwd(),t=-1,n=gn.length;++t<n;)r=gn[t],dn.call(e,r)&&(this[r]=e[r]);for(r in e)-1===gn.indexOf(r)&&(this[r]=e[r])}function bn(e,r){if(-1!==e.indexOf(ln.sep))throw new Error("`"+r+"` cannot be a path: did not expect `"+ln.sep+"`")}function En(e,r){if(!e)throw new Error("`"+r+"` cannot be empty")}function vn(e,r){if(!e)throw new Error("Setting `"+r+"` requires `path` to be set too")}hn.toString=function(e){var r=this.contents||"";return pn(r)?r.toString(e):String(r)},Object.defineProperty(hn,"path",{get:function(){return this.history[this.history.length-1]},set:function(e){En(e,"path"),e!==this.path&&this.history.push(e)}}),Object.defineProperty(hn,"dirname",{get:function(){return"string"==typeof this.path?ln.dirname(this.path):void 0},set:function(e){vn(this.path,"dirname"),this.path=ln.join(e||"",this.basename)}}),Object.defineProperty(hn,"basename",{get:function(){return"string"==typeof this.path?ln.basename(this.path):void 0},set:function(e){En(e,"basename"),bn(e,"basename"),this.path=ln.join(this.dirname||"",e)}}),Object.defineProperty(hn,"extname",{get:function(){return"string"==typeof this.path?ln.extname(this.path):void 0},set:function(e){var r=e||"";if(bn(r,"extname"),vn(this.path,"extname"),r){if("."!==r.charAt(0))throw new Error("`extname` must start with `.`");if(-1!==r.indexOf(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=fn(this.path,r)}}),Object.defineProperty(hn,"stem",{get:function(){return"string"==typeof this.path?ln.basename(this.path,this.extname):void 0},set:function(e){En(e,"stem"),bn(e,"stem"),this.path=ln.join(this.dirname||"",e+(this.extname||""))}});var yn=Dn,Cn=Dn.prototype;Cn.message=function(e,r,t){var n=this.path,u=new St(e,r,t);n&&(u.name=n+":"+u.name,u.file=n);return u.fatal=!1,this.messages.push(u),u},Cn.info=function(){var e=this.message.apply(this,arguments);return e.fatal=null,e},Cn.fail=function(){var e=this.message.apply(this,arguments);throw e.fatal=!0,e};var An=function e(){var r=[],t=wt(),n={},u=!1,i=-1;return o.data=function(e,r){if("string"==typeof e)return 2===arguments.length?(Nn("data",u),n[e]=r,o):Fn.call(n,e)&&n[e]||null;if(e)return Nn("data",u),n=e,o;return n},o.freeze=a,o.attachers=r,o.use=function(e){var t;if(Nn("use",u),null==e);else if("function"==typeof e)l.apply(null,arguments);else{if("object"!=typeof e)throw new Error("Expected usable value, not `"+e+"`");"length"in e?c(e):i(e)}t&&(n.settings=vt(n.settings||{},t));return o;function i(e){c(e.plugins),e.settings&&(t=vt(t||{},e.settings))}function a(e){if("function"==typeof e)l(e);else{if("object"!=typeof e)throw new Error("Expected usable value, not `"+e+"`");"length"in e?l.apply(null,e):i(e)}}function c(e){var r,t;if(null==e);else{if("object"!=typeof e||!("length"in e))throw new Error("Expected a list of plugins, not `"+e+"`");for(r=e.length,t=-1;++t<r;)a(e[t])}}function l(e,t){var n=s(e);n?(yt(n[1])&&yt(t)&&(t=vt(n[1],t)),n[1]=t):r.push(wn.call(arguments))}},o.parse=function(e){var r,t=yn(e);if(a(),xn("parse",r=o.Parser),qn(r,"parse"))return new r(String(t),t).parse();return r(String(t),t)},o.stringify=function(e,r){var t,n=yn(r);if(a(),Ln("stringify",t=o.Compiler),Tn(e),qn(t,"compile"))return new t(e,n).compile();return t(e,n)},o.run=c,o.runSync=function(e,r){var t,n=!1;return c(e,r,u),Sn("runSync","run",n),t;function u(e,r){n=!0,ft(e),t=r}},o.process=l,o.processSync=f,o;function o(){for(var t=e(),u=r.length,i=-1;++i<u;)t.use.apply(null,r[i]);return t.data(vt(!0,{},n)),t}function a(){var e,n,a,s;if(u)return o;for(;++i<r.length;)n=(e=r[i])[0],null,!1!==(a=e[1])&&(!0===a&&(e[1]=void 0),"function"==typeof(s=n.apply(o,e.slice(1)))&&t.use(s));return u=!0,i=1/0,o}function s(e){for(var t,n=r.length,u=-1;++u<n;)if((t=r[u])[0]===e)return t}function c(e,r,n){if(Tn(e),a(),n||"function"!=typeof r||(n=r,r=null),!n)return new Promise(u);function u(u,i){t.run(e,y