Files

2 lines
10 KiB
JavaScript
Raw Permalink Normal View History

import{d as Be}from"./vendor-micromark-util-decode-numeric-character-reference-CNs1qBpV.js";import{d as Re}from"./vendor-micromark-util-decode-string-fHsnqYdj.js";import{n as T}from"./vendor-micromark-util-normalize-identifier-C9ANKk3v.js";import{d as Ce}from"./vendor-decode-named-character-reference-C3-224fz.js";import{p as He,a as Le,b as ze}from"./vendor-micromark-Dc687xHH.js";import{s as I}from"./vendor-unist-util-stringify-position-Ch_qCilz.js";import{t as Pe}from"./vendor-mdast-util-to-string-C_aolqmU.js";const M={}.hasOwnProperty;function je(o,a,l){return typeof a!="string"&&(l=a,a=void 0),Oe(l)(He(Le(l).document().write(ze()(o,a,!0))))}function Oe(o){const a={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:r(P),autolinkProtocol:p,autolinkEmail:p,atxHeading:r(H),blockQuote:r(me),characterEscape:p,characterReference:p,codeFenced:r(C),codeFencedFenceInfo:h,codeFencedFenceMeta:h,codeIndented:r(C,h),codeText:r(xe,h),codeTextData:p,data:p,codeFlowValue:p,definition:r(ye),definitionDestinationString:h,definitionLabelString:h,definitionTitleString:h,emphasis:r(be),hardBreakEscape:r(L),hardBreakTrailing:r(L),htmlFlow:r(z,h),htmlFlowData:p,htmlText:r(z,h),htmlTextData:p,image:r(Se),label:h,link:r(P),listItem:r(we),listItemValue:U,listOrdered:r(O,N),listUnordered:r(O),paragraph:r(Ie),reference:he,referenceString:h,resourceDestinationString:h,resourceTitleString:h,setextHeading:r(H),strong:r(Te),thematicBreak:r(Fe)},exit:{atxHeading:c(),atxHeadingSequence:X,autolink:c(),autolinkEmail:ge,autolinkProtocol:ke,blockQuote:c(),characterEscapeValue:k,characterReferenceMarkerHexadecimal:R,characterReferenceMarkerNumeric:R,characterReferenceValue:fe,characterReference:pe,codeFenced:c(W),codeFencedFence:A,codeFencedFenceInfo:_,codeFencedFenceMeta:j,codeFlowValue:k,codeIndented:c($),codeText:c(ie),codeTextData:k,data:k,definition:c(),definitionDestinationString:K,definitionLabelString:G,definitionTitleString:J,emphasis:c(),hardBreakEscape:c(B),hardBreakTrailing:c(B),htmlFlow:c(te),htmlFlowData:k,htmlText:c(ne),htmlTextData:k,image:c(se),label:ce,labelText:re,lineEnding:ee,link:c(ae),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:ue,resourceDestinationString:oe,resourceTitleString:le,resource:de,setextHeading:c(v),setextHeadingLineSequence:Z,setextHeadingText:Y,strong:c(),thematicBreak:c()}};V(a,(o||{}).mdastExtensions||[]);const l={};return d;function d(e){let t={type:"root",children:[]};const n={stack:[t],tokenStack:[],config:a,enter:E,exit:F,buffer:h,resume:q,data:l},i=[];let s=-1;for(;++s<e.length;)if(e[s][1].type==="listOrdered"||e[s][1].type==="listUnordered")if(e[s][0]==="enter")i.push(s);else{const f=i.pop();s=Q(e,f,s)}for(s=-1;++s<e.length;){const f=a[e[s][0]];M.call(f,e[s][1].type)&&f[e[s][1].type].call(Object.assign({sliceSerialize:e[s][2].sliceSerialize},n),e[s][1])}if(n.tokenStack.length>0){const f=n.tokenStack[n.tokenStack.length-1];(f[1]||D).call(n,void 0,f[0])}for(t.position={start:x(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:x(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},s=-1;++s<a.transforms.length;)t=a.transforms[s](t)||t;return t}function Q(e,t,n){let i=t-1,s=-1,f=!1,y,g,S,w;for(;++i<=n;){const u=e[i];switch(u[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{u[0]==="enter"?s++:s--,w=void 0;break}case"lineEndingBlank":{u[0]==="enter"&&(y&&!w&&!s&&!S&&(S=i),w=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:w=void 0}if(!s&&u[0]==="enter"&&u[1].type==="listItemPrefix"||s===-1&&u[0]==="exit"&&(u[1].type==="listUnordered"||u[1].type==="listOrdered")){if(y){let b=i;for(g=void 0;b--;){const m=e[b];if(m[1].type==="lineEnding"||m[1].type==="lineEndingBlank"){if(m[0]==="exit")continue;g&&(e[g][1].type="lineEndingBlank",f=!0),m[1].type="lineEnding",g=b}else if(!(m[1].type==="linePrefix"||m[1].type==="blockQuotePrefix"||m[1].type==="blockQuotePrefixWhitespace"||m[1].type==="blockQuoteMarker"||m[1].type==="listItemI