| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577 |
- var __defProp = Object.defineProperty;
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
- var __getOwnPropNames = Object.getOwnPropertyNames;
- var __hasOwnProp = Object.prototype.hasOwnProperty;
- var __export = (target, all2) => {
- for (var name in all2)
- __defProp(target, name, { get: all2[name], enumerable: true });
- };
- var __copyProps = (to, from, except, desc) => {
- if (from && typeof from === "object" || typeof from === "function") {
- for (let key of __getOwnPropNames(from))
- if (!__hasOwnProp.call(to, key) && key !== except)
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
- }
- return to;
- };
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
- // remark-gfm.js
- var remark_gfm_exports = {};
- __export(remark_gfm_exports, {
- default: () => remark_gfm_default
- });
- module.exports = __toCommonJS(remark_gfm_exports);
- // node_modules/ccount/index.js
- function ccount(value, character) {
- const source = String(value);
- if (typeof character !== "string") {
- throw new TypeError("Expected character");
- }
- let count = 0;
- let index = source.indexOf(character);
- while (index !== -1) {
- count++;
- index = source.indexOf(character, index + character.length);
- }
- return count;
- }
- // node_modules/devlop/lib/default.js
- function ok() {
- }
- // node_modules/micromark-util-character/index.js
- var asciiAlpha = regexCheck(/[A-Za-z]/);
- var asciiAlphanumeric = regexCheck(/[\dA-Za-z]/);
- var asciiAtext = regexCheck(/[#-'*+\--9=?A-Z^-~]/);
- function asciiControl(code3) {
- return (
- // Special whitespace codes (which have negative values), C0 and Control
- // character DEL
- code3 !== null && (code3 < 32 || code3 === 127)
- );
- }
- var asciiDigit = regexCheck(/\d/);
- var asciiHexDigit = regexCheck(/[\dA-Fa-f]/);
- var asciiPunctuation = regexCheck(/[!-/:-@[-`{-~]/);
- function markdownLineEnding(code3) {
- return code3 !== null && code3 < -2;
- }
- function markdownLineEndingOrSpace(code3) {
- return code3 !== null && (code3 < 0 || code3 === 32);
- }
- function markdownSpace(code3) {
- return code3 === -2 || code3 === -1 || code3 === 32;
- }
- var unicodePunctuation = regexCheck(/\p{P}|\p{S}/u);
- var unicodeWhitespace = regexCheck(/\s/);
- function regexCheck(regex) {
- return check;
- function check(code3) {
- return code3 !== null && code3 > -1 && regex.test(String.fromCharCode(code3));
- }
- }
- // node_modules/mdast-util-find-and-replace/node_modules/escape-string-regexp/index.js
- function escapeStringRegexp(string) {
- if (typeof string !== "string") {
- throw new TypeError("Expected a string");
- }
- return string.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
- }
- // node_modules/unist-util-visit-parents/node_modules/unist-util-is/lib/index.js
- var convert = (
- // Note: overloads in JSDoc can’t yet use different `@template`s.
- /**
- * @type {(
- * (<Condition extends string>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & {type: Condition}) &
- * (<Condition extends Props>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Condition) &
- * (<Condition extends TestFunction>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Predicate<Condition, Node>) &
- * ((test?: null | undefined) => (node?: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node) &
- * ((test?: Test) => Check)
- * )}
- */
- /**
- * @param {Test} [test]
- * @returns {Check}
- */
- function(test) {
- if (test === null || test === void 0) {
- return ok2;
- }
- if (typeof test === "function") {
- return castFactory(test);
- }
- if (typeof test === "object") {
- return Array.isArray(test) ? anyFactory(test) : propsFactory(test);
- }
- if (typeof test === "string") {
- return typeFactory(test);
- }
- throw new Error("Expected function, string, or object as test");
- }
- );
- function anyFactory(tests) {
- const checks = [];
- let index = -1;
- while (++index < tests.length) {
- checks[index] = convert(tests[index]);
- }
- return castFactory(any);
- function any(...parameters) {
- let index2 = -1;
- while (++index2 < checks.length) {
- if (checks[index2].apply(this, parameters)) return true;
- }
- return false;
- }
- }
- function propsFactory(check) {
- const checkAsRecord = (
- /** @type {Record<string, unknown>} */
- check
- );
- return castFactory(all2);
- function all2(node2) {
- const nodeAsRecord = (
- /** @type {Record<string, unknown>} */
- /** @type {unknown} */
- node2
- );
- let key;
- for (key in check) {
- if (nodeAsRecord[key] !== checkAsRecord[key]) return false;
- }
- return true;
- }
- }
- function typeFactory(check) {
- return castFactory(type);
- function type(node2) {
- return node2 && node2.type === check;
- }
- }
- function castFactory(testFunction) {
- return check;
- function check(value, index, parent) {
- return Boolean(
- looksLikeANode(value) && testFunction.call(
- this,
- value,
- typeof index === "number" ? index : void 0,
- parent || void 0
- )
- );
- }
- }
- function ok2() {
- return true;
- }
- function looksLikeANode(value) {
- return value !== null && typeof value === "object" && "type" in value;
- }
- // node_modules/unist-util-visit-parents/lib/color.js
- function color(d) {
- return d;
- }
- // node_modules/unist-util-visit-parents/lib/index.js
- var empty = [];
- var CONTINUE = true;
- var EXIT = false;
- var SKIP = "skip";
- function visitParents(tree, test, visitor, reverse) {
- let check;
- if (typeof test === "function" && typeof visitor !== "function") {
- reverse = visitor;
- visitor = test;
- } else {
- check = test;
- }
- const is4 = convert(check);
- const step = reverse ? -1 : 1;
- factory(tree, void 0, [])();
- function factory(node2, index, parents) {
- const value = (
- /** @type {Record<string, unknown>} */
- node2 && typeof node2 === "object" ? node2 : {}
- );
- if (typeof value.type === "string") {
- const name = (
- // `hast`
- typeof value.tagName === "string" ? value.tagName : (
- // `xast`
- typeof value.name === "string" ? value.name : void 0
- )
- );
- Object.defineProperty(visit2, "name", {
- value: "node (" + color(node2.type + (name ? "<" + name + ">" : "")) + ")"
- });
- }
- return visit2;
- function visit2() {
- let result = empty;
- let subresult;
- let offset;
- let grandparents;
- if (!test || is4(node2, index, parents[parents.length - 1] || void 0)) {
- result = toResult(visitor(node2, parents));
- if (result[0] === EXIT) {
- return result;
- }
- }
- if ("children" in node2 && node2.children) {
- const nodeAsParent = (
- /** @type {UnistParent} */
- node2
- );
- if (nodeAsParent.children && result[0] !== SKIP) {
- offset = (reverse ? nodeAsParent.children.length : -1) + step;
- grandparents = parents.concat(nodeAsParent);
- while (offset > -1 && offset < nodeAsParent.children.length) {
- const child = nodeAsParent.children[offset];
- subresult = factory(child, offset, grandparents)();
- if (subresult[0] === EXIT) {
- return subresult;
- }
- offset = typeof subresult[1] === "number" ? subresult[1] : offset + step;
- }
- }
- }
- return result;
- }
- }
- }
- function toResult(value) {
- if (Array.isArray(value)) {
- return value;
- }
- if (typeof value === "number") {
- return [CONTINUE, value];
- }
- return value === null || value === void 0 ? empty : [value];
- }
- // node_modules/mdast-util-find-and-replace/node_modules/unist-util-is/lib/index.js
- var convert2 = (
- // Note: overloads in JSDoc can’t yet use different `@template`s.
- /**
- * @type {(
- * (<Condition extends string>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & {type: Condition}) &
- * (<Condition extends Props>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Condition) &
- * (<Condition extends TestFunction>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Predicate<Condition, Node>) &
- * ((test?: null | undefined) => (node?: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node) &
- * ((test?: Test) => Check)
- * )}
- */
- /**
- * @param {Test} [test]
- * @returns {Check}
- */
- function(test) {
- if (test === null || test === void 0) {
- return ok3;
- }
- if (typeof test === "function") {
- return castFactory2(test);
- }
- if (typeof test === "object") {
- return Array.isArray(test) ? anyFactory2(test) : propsFactory2(test);
- }
- if (typeof test === "string") {
- return typeFactory2(test);
- }
- throw new Error("Expected function, string, or object as test");
- }
- );
- function anyFactory2(tests) {
- const checks = [];
- let index = -1;
- while (++index < tests.length) {
- checks[index] = convert2(tests[index]);
- }
- return castFactory2(any);
- function any(...parameters) {
- let index2 = -1;
- while (++index2 < checks.length) {
- if (checks[index2].apply(this, parameters)) return true;
- }
- return false;
- }
- }
- function propsFactory2(check) {
- const checkAsRecord = (
- /** @type {Record<string, unknown>} */
- check
- );
- return castFactory2(all2);
- function all2(node2) {
- const nodeAsRecord = (
- /** @type {Record<string, unknown>} */
- /** @type {unknown} */
- node2
- );
- let key;
- for (key in check) {
- if (nodeAsRecord[key] !== checkAsRecord[key]) return false;
- }
- return true;
- }
- }
- function typeFactory2(check) {
- return castFactory2(type);
- function type(node2) {
- return node2 && node2.type === check;
- }
- }
- function castFactory2(testFunction) {
- return check;
- function check(value, index, parent) {
- return Boolean(
- looksLikeANode2(value) && testFunction.call(
- this,
- value,
- typeof index === "number" ? index : void 0,
- parent || void 0
- )
- );
- }
- }
- function ok3() {
- return true;
- }
- function looksLikeANode2(value) {
- return value !== null && typeof value === "object" && "type" in value;
- }
- // node_modules/mdast-util-find-and-replace/lib/index.js
- function findAndReplace(tree, list2, options) {
- const settings = options || {};
- const ignored = convert2(settings.ignore || []);
- const pairs = toPairs(list2);
- let pairIndex = -1;
- while (++pairIndex < pairs.length) {
- visitParents(tree, "text", visitor);
- }
- function visitor(node2, parents) {
- let index = -1;
- let grandparent;
- while (++index < parents.length) {
- const parent = parents[index];
- const siblings = grandparent ? grandparent.children : void 0;
- if (ignored(
- parent,
- siblings ? siblings.indexOf(parent) : void 0,
- grandparent
- )) {
- return;
- }
- grandparent = parent;
- }
- if (grandparent) {
- return handler(node2, parents);
- }
- }
- function handler(node2, parents) {
- const parent = parents[parents.length - 1];
- const find = pairs[pairIndex][0];
- const replace2 = pairs[pairIndex][1];
- let start = 0;
- const siblings = parent.children;
- const index = siblings.indexOf(node2);
- let change = false;
- let nodes = [];
- find.lastIndex = 0;
- let match = find.exec(node2.value);
- while (match) {
- const position = match.index;
- const matchObject = {
- index: match.index,
- input: match.input,
- stack: [...parents, node2]
- };
- let value = replace2(...match, matchObject);
- if (typeof value === "string") {
- value = value.length > 0 ? { type: "text", value } : void 0;
- }
- if (value === false) {
- find.lastIndex = position + 1;
- } else {
- if (start !== position) {
- nodes.push({
- type: "text",
- value: node2.value.slice(start, position)
- });
- }
- if (Array.isArray(value)) {
- nodes.push(...value);
- } else if (value) {
- nodes.push(value);
- }
- start = position + match[0].length;
- change = true;
- }
- if (!find.global) {
- break;
- }
- match = find.exec(node2.value);
- }
- if (change) {
- if (start < node2.value.length) {
- nodes.push({ type: "text", value: node2.value.slice(start) });
- }
- parent.children.splice(index, 1, ...nodes);
- } else {
- nodes = [node2];
- }
- return index + nodes.length;
- }
- }
- function toPairs(tupleOrList) {
- const result = [];
- if (!Array.isArray(tupleOrList)) {
- throw new TypeError("Expected find and replace tuple or list of tuples");
- }
- const list2 = !tupleOrList[0] || Array.isArray(tupleOrList[0]) ? tupleOrList : [tupleOrList];
- let index = -1;
- while (++index < list2.length) {
- const tuple = list2[index];
- result.push([toExpression(tuple[0]), toFunction(tuple[1])]);
- }
- return result;
- }
- function toExpression(find) {
- return typeof find === "string" ? new RegExp(escapeStringRegexp(find), "g") : find;
- }
- function toFunction(replace2) {
- return typeof replace2 === "function" ? replace2 : function() {
- return replace2;
- };
- }
- // node_modules/mdast-util-gfm-autolink-literal/lib/index.js
- var inConstruct = "phrasing";
- var notInConstruct = ["autolink", "link", "image", "label"];
- function gfmAutolinkLiteralFromMarkdown() {
- return {
- transforms: [transformGfmAutolinkLiterals],
- enter: {
- literalAutolink: enterLiteralAutolink,
- literalAutolinkEmail: enterLiteralAutolinkValue,
- literalAutolinkHttp: enterLiteralAutolinkValue,
- literalAutolinkWww: enterLiteralAutolinkValue
- },
- exit: {
- literalAutolink: exitLiteralAutolink,
- literalAutolinkEmail: exitLiteralAutolinkEmail,
- literalAutolinkHttp: exitLiteralAutolinkHttp,
- literalAutolinkWww: exitLiteralAutolinkWww
- }
- };
- }
- function gfmAutolinkLiteralToMarkdown() {
- return {
- unsafe: [
- {
- character: "@",
- before: "[+\\-.\\w]",
- after: "[\\-.\\w]",
- inConstruct,
- notInConstruct
- },
- {
- character: ".",
- before: "[Ww]",
- after: "[\\-.\\w]",
- inConstruct,
- notInConstruct
- },
- {
- character: ":",
- before: "[ps]",
- after: "\\/",
- inConstruct,
- notInConstruct
- }
- ]
- };
- }
- function enterLiteralAutolink(token) {
- this.enter({ type: "link", title: null, url: "", children: [] }, token);
- }
- function enterLiteralAutolinkValue(token) {
- this.config.enter.autolinkProtocol.call(this, token);
- }
- function exitLiteralAutolinkHttp(token) {
- this.config.exit.autolinkProtocol.call(this, token);
- }
- function exitLiteralAutolinkWww(token) {
- this.config.exit.data.call(this, token);
- const node2 = this.stack[this.stack.length - 1];
- ok(node2.type === "link");
- node2.url = "http://" + this.sliceSerialize(token);
- }
- function exitLiteralAutolinkEmail(token) {
- this.config.exit.autolinkEmail.call(this, token);
- }
- function exitLiteralAutolink(token) {
- this.exit(token);
- }
- function transformGfmAutolinkLiterals(tree) {
- findAndReplace(
- tree,
- [
- [/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi, findUrl],
- [/([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/g, findEmail]
- ],
- { ignore: ["link", "linkReference"] }
- );
- }
- function findUrl(_, protocol, domain2, path2, match) {
- let prefix = "";
- if (!previous(match)) {
- return false;
- }
- if (/^w/i.test(protocol)) {
- domain2 = protocol + domain2;
- protocol = "";
- prefix = "http://";
- }
- if (!isCorrectDomain(domain2)) {
- return false;
- }
- const parts = splitUrl(domain2 + path2);
- if (!parts[0]) return false;
- const result = {
- type: "link",
- title: null,
- url: prefix + protocol + parts[0],
- children: [{ type: "text", value: protocol + parts[0] }]
- };
- if (parts[1]) {
- return [result, { type: "text", value: parts[1] }];
- }
- return result;
- }
- function findEmail(_, atext, label, match) {
- if (
- // Not an expected previous character.
- !previous(match, true) || // Label ends in not allowed character.
- /[-\d_]$/.test(label)
- ) {
- return false;
- }
- return {
- type: "link",
- title: null,
- url: "mailto:" + atext + "@" + label,
- children: [{ type: "text", value: atext + "@" + label }]
- };
- }
- function isCorrectDomain(domain2) {
- const parts = domain2.split(".");
- if (parts.length < 2 || parts[parts.length - 1] && (/_/.test(parts[parts.length - 1]) || !/[a-zA-Z\d]/.test(parts[parts.length - 1])) || parts[parts.length - 2] && (/_/.test(parts[parts.length - 2]) || !/[a-zA-Z\d]/.test(parts[parts.length - 2]))) {
- return false;
- }
- return true;
- }
- function splitUrl(url) {
- const trailExec = /[!"&'),.:;<>?\]}]+$/.exec(url);
- if (!trailExec) {
- return [url, void 0];
- }
- url = url.slice(0, trailExec.index);
- let trail2 = trailExec[0];
- let closingParenIndex = trail2.indexOf(")");
- const openingParens = ccount(url, "(");
- let closingParens = ccount(url, ")");
- while (closingParenIndex !== -1 && openingParens > closingParens) {
- url += trail2.slice(0, closingParenIndex + 1);
- trail2 = trail2.slice(closingParenIndex + 1);
- closingParenIndex = trail2.indexOf(")");
- closingParens++;
- }
- return [url, trail2];
- }
- function previous(match, email) {
- const code3 = match.input.charCodeAt(match.index - 1);
- return (match.index === 0 || unicodeWhitespace(code3) || unicodePunctuation(code3)) && (!email || code3 !== 47);
- }
- // node_modules/micromark-util-normalize-identifier/index.js
- function normalizeIdentifier(value) {
- return value.replace(/[\t\n\r ]+/g, " ").replace(/^ | $/g, "").toLowerCase().toUpperCase();
- }
- // node_modules/mdast-util-gfm-footnote/lib/index.js
- footnoteReference.peek = footnoteReferencePeek;
- function gfmFootnoteFromMarkdown() {
- return {
- enter: {
- gfmFootnoteDefinition: enterFootnoteDefinition,
- gfmFootnoteDefinitionLabelString: enterFootnoteDefinitionLabelString,
- gfmFootnoteCall: enterFootnoteCall,
- gfmFootnoteCallString: enterFootnoteCallString
- },
- exit: {
- gfmFootnoteDefinition: exitFootnoteDefinition,
- gfmFootnoteDefinitionLabelString: exitFootnoteDefinitionLabelString,
- gfmFootnoteCall: exitFootnoteCall,
- gfmFootnoteCallString: exitFootnoteCallString
- }
- };
- }
- function gfmFootnoteToMarkdown() {
- return {
- // This is on by default already.
- unsafe: [{ character: "[", inConstruct: ["phrasing", "label", "reference"] }],
- handlers: { footnoteDefinition, footnoteReference }
- };
- }
- function enterFootnoteDefinition(token) {
- this.enter(
- { type: "footnoteDefinition", identifier: "", label: "", children: [] },
- token
- );
- }
- function enterFootnoteDefinitionLabelString() {
- this.buffer();
- }
- function exitFootnoteDefinitionLabelString(token) {
- const label = this.resume();
- const node2 = this.stack[this.stack.length - 1];
- ok(node2.type === "footnoteDefinition");
- node2.label = label;
- node2.identifier = normalizeIdentifier(
- this.sliceSerialize(token)
- ).toLowerCase();
- }
- function exitFootnoteDefinition(token) {
- this.exit(token);
- }
- function enterFootnoteCall(token) {
- this.enter({ type: "footnoteReference", identifier: "", label: "" }, token);
- }
- function enterFootnoteCallString() {
- this.buffer();
- }
- function exitFootnoteCallString(token) {
- const label = this.resume();
- const node2 = this.stack[this.stack.length - 1];
- ok(node2.type === "footnoteReference");
- node2.label = label;
- node2.identifier = normalizeIdentifier(
- this.sliceSerialize(token)
- ).toLowerCase();
- }
- function exitFootnoteCall(token) {
- this.exit(token);
- }
- function footnoteReference(node2, _, state, info) {
- const tracker = state.createTracker(info);
- let value = tracker.move("[^");
- const exit2 = state.enter("footnoteReference");
- const subexit = state.enter("reference");
- value += tracker.move(
- state.safe(state.associationId(node2), {
- ...tracker.current(),
- before: value,
- after: "]"
- })
- );
- subexit();
- exit2();
- value += tracker.move("]");
- return value;
- }
- function footnoteReferencePeek() {
- return "[";
- }
- function footnoteDefinition(node2, _, state, info) {
- const tracker = state.createTracker(info);
- let value = tracker.move("[^");
- const exit2 = state.enter("footnoteDefinition");
- const subexit = state.enter("label");
- value += tracker.move(
- state.safe(state.associationId(node2), {
- ...tracker.current(),
- before: value,
- after: "]"
- })
- );
- subexit();
- value += tracker.move(
- "]:" + (node2.children && node2.children.length > 0 ? " " : "")
- );
- tracker.shift(4);
- value += tracker.move(
- state.indentLines(state.containerFlow(node2, tracker.current()), map)
- );
- exit2();
- return value;
- }
- function map(line, index, blank) {
- if (index === 0) {
- return line;
- }
- return (blank ? "" : " ") + line;
- }
- // node_modules/mdast-util-gfm-strikethrough/lib/index.js
- var constructsWithoutStrikethrough = [
- "autolink",
- "destinationLiteral",
- "destinationRaw",
- "reference",
- "titleQuote",
- "titleApostrophe"
- ];
- handleDelete.peek = peekDelete;
- function gfmStrikethroughFromMarkdown() {
- return {
- canContainEols: ["delete"],
- enter: { strikethrough: enterStrikethrough },
- exit: { strikethrough: exitStrikethrough }
- };
- }
- function gfmStrikethroughToMarkdown() {
- return {
- unsafe: [
- {
- character: "~",
- inConstruct: "phrasing",
- notInConstruct: constructsWithoutStrikethrough
- }
- ],
- handlers: { delete: handleDelete }
- };
- }
- function enterStrikethrough(token) {
- this.enter({ type: "delete", children: [] }, token);
- }
- function exitStrikethrough(token) {
- this.exit(token);
- }
- function handleDelete(node2, _, state, info) {
- const tracker = state.createTracker(info);
- const exit2 = state.enter("strikethrough");
- let value = tracker.move("~~");
- value += state.containerPhrasing(node2, {
- ...tracker.current(),
- before: value,
- after: "~"
- });
- value += tracker.move("~~");
- exit2();
- return value;
- }
- function peekDelete() {
- return "~";
- }
- // node_modules/markdown-table/index.js
- function markdownTable(table, options = {}) {
- const align = (options.align || []).concat();
- const stringLength = options.stringLength || defaultStringLength;
- const alignments = [];
- const cellMatrix = [];
- const sizeMatrix = [];
- const longestCellByColumn = [];
- let mostCellsPerRow = 0;
- let rowIndex = -1;
- while (++rowIndex < table.length) {
- const row2 = [];
- const sizes2 = [];
- let columnIndex2 = -1;
- if (table[rowIndex].length > mostCellsPerRow) {
- mostCellsPerRow = table[rowIndex].length;
- }
- while (++columnIndex2 < table[rowIndex].length) {
- const cell = serialize(table[rowIndex][columnIndex2]);
- if (options.alignDelimiters !== false) {
- const size = stringLength(cell);
- sizes2[columnIndex2] = size;
- if (longestCellByColumn[columnIndex2] === void 0 || size > longestCellByColumn[columnIndex2]) {
- longestCellByColumn[columnIndex2] = size;
- }
- }
- row2.push(cell);
- }
- cellMatrix[rowIndex] = row2;
- sizeMatrix[rowIndex] = sizes2;
- }
- let columnIndex = -1;
- if (typeof align === "object" && "length" in align) {
- while (++columnIndex < mostCellsPerRow) {
- alignments[columnIndex] = toAlignment(align[columnIndex]);
- }
- } else {
- const code3 = toAlignment(align);
- while (++columnIndex < mostCellsPerRow) {
- alignments[columnIndex] = code3;
- }
- }
- columnIndex = -1;
- const row = [];
- const sizes = [];
- while (++columnIndex < mostCellsPerRow) {
- const code3 = alignments[columnIndex];
- let before = "";
- let after = "";
- if (code3 === 99) {
- before = ":";
- after = ":";
- } else if (code3 === 108) {
- before = ":";
- } else if (code3 === 114) {
- after = ":";
- }
- let size = options.alignDelimiters === false ? 1 : Math.max(
- 1,
- longestCellByColumn[columnIndex] - before.length - after.length
- );
- const cell = before + "-".repeat(size) + after;
- if (options.alignDelimiters !== false) {
- size = before.length + size + after.length;
- if (size > longestCellByColumn[columnIndex]) {
- longestCellByColumn[columnIndex] = size;
- }
- sizes[columnIndex] = size;
- }
- row[columnIndex] = cell;
- }
- cellMatrix.splice(1, 0, row);
- sizeMatrix.splice(1, 0, sizes);
- rowIndex = -1;
- const lines = [];
- while (++rowIndex < cellMatrix.length) {
- const row2 = cellMatrix[rowIndex];
- const sizes2 = sizeMatrix[rowIndex];
- columnIndex = -1;
- const line = [];
- while (++columnIndex < mostCellsPerRow) {
- const cell = row2[columnIndex] || "";
- let before = "";
- let after = "";
- if (options.alignDelimiters !== false) {
- const size = longestCellByColumn[columnIndex] - (sizes2[columnIndex] || 0);
- const code3 = alignments[columnIndex];
- if (code3 === 114) {
- before = " ".repeat(size);
- } else if (code3 === 99) {
- if (size % 2) {
- before = " ".repeat(size / 2 + 0.5);
- after = " ".repeat(size / 2 - 0.5);
- } else {
- before = " ".repeat(size / 2);
- after = before;
- }
- } else {
- after = " ".repeat(size);
- }
- }
- if (options.delimiterStart !== false && !columnIndex) {
- line.push("|");
- }
- if (options.padding !== false && // Don’t add the opening space if we’re not aligning and the cell is
- // empty: there will be a closing space.
- !(options.alignDelimiters === false && cell === "") && (options.delimiterStart !== false || columnIndex)) {
- line.push(" ");
- }
- if (options.alignDelimiters !== false) {
- line.push(before);
- }
- line.push(cell);
- if (options.alignDelimiters !== false) {
- line.push(after);
- }
- if (options.padding !== false) {
- line.push(" ");
- }
- if (options.delimiterEnd !== false || columnIndex !== mostCellsPerRow - 1) {
- line.push("|");
- }
- }
- lines.push(
- options.delimiterEnd === false ? line.join("").replace(/ +$/, "") : line.join("")
- );
- }
- return lines.join("\n");
- }
- function serialize(value) {
- return value === null || value === void 0 ? "" : String(value);
- }
- function defaultStringLength(value) {
- return value.length;
- }
- function toAlignment(value) {
- const code3 = typeof value === "string" ? value.codePointAt(0) : 0;
- return code3 === 67 || code3 === 99 ? 99 : code3 === 76 || code3 === 108 ? 108 : code3 === 82 || code3 === 114 ? 114 : 0;
- }
- // node_modules/mdast-util-to-markdown/lib/handle/blockquote.js
- function blockquote(node2, _, state, info) {
- const exit2 = state.enter("blockquote");
- const tracker = state.createTracker(info);
- tracker.move("> ");
- tracker.shift(2);
- const value = state.indentLines(
- state.containerFlow(node2, tracker.current()),
- map2
- );
- exit2();
- return value;
- }
- function map2(line, _, blank) {
- return ">" + (blank ? "" : " ") + line;
- }
- // node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.js
- function patternInScope(stack, pattern) {
- return listInScope(stack, pattern.inConstruct, true) && !listInScope(stack, pattern.notInConstruct, false);
- }
- function listInScope(stack, list2, none) {
- if (typeof list2 === "string") {
- list2 = [list2];
- }
- if (!list2 || list2.length === 0) {
- return none;
- }
- let index = -1;
- while (++index < list2.length) {
- if (stack.includes(list2[index])) {
- return true;
- }
- }
- return false;
- }
- // node_modules/mdast-util-to-markdown/lib/handle/break.js
- function hardBreak(_, _1, state, info) {
- let index = -1;
- while (++index < state.unsafe.length) {
- if (state.unsafe[index].character === "\n" && patternInScope(state.stack, state.unsafe[index])) {
- return /[ \t]/.test(info.before) ? "" : " ";
- }
- }
- return "\\\n";
- }
- // node_modules/longest-streak/index.js
- function longestStreak(value, substring) {
- const source = String(value);
- let index = source.indexOf(substring);
- let expected = index;
- let count = 0;
- let max = 0;
- if (typeof substring !== "string") {
- throw new TypeError("Expected substring");
- }
- while (index !== -1) {
- if (index === expected) {
- if (++count > max) {
- max = count;
- }
- } else {
- count = 1;
- }
- expected = index + substring.length;
- index = source.indexOf(substring, expected);
- }
- return max;
- }
- // node_modules/mdast-util-to-markdown/lib/util/format-code-as-indented.js
- function formatCodeAsIndented(node2, state) {
- return Boolean(
- state.options.fences === false && node2.value && // If there’s no info…
- !node2.lang && // And there’s a non-whitespace character…
- /[^ \r\n]/.test(node2.value) && // And the value doesn’t start or end in a blank…
- !/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(node2.value)
- );
- }
- // node_modules/mdast-util-to-markdown/lib/util/check-fence.js
- function checkFence(state) {
- const marker = state.options.fence || "`";
- if (marker !== "`" && marker !== "~") {
- throw new Error(
- "Cannot serialize code with `" + marker + "` for `options.fence`, expected `` ` `` or `~`"
- );
- }
- return marker;
- }
- // node_modules/mdast-util-to-markdown/lib/handle/code.js
- function code(node2, _, state, info) {
- const marker = checkFence(state);
- const raw = node2.value || "";
- const suffix = marker === "`" ? "GraveAccent" : "Tilde";
- if (formatCodeAsIndented(node2, state)) {
- const exit3 = state.enter("codeIndented");
- const value2 = state.indentLines(raw, map3);
- exit3();
- return value2;
- }
- const tracker = state.createTracker(info);
- const sequence = marker.repeat(Math.max(longestStreak(raw, marker) + 1, 3));
- const exit2 = state.enter("codeFenced");
- let value = tracker.move(sequence);
- if (node2.lang) {
- const subexit = state.enter(`codeFencedLang${suffix}`);
- value += tracker.move(
- state.safe(node2.lang, {
- before: value,
- after: " ",
- encode: ["`"],
- ...tracker.current()
- })
- );
- subexit();
- }
- if (node2.lang && node2.meta) {
- const subexit = state.enter(`codeFencedMeta${suffix}`);
- value += tracker.move(" ");
- value += tracker.move(
- state.safe(node2.meta, {
- before: value,
- after: "\n",
- encode: ["`"],
- ...tracker.current()
- })
- );
- subexit();
- }
- value += tracker.move("\n");
- if (raw) {
- value += tracker.move(raw + "\n");
- }
- value += tracker.move(sequence);
- exit2();
- return value;
- }
- function map3(line, _, blank) {
- return (blank ? "" : " ") + line;
- }
- // node_modules/mdast-util-to-markdown/lib/util/check-quote.js
- function checkQuote(state) {
- const marker = state.options.quote || '"';
- if (marker !== '"' && marker !== "'") {
- throw new Error(
- "Cannot serialize title with `" + marker + "` for `options.quote`, expected `\"`, or `'`"
- );
- }
- return marker;
- }
- // node_modules/mdast-util-to-markdown/lib/handle/definition.js
- function definition(node2, _, state, info) {
- const quote = checkQuote(state);
- const suffix = quote === '"' ? "Quote" : "Apostrophe";
- const exit2 = state.enter("definition");
- let subexit = state.enter("label");
- const tracker = state.createTracker(info);
- let value = tracker.move("[");
- value += tracker.move(
- state.safe(state.associationId(node2), {
- before: value,
- after: "]",
- ...tracker.current()
- })
- );
- value += tracker.move("]: ");
- subexit();
- if (
- // If there’s no url, or…
- !node2.url || // If there are control characters or whitespace.
- /[\0- \u007F]/.test(node2.url)
- ) {
- subexit = state.enter("destinationLiteral");
- value += tracker.move("<");
- value += tracker.move(
- state.safe(node2.url, { before: value, after: ">", ...tracker.current() })
- );
- value += tracker.move(">");
- } else {
- subexit = state.enter("destinationRaw");
- value += tracker.move(
- state.safe(node2.url, {
- before: value,
- after: node2.title ? " " : "\n",
- ...tracker.current()
- })
- );
- }
- subexit();
- if (node2.title) {
- subexit = state.enter(`title${suffix}`);
- value += tracker.move(" " + quote);
- value += tracker.move(
- state.safe(node2.title, {
- before: value,
- after: quote,
- ...tracker.current()
- })
- );
- value += tracker.move(quote);
- subexit();
- }
- exit2();
- return value;
- }
- // node_modules/mdast-util-to-markdown/lib/util/check-emphasis.js
- function checkEmphasis(state) {
- const marker = state.options.emphasis || "*";
- if (marker !== "*" && marker !== "_") {
- throw new Error(
- "Cannot serialize emphasis with `" + marker + "` for `options.emphasis`, expected `*`, or `_`"
- );
- }
- return marker;
- }
- // node_modules/mdast-util-to-markdown/lib/handle/emphasis.js
- emphasis.peek = emphasisPeek;
- function emphasis(node2, _, state, info) {
- const marker = checkEmphasis(state);
- const exit2 = state.enter("emphasis");
- const tracker = state.createTracker(info);
- let value = tracker.move(marker);
- value += tracker.move(
- state.containerPhrasing(node2, {
- before: value,
- after: marker,
- ...tracker.current()
- })
- );
- value += tracker.move(marker);
- exit2();
- return value;
- }
- function emphasisPeek(_, _1, state) {
- return state.options.emphasis || "*";
- }
- // node_modules/mdast-util-to-markdown/node_modules/unist-util-visit/lib/index.js
- function visit(tree, testOrVisitor, visitorOrReverse, maybeReverse) {
- let reverse;
- let test;
- let visitor;
- if (typeof testOrVisitor === "function" && typeof visitorOrReverse !== "function") {
- test = void 0;
- visitor = testOrVisitor;
- reverse = visitorOrReverse;
- } else {
- test = testOrVisitor;
- visitor = visitorOrReverse;
- reverse = maybeReverse;
- }
- visitParents(tree, test, overload, reverse);
- function overload(node2, parents) {
- const parent = parents[parents.length - 1];
- const index = parent ? parent.children.indexOf(node2) : void 0;
- return visitor(node2, index, parent);
- }
- }
- // node_modules/mdast-util-to-markdown/node_modules/mdast-util-to-string/lib/index.js
- var emptyOptions = {};
- function toString(value, options) {
- const settings = options || emptyOptions;
- const includeImageAlt = typeof settings.includeImageAlt === "boolean" ? settings.includeImageAlt : true;
- const includeHtml = typeof settings.includeHtml === "boolean" ? settings.includeHtml : true;
- return one(value, includeImageAlt, includeHtml);
- }
- function one(value, includeImageAlt, includeHtml) {
- if (node(value)) {
- if ("value" in value) {
- return value.type === "html" && !includeHtml ? "" : value.value;
- }
- if (includeImageAlt && "alt" in value && value.alt) {
- return value.alt;
- }
- if ("children" in value) {
- return all(value.children, includeImageAlt, includeHtml);
- }
- }
- if (Array.isArray(value)) {
- return all(value, includeImageAlt, includeHtml);
- }
- return "";
- }
- function all(values, includeImageAlt, includeHtml) {
- const result = [];
- let index = -1;
- while (++index < values.length) {
- result[index] = one(values[index], includeImageAlt, includeHtml);
- }
- return result.join("");
- }
- function node(value) {
- return Boolean(value && typeof value === "object");
- }
- // node_modules/mdast-util-to-markdown/lib/util/format-heading-as-setext.js
- function formatHeadingAsSetext(node2, state) {
- let literalWithBreak = false;
- visit(node2, function(node3) {
- if ("value" in node3 && /\r?\n|\r/.test(node3.value) || node3.type === "break") {
- literalWithBreak = true;
- return EXIT;
- }
- });
- return Boolean(
- (!node2.depth || node2.depth < 3) && toString(node2) && (state.options.setext || literalWithBreak)
- );
- }
- // node_modules/mdast-util-to-markdown/lib/handle/heading.js
- function heading(node2, _, state, info) {
- const rank = Math.max(Math.min(6, node2.depth || 1), 1);
- const tracker = state.createTracker(info);
- if (formatHeadingAsSetext(node2, state)) {
- const exit3 = state.enter("headingSetext");
- const subexit2 = state.enter("phrasing");
- const value2 = state.containerPhrasing(node2, {
- ...tracker.current(),
- before: "\n",
- after: "\n"
- });
- subexit2();
- exit3();
- return value2 + "\n" + (rank === 1 ? "=" : "-").repeat(
- // The whole size…
- value2.length - // Minus the position of the character after the last EOL (or
- // 0 if there is none)…
- (Math.max(value2.lastIndexOf("\r"), value2.lastIndexOf("\n")) + 1)
- );
- }
- const sequence = "#".repeat(rank);
- const exit2 = state.enter("headingAtx");
- const subexit = state.enter("phrasing");
- tracker.move(sequence + " ");
- let value = state.containerPhrasing(node2, {
- before: "# ",
- after: "\n",
- ...tracker.current()
- });
- if (/^[\t ]/.test(value)) {
- value = "&#x" + value.charCodeAt(0).toString(16).toUpperCase() + ";" + value.slice(1);
- }
- value = value ? sequence + " " + value : sequence;
- if (state.options.closeAtx) {
- value += " " + sequence;
- }
- subexit();
- exit2();
- return value;
- }
- // node_modules/mdast-util-to-markdown/lib/handle/html.js
- html.peek = htmlPeek;
- function html(node2) {
- return node2.value || "";
- }
- function htmlPeek() {
- return "<";
- }
- // node_modules/mdast-util-to-markdown/lib/handle/image.js
- image.peek = imagePeek;
- function image(node2, _, state, info) {
- const quote = checkQuote(state);
- const suffix = quote === '"' ? "Quote" : "Apostrophe";
- const exit2 = state.enter("image");
- let subexit = state.enter("label");
- const tracker = state.createTracker(info);
- let value = tracker.move("![");
- value += tracker.move(
- state.safe(node2.alt, { before: value, after: "]", ...tracker.current() })
- );
- value += tracker.move("](");
- subexit();
- if (
- // If there’s no url but there is a title…
- !node2.url && node2.title || // If there are control characters or whitespace.
- /[\0- \u007F]/.test(node2.url)
- ) {
- subexit = state.enter("destinationLiteral");
- value += tracker.move("<");
- value += tracker.move(
- state.safe(node2.url, { before: value, after: ">", ...tracker.current() })
- );
- value += tracker.move(">");
- } else {
- subexit = state.enter("destinationRaw");
- value += tracker.move(
- state.safe(node2.url, {
- before: value,
- after: node2.title ? " " : ")",
- ...tracker.current()
- })
- );
- }
- subexit();
- if (node2.title) {
- subexit = state.enter(`title${suffix}`);
- value += tracker.move(" " + quote);
- value += tracker.move(
- state.safe(node2.title, {
- before: value,
- after: quote,
- ...tracker.current()
- })
- );
- value += tracker.move(quote);
- subexit();
- }
- value += tracker.move(")");
- exit2();
- return value;
- }
- function imagePeek() {
- return "!";
- }
- // node_modules/mdast-util-to-markdown/lib/handle/image-reference.js
- imageReference.peek = imageReferencePeek;
- function imageReference(node2, _, state, info) {
- const type = node2.referenceType;
- const exit2 = state.enter("imageReference");
- let subexit = state.enter("label");
- const tracker = state.createTracker(info);
- let value = tracker.move("![");
- const alt = state.safe(node2.alt, {
- before: value,
- after: "]",
- ...tracker.current()
- });
- value += tracker.move(alt + "][");
- subexit();
- const stack = state.stack;
- state.stack = [];
- subexit = state.enter("reference");
- const reference = state.safe(state.associationId(node2), {
- before: value,
- after: "]",
- ...tracker.current()
- });
- subexit();
- state.stack = stack;
- exit2();
- if (type === "full" || !alt || alt !== reference) {
- value += tracker.move(reference + "]");
- } else if (type === "shortcut") {
- value = value.slice(0, -1);
- } else {
- value += tracker.move("]");
- }
- return value;
- }
- function imageReferencePeek() {
- return "!";
- }
- // node_modules/mdast-util-to-markdown/lib/handle/inline-code.js
- inlineCode.peek = inlineCodePeek;
- function inlineCode(node2, _, state) {
- let value = node2.value || "";
- let sequence = "`";
- let index = -1;
- while (new RegExp("(^|[^`])" + sequence + "([^`]|$)").test(value)) {
- sequence += "`";
- }
- if (/[^ \r\n]/.test(value) && (/^[ \r\n]/.test(value) && /[ \r\n]$/.test(value) || /^`|`$/.test(value))) {
- value = " " + value + " ";
- }
- while (++index < state.unsafe.length) {
- const pattern = state.unsafe[index];
- const expression = state.compilePattern(pattern);
- let match;
- if (!pattern.atBreak) continue;
- while (match = expression.exec(value)) {
- let position = match.index;
- if (value.charCodeAt(position) === 10 && value.charCodeAt(position - 1) === 13) {
- position--;
- }
- value = value.slice(0, position) + " " + value.slice(match.index + 1);
- }
- }
- return sequence + value + sequence;
- }
- function inlineCodePeek() {
- return "`";
- }
- // node_modules/mdast-util-to-markdown/lib/util/format-link-as-autolink.js
- function formatLinkAsAutolink(node2, state) {
- const raw = toString(node2);
- return Boolean(
- !state.options.resourceLink && // If there’s a url…
- node2.url && // And there’s a no title…
- !node2.title && // And the content of `node` is a single text node…
- node2.children && node2.children.length === 1 && node2.children[0].type === "text" && // And if the url is the same as the content…
- (raw === node2.url || "mailto:" + raw === node2.url) && // And that starts w/ a protocol…
- /^[a-z][a-z+.-]+:/i.test(node2.url) && // And that doesn’t contain ASCII control codes (character escapes and
- // references don’t work), space, or angle brackets…
- !/[\0- <>\u007F]/.test(node2.url)
- );
- }
- // node_modules/mdast-util-to-markdown/lib/handle/link.js
- link.peek = linkPeek;
- function link(node2, _, state, info) {
- const quote = checkQuote(state);
- const suffix = quote === '"' ? "Quote" : "Apostrophe";
- const tracker = state.createTracker(info);
- let exit2;
- let subexit;
- if (formatLinkAsAutolink(node2, state)) {
- const stack = state.stack;
- state.stack = [];
- exit2 = state.enter("autolink");
- let value2 = tracker.move("<");
- value2 += tracker.move(
- state.containerPhrasing(node2, {
- before: value2,
- after: ">",
- ...tracker.current()
- })
- );
- value2 += tracker.move(">");
- exit2();
- state.stack = stack;
- return value2;
- }
- exit2 = state.enter("link");
- subexit = state.enter("label");
- let value = tracker.move("[");
- value += tracker.move(
- state.containerPhrasing(node2, {
- before: value,
- after: "](",
- ...tracker.current()
- })
- );
- value += tracker.move("](");
- subexit();
- if (
- // If there’s no url but there is a title…
- !node2.url && node2.title || // If there are control characters or whitespace.
- /[\0- \u007F]/.test(node2.url)
- ) {
- subexit = state.enter("destinationLiteral");
- value += tracker.move("<");
- value += tracker.move(
- state.safe(node2.url, { before: value, after: ">", ...tracker.current() })
- );
- value += tracker.move(">");
- } else {
- subexit = state.enter("destinationRaw");
- value += tracker.move(
- state.safe(node2.url, {
- before: value,
- after: node2.title ? " " : ")",
- ...tracker.current()
- })
- );
- }
- subexit();
- if (node2.title) {
- subexit = state.enter(`title${suffix}`);
- value += tracker.move(" " + quote);
- value += tracker.move(
- state.safe(node2.title, {
- before: value,
- after: quote,
- ...tracker.current()
- })
- );
- value += tracker.move(quote);
- subexit();
- }
- value += tracker.move(")");
- exit2();
- return value;
- }
- function linkPeek(node2, _, state) {
- return formatLinkAsAutolink(node2, state) ? "<" : "[";
- }
- // node_modules/mdast-util-to-markdown/lib/handle/link-reference.js
- linkReference.peek = linkReferencePeek;
- function linkReference(node2, _, state, info) {
- const type = node2.referenceType;
- const exit2 = state.enter("linkReference");
- let subexit = state.enter("label");
- const tracker = state.createTracker(info);
- let value = tracker.move("[");
- const text3 = state.containerPhrasing(node2, {
- before: value,
- after: "]",
- ...tracker.current()
- });
- value += tracker.move(text3 + "][");
- subexit();
- const stack = state.stack;
- state.stack = [];
- subexit = state.enter("reference");
- const reference = state.safe(state.associationId(node2), {
- before: value,
- after: "]",
- ...tracker.current()
- });
- subexit();
- state.stack = stack;
- exit2();
- if (type === "full" || !text3 || text3 !== reference) {
- value += tracker.move(reference + "]");
- } else if (type === "shortcut") {
- value = value.slice(0, -1);
- } else {
- value += tracker.move("]");
- }
- return value;
- }
- function linkReferencePeek() {
- return "[";
- }
- // node_modules/mdast-util-to-markdown/lib/util/check-bullet.js
- function checkBullet(state) {
- const marker = state.options.bullet || "*";
- if (marker !== "*" && marker !== "+" && marker !== "-") {
- throw new Error(
- "Cannot serialize items with `" + marker + "` for `options.bullet`, expected `*`, `+`, or `-`"
- );
- }
- return marker;
- }
- // node_modules/mdast-util-to-markdown/lib/util/check-bullet-other.js
- function checkBulletOther(state) {
- const bullet = checkBullet(state);
- const bulletOther = state.options.bulletOther;
- if (!bulletOther) {
- return bullet === "*" ? "-" : "*";
- }
- if (bulletOther !== "*" && bulletOther !== "+" && bulletOther !== "-") {
- throw new Error(
- "Cannot serialize items with `" + bulletOther + "` for `options.bulletOther`, expected `*`, `+`, or `-`"
- );
- }
- if (bulletOther === bullet) {
- throw new Error(
- "Expected `bullet` (`" + bullet + "`) and `bulletOther` (`" + bulletOther + "`) to be different"
- );
- }
- return bulletOther;
- }
- // node_modules/mdast-util-to-markdown/lib/util/check-bullet-ordered.js
- function checkBulletOrdered(state) {
- const marker = state.options.bulletOrdered || ".";
- if (marker !== "." && marker !== ")") {
- throw new Error(
- "Cannot serialize items with `" + marker + "` for `options.bulletOrdered`, expected `.` or `)`"
- );
- }
- return marker;
- }
- // node_modules/mdast-util-to-markdown/lib/util/check-rule.js
- function checkRule(state) {
- const marker = state.options.rule || "*";
- if (marker !== "*" && marker !== "-" && marker !== "_") {
- throw new Error(
- "Cannot serialize rules with `" + marker + "` for `options.rule`, expected `*`, `-`, or `_`"
- );
- }
- return marker;
- }
- // node_modules/mdast-util-to-markdown/lib/handle/list.js
- function list(node2, parent, state, info) {
- const exit2 = state.enter("list");
- const bulletCurrent = state.bulletCurrent;
- let bullet = node2.ordered ? checkBulletOrdered(state) : checkBullet(state);
- const bulletOther = node2.ordered ? bullet === "." ? ")" : "." : checkBulletOther(state);
- let useDifferentMarker = parent && state.bulletLastUsed ? bullet === state.bulletLastUsed : false;
- if (!node2.ordered) {
- const firstListItem = node2.children ? node2.children[0] : void 0;
- if (
- // Bullet could be used as a thematic break marker:
- (bullet === "*" || bullet === "-") && // Empty first list item:
- firstListItem && (!firstListItem.children || !firstListItem.children[0]) && // Directly in two other list items:
- state.stack[state.stack.length - 1] === "list" && state.stack[state.stack.length - 2] === "listItem" && state.stack[state.stack.length - 3] === "list" && state.stack[state.stack.length - 4] === "listItem" && // That are each the first child.
- state.indexStack[state.indexStack.length - 1] === 0 && state.indexStack[state.indexStack.length - 2] === 0 && state.indexStack[state.indexStack.length - 3] === 0
- ) {
- useDifferentMarker = true;
- }
- if (checkRule(state) === bullet && firstListItem) {
- let index = -1;
- while (++index < node2.children.length) {
- const item = node2.children[index];
- if (item && item.type === "listItem" && item.children && item.children[0] && item.children[0].type === "thematicBreak") {
- useDifferentMarker = true;
- break;
- }
- }
- }
- }
- if (useDifferentMarker) {
- bullet = bulletOther;
- }
- state.bulletCurrent = bullet;
- const value = state.containerFlow(node2, info);
- state.bulletLastUsed = bullet;
- state.bulletCurrent = bulletCurrent;
- exit2();
- return value;
- }
- // node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.js
- function checkListItemIndent(state) {
- const style = state.options.listItemIndent || "one";
- if (style !== "tab" && style !== "one" && style !== "mixed") {
- throw new Error(
- "Cannot serialize items with `" + style + "` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`"
- );
- }
- return style;
- }
- // node_modules/mdast-util-to-markdown/lib/handle/list-item.js
- function listItem(node2, parent, state, info) {
- const listItemIndent = checkListItemIndent(state);
- let bullet = state.bulletCurrent || checkBullet(state);
- if (parent && parent.type === "list" && parent.ordered) {
- bullet = (typeof parent.start === "number" && parent.start > -1 ? parent.start : 1) + (state.options.incrementListMarker === false ? 0 : parent.children.indexOf(node2)) + bullet;
- }
- let size = bullet.length + 1;
- if (listItemIndent === "tab" || listItemIndent === "mixed" && (parent && parent.type === "list" && parent.spread || node2.spread)) {
- size = Math.ceil(size / 4) * 4;
- }
- const tracker = state.createTracker(info);
- tracker.move(bullet + " ".repeat(size - bullet.length));
- tracker.shift(size);
- const exit2 = state.enter("listItem");
- const value = state.indentLines(
- state.containerFlow(node2, tracker.current()),
- map4
- );
- exit2();
- return value;
- function map4(line, index, blank) {
- if (index) {
- return (blank ? "" : " ".repeat(size)) + line;
- }
- return (blank ? bullet : bullet + " ".repeat(size - bullet.length)) + line;
- }
- }
- // node_modules/mdast-util-to-markdown/lib/handle/paragraph.js
- function paragraph(node2, _, state, info) {
- const exit2 = state.enter("paragraph");
- const subexit = state.enter("phrasing");
- const value = state.containerPhrasing(node2, info);
- subexit();
- exit2();
- return value;
- }
- // node_modules/mdast-util-phrasing/node_modules/unist-util-is/lib/index.js
- var convert3 = (
- // Note: overloads in JSDoc can’t yet use different `@template`s.
- /**
- * @type {(
- * (<Condition extends string>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & {type: Condition}) &
- * (<Condition extends Props>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Condition) &
- * (<Condition extends TestFunction>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Predicate<Condition, Node>) &
- * ((test?: null | undefined) => (node?: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node) &
- * ((test?: Test) => Check)
- * )}
- */
- /**
- * @param {Test} [test]
- * @returns {Check}
- */
- function(test) {
- if (test === null || test === void 0) {
- return ok4;
- }
- if (typeof test === "function") {
- return castFactory3(test);
- }
- if (typeof test === "object") {
- return Array.isArray(test) ? anyFactory3(test) : propsFactory3(test);
- }
- if (typeof test === "string") {
- return typeFactory3(test);
- }
- throw new Error("Expected function, string, or object as test");
- }
- );
- function anyFactory3(tests) {
- const checks = [];
- let index = -1;
- while (++index < tests.length) {
- checks[index] = convert3(tests[index]);
- }
- return castFactory3(any);
- function any(...parameters) {
- let index2 = -1;
- while (++index2 < checks.length) {
- if (checks[index2].apply(this, parameters)) return true;
- }
- return false;
- }
- }
- function propsFactory3(check) {
- const checkAsRecord = (
- /** @type {Record<string, unknown>} */
- check
- );
- return castFactory3(all2);
- function all2(node2) {
- const nodeAsRecord = (
- /** @type {Record<string, unknown>} */
- /** @type {unknown} */
- node2
- );
- let key;
- for (key in check) {
- if (nodeAsRecord[key] !== checkAsRecord[key]) return false;
- }
- return true;
- }
- }
- function typeFactory3(check) {
- return castFactory3(type);
- function type(node2) {
- return node2 && node2.type === check;
- }
- }
- function castFactory3(testFunction) {
- return check;
- function check(value, index, parent) {
- return Boolean(
- looksLikeANode3(value) && testFunction.call(
- this,
- value,
- typeof index === "number" ? index : void 0,
- parent || void 0
- )
- );
- }
- }
- function ok4() {
- return true;
- }
- function looksLikeANode3(value) {
- return value !== null && typeof value === "object" && "type" in value;
- }
- // node_modules/mdast-util-phrasing/lib/index.js
- var phrasing = (
- /** @type {(node?: unknown) => node is Exclude<PhrasingContent, Html>} */
- convert3([
- "break",
- "delete",
- "emphasis",
- // To do: next major: removed since footnotes were added to GFM.
- "footnote",
- "footnoteReference",
- "image",
- "imageReference",
- "inlineCode",
- // Enabled by `mdast-util-math`:
- "inlineMath",
- "link",
- "linkReference",
- // Enabled by `mdast-util-mdx`:
- "mdxJsxTextElement",
- // Enabled by `mdast-util-mdx`:
- "mdxTextExpression",
- "strong",
- "text",
- // Enabled by `mdast-util-directive`:
- "textDirective"
- ])
- );
- // node_modules/mdast-util-to-markdown/lib/handle/root.js
- function root(node2, _, state, info) {
- const hasPhrasing = node2.children.some(function(d) {
- return phrasing(d);
- });
- const fn = hasPhrasing ? state.containerPhrasing : state.containerFlow;
- return fn.call(state, node2, info);
- }
- // node_modules/mdast-util-to-markdown/lib/util/check-strong.js
- function checkStrong(state) {
- const marker = state.options.strong || "*";
- if (marker !== "*" && marker !== "_") {
- throw new Error(
- "Cannot serialize strong with `" + marker + "` for `options.strong`, expected `*`, or `_`"
- );
- }
- return marker;
- }
- // node_modules/mdast-util-to-markdown/lib/handle/strong.js
- strong.peek = strongPeek;
- function strong(node2, _, state, info) {
- const marker = checkStrong(state);
- const exit2 = state.enter("strong");
- const tracker = state.createTracker(info);
- let value = tracker.move(marker + marker);
- value += tracker.move(
- state.containerPhrasing(node2, {
- before: value,
- after: marker,
- ...tracker.current()
- })
- );
- value += tracker.move(marker + marker);
- exit2();
- return value;
- }
- function strongPeek(_, _1, state) {
- return state.options.strong || "*";
- }
- // node_modules/mdast-util-to-markdown/lib/handle/text.js
- function text(node2, _, state, info) {
- return state.safe(node2.value, info);
- }
- // node_modules/mdast-util-to-markdown/lib/util/check-rule-repetition.js
- function checkRuleRepetition(state) {
- const repetition = state.options.ruleRepetition || 3;
- if (repetition < 3) {
- throw new Error(
- "Cannot serialize rules with repetition `" + repetition + "` for `options.ruleRepetition`, expected `3` or more"
- );
- }
- return repetition;
- }
- // node_modules/mdast-util-to-markdown/lib/handle/thematic-break.js
- function thematicBreak(_, _1, state) {
- const value = (checkRule(state) + (state.options.ruleSpaces ? " " : "")).repeat(checkRuleRepetition(state));
- return state.options.ruleSpaces ? value.slice(0, -1) : value;
- }
- // node_modules/mdast-util-to-markdown/lib/handle/index.js
- var handle = {
- blockquote,
- break: hardBreak,
- code,
- definition,
- emphasis,
- hardBreak,
- heading,
- html,
- image,
- imageReference,
- inlineCode,
- link,
- linkReference,
- list,
- listItem,
- paragraph,
- root,
- strong,
- text,
- thematicBreak
- };
- // node_modules/mdast-util-gfm-table/lib/index.js
- function gfmTableFromMarkdown() {
- return {
- enter: {
- table: enterTable,
- tableData: enterCell,
- tableHeader: enterCell,
- tableRow: enterRow
- },
- exit: {
- codeText: exitCodeText,
- table: exitTable,
- tableData: exit,
- tableHeader: exit,
- tableRow: exit
- }
- };
- }
- function enterTable(token) {
- const align = token._align;
- ok(align, "expected `_align` on table");
- this.enter(
- {
- type: "table",
- align: align.map(function(d) {
- return d === "none" ? null : d;
- }),
- children: []
- },
- token
- );
- this.data.inTable = true;
- }
- function exitTable(token) {
- this.exit(token);
- this.data.inTable = void 0;
- }
- function enterRow(token) {
- this.enter({ type: "tableRow", children: [] }, token);
- }
- function exit(token) {
- this.exit(token);
- }
- function enterCell(token) {
- this.enter({ type: "tableCell", children: [] }, token);
- }
- function exitCodeText(token) {
- let value = this.resume();
- if (this.data.inTable) {
- value = value.replace(/\\([\\|])/g, replace);
- }
- const node2 = this.stack[this.stack.length - 1];
- ok(node2.type === "inlineCode");
- node2.value = value;
- this.exit(token);
- }
- function replace($0, $1) {
- return $1 === "|" ? $1 : $0;
- }
- function gfmTableToMarkdown(options) {
- const settings = options || {};
- const padding = settings.tableCellPadding;
- const alignDelimiters = settings.tablePipeAlign;
- const stringLength = settings.stringLength;
- const around = padding ? " " : "|";
- return {
- unsafe: [
- { character: "\r", inConstruct: "tableCell" },
- { character: "\n", inConstruct: "tableCell" },
- // A pipe, when followed by a tab or space (padding), or a dash or colon
- // (unpadded delimiter row), could result in a table.
- { atBreak: true, character: "|", after: "[ :-]" },
- // A pipe in a cell must be encoded.
- { character: "|", inConstruct: "tableCell" },
- // A colon must be followed by a dash, in which case it could start a
- // delimiter row.
- { atBreak: true, character: ":", after: "-" },
- // A delimiter row can also start with a dash, when followed by more
- // dashes, a colon, or a pipe.
- // This is a stricter version than the built in check for lists, thematic
- // breaks, and setex heading underlines though:
- // <https://github.com/syntax-tree/mdast-util-to-markdown/blob/51a2038/lib/unsafe.js#L57>
- { atBreak: true, character: "-", after: "[:|-]" }
- ],
- handlers: {
- inlineCode: inlineCodeWithTable,
- table: handleTable,
- tableCell: handleTableCell,
- tableRow: handleTableRow
- }
- };
- function handleTable(node2, _, state, info) {
- return serializeData(handleTableAsData(node2, state, info), node2.align);
- }
- function handleTableRow(node2, _, state, info) {
- const row = handleTableRowAsData(node2, state, info);
- const value = serializeData([row]);
- return value.slice(0, value.indexOf("\n"));
- }
- function handleTableCell(node2, _, state, info) {
- const exit2 = state.enter("tableCell");
- const subexit = state.enter("phrasing");
- const value = state.containerPhrasing(node2, {
- ...info,
- before: around,
- after: around
- });
- subexit();
- exit2();
- return value;
- }
- function serializeData(matrix, align) {
- return markdownTable(matrix, {
- align,
- // @ts-expect-error: `markdown-table` types should support `null`.
- alignDelimiters,
- // @ts-expect-error: `markdown-table` types should support `null`.
- padding,
- // @ts-expect-error: `markdown-table` types should support `null`.
- stringLength
- });
- }
- function handleTableAsData(node2, state, info) {
- const children = node2.children;
- let index = -1;
- const result = [];
- const subexit = state.enter("table");
- while (++index < children.length) {
- result[index] = handleTableRowAsData(children[index], state, info);
- }
- subexit();
- return result;
- }
- function handleTableRowAsData(node2, state, info) {
- const children = node2.children;
- let index = -1;
- const result = [];
- const subexit = state.enter("tableRow");
- while (++index < children.length) {
- result[index] = handleTableCell(children[index], node2, state, info);
- }
- subexit();
- return result;
- }
- function inlineCodeWithTable(node2, parent, state) {
- let value = handle.inlineCode(node2, parent, state);
- if (state.stack.includes("tableCell")) {
- value = value.replace(/\|/g, "\\$&");
- }
- return value;
- }
- }
- // node_modules/mdast-util-gfm-task-list-item/lib/index.js
- function gfmTaskListItemFromMarkdown() {
- return {
- exit: {
- taskListCheckValueChecked: exitCheck,
- taskListCheckValueUnchecked: exitCheck,
- paragraph: exitParagraphWithTaskListItem
- }
- };
- }
- function gfmTaskListItemToMarkdown() {
- return {
- unsafe: [{ atBreak: true, character: "-", after: "[:|-]" }],
- handlers: { listItem: listItemWithTaskListItem }
- };
- }
- function exitCheck(token) {
- const node2 = this.stack[this.stack.length - 2];
- ok(node2.type === "listItem");
- node2.checked = token.type === "taskListCheckValueChecked";
- }
- function exitParagraphWithTaskListItem(token) {
- const parent = this.stack[this.stack.length - 2];
- if (parent && parent.type === "listItem" && typeof parent.checked === "boolean") {
- const node2 = this.stack[this.stack.length - 1];
- ok(node2.type === "paragraph");
- const head = node2.children[0];
- if (head && head.type === "text") {
- const siblings = parent.children;
- let index = -1;
- let firstParaghraph;
- while (++index < siblings.length) {
- const sibling = siblings[index];
- if (sibling.type === "paragraph") {
- firstParaghraph = sibling;
- break;
- }
- }
- if (firstParaghraph === node2) {
- head.value = head.value.slice(1);
- if (head.value.length === 0) {
- node2.children.shift();
- } else if (node2.position && head.position && typeof head.position.start.offset === "number") {
- head.position.start.column++;
- head.position.start.offset++;
- node2.position.start = Object.assign({}, head.position.start);
- }
- }
- }
- }
- this.exit(token);
- }
- function listItemWithTaskListItem(node2, parent, state, info) {
- const head = node2.children[0];
- const checkable = typeof node2.checked === "boolean" && head && head.type === "paragraph";
- const checkbox = "[" + (node2.checked ? "x" : " ") + "] ";
- const tracker = state.createTracker(info);
- if (checkable) {
- tracker.move(checkbox);
- }
- let value = handle.listItem(node2, parent, state, {
- ...info,
- ...tracker.current()
- });
- if (checkable) {
- value = value.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/, check);
- }
- return value;
- function check($0) {
- return $0 + checkbox;
- }
- }
- // node_modules/mdast-util-gfm/lib/index.js
- function gfmFromMarkdown() {
- return [
- gfmAutolinkLiteralFromMarkdown(),
- gfmFootnoteFromMarkdown(),
- gfmStrikethroughFromMarkdown(),
- gfmTableFromMarkdown(),
- gfmTaskListItemFromMarkdown()
- ];
- }
- function gfmToMarkdown(options) {
- return {
- extensions: [
- gfmAutolinkLiteralToMarkdown(),
- gfmFootnoteToMarkdown(),
- gfmStrikethroughToMarkdown(),
- gfmTableToMarkdown(options),
- gfmTaskListItemToMarkdown()
- ]
- };
- }
- // node_modules/micromark-util-chunked/index.js
- function splice(list2, start, remove, items) {
- const end = list2.length;
- let chunkStart = 0;
- let parameters;
- if (start < 0) {
- start = -start > end ? 0 : end + start;
- } else {
- start = start > end ? end : start;
- }
- remove = remove > 0 ? remove : 0;
- if (items.length < 1e4) {
- parameters = Array.from(items);
- parameters.unshift(start, remove);
- list2.splice(...parameters);
- } else {
- if (remove) list2.splice(start, remove);
- while (chunkStart < items.length) {
- parameters = items.slice(chunkStart, chunkStart + 1e4);
- parameters.unshift(start, 0);
- list2.splice(...parameters);
- chunkStart += 1e4;
- start += 1e4;
- }
- }
- }
- // node_modules/micromark-util-combine-extensions/index.js
- var hasOwnProperty = {}.hasOwnProperty;
- function combineExtensions(extensions) {
- const all2 = {};
- let index = -1;
- while (++index < extensions.length) {
- syntaxExtension(all2, extensions[index]);
- }
- return all2;
- }
- function syntaxExtension(all2, extension) {
- let hook;
- for (hook in extension) {
- const maybe = hasOwnProperty.call(all2, hook) ? all2[hook] : void 0;
- const left = maybe || (all2[hook] = {});
- const right = extension[hook];
- let code3;
- if (right) {
- for (code3 in right) {
- if (!hasOwnProperty.call(left, code3)) left[code3] = [];
- const value = right[code3];
- constructs(
- // @ts-expect-error Looks like a list.
- left[code3],
- Array.isArray(value) ? value : value ? [value] : []
- );
- }
- }
- }
- }
- function constructs(existing, list2) {
- let index = -1;
- const before = [];
- while (++index < list2.length) {
- ;
- (list2[index].add === "after" ? existing : before).push(list2[index]);
- }
- splice(existing, 0, 0, before);
- }
- // node_modules/micromark-extension-gfm-autolink-literal/lib/syntax.js
- var wwwPrefix = {
- tokenize: tokenizeWwwPrefix,
- partial: true
- };
- var domain = {
- tokenize: tokenizeDomain,
- partial: true
- };
- var path = {
- tokenize: tokenizePath,
- partial: true
- };
- var trail = {
- tokenize: tokenizeTrail,
- partial: true
- };
- var emailDomainDotTrail = {
- tokenize: tokenizeEmailDomainDotTrail,
- partial: true
- };
- var wwwAutolink = {
- name: "wwwAutolink",
- tokenize: tokenizeWwwAutolink,
- previous: previousWww
- };
- var protocolAutolink = {
- name: "protocolAutolink",
- tokenize: tokenizeProtocolAutolink,
- previous: previousProtocol
- };
- var emailAutolink = {
- name: "emailAutolink",
- tokenize: tokenizeEmailAutolink,
- previous: previousEmail
- };
- var text2 = {};
- function gfmAutolinkLiteral() {
- return {
- text: text2
- };
- }
- var code2 = 48;
- while (code2 < 123) {
- text2[code2] = emailAutolink;
- code2++;
- if (code2 === 58) code2 = 65;
- else if (code2 === 91) code2 = 97;
- }
- text2[43] = emailAutolink;
- text2[45] = emailAutolink;
- text2[46] = emailAutolink;
- text2[95] = emailAutolink;
- text2[72] = [emailAutolink, protocolAutolink];
- text2[104] = [emailAutolink, protocolAutolink];
- text2[87] = [emailAutolink, wwwAutolink];
- text2[119] = [emailAutolink, wwwAutolink];
- function tokenizeEmailAutolink(effects, ok5, nok) {
- const self = this;
- let dot;
- let data;
- return start;
- function start(code3) {
- if (!gfmAtext(code3) || !previousEmail.call(self, self.previous) || previousUnbalanced(self.events)) {
- return nok(code3);
- }
- effects.enter("literalAutolink");
- effects.enter("literalAutolinkEmail");
- return atext(code3);
- }
- function atext(code3) {
- if (gfmAtext(code3)) {
- effects.consume(code3);
- return atext;
- }
- if (code3 === 64) {
- effects.consume(code3);
- return emailDomain;
- }
- return nok(code3);
- }
- function emailDomain(code3) {
- if (code3 === 46) {
- return effects.check(emailDomainDotTrail, emailDomainAfter, emailDomainDot)(code3);
- }
- if (code3 === 45 || code3 === 95 || asciiAlphanumeric(code3)) {
- data = true;
- effects.consume(code3);
- return emailDomain;
- }
- return emailDomainAfter(code3);
- }
- function emailDomainDot(code3) {
- effects.consume(code3);
- dot = true;
- return emailDomain;
- }
- function emailDomainAfter(code3) {
- if (data && dot && asciiAlpha(self.previous)) {
- effects.exit("literalAutolinkEmail");
- effects.exit("literalAutolink");
- return ok5(code3);
- }
- return nok(code3);
- }
- }
- function tokenizeWwwAutolink(effects, ok5, nok) {
- const self = this;
- return wwwStart;
- function wwwStart(code3) {
- if (code3 !== 87 && code3 !== 119 || !previousWww.call(self, self.previous) || previousUnbalanced(self.events)) {
- return nok(code3);
- }
- effects.enter("literalAutolink");
- effects.enter("literalAutolinkWww");
- return effects.check(wwwPrefix, effects.attempt(domain, effects.attempt(path, wwwAfter), nok), nok)(code3);
- }
- function wwwAfter(code3) {
- effects.exit("literalAutolinkWww");
- effects.exit("literalAutolink");
- return ok5(code3);
- }
- }
- function tokenizeProtocolAutolink(effects, ok5, nok) {
- const self = this;
- let buffer = "";
- let seen = false;
- return protocolStart;
- function protocolStart(code3) {
- if ((code3 === 72 || code3 === 104) && previousProtocol.call(self, self.previous) && !previousUnbalanced(self.events)) {
- effects.enter("literalAutolink");
- effects.enter("literalAutolinkHttp");
- buffer += String.fromCodePoint(code3);
- effects.consume(code3);
- return protocolPrefixInside;
- }
- return nok(code3);
- }
- function protocolPrefixInside(code3) {
- if (asciiAlpha(code3) && buffer.length < 5) {
- buffer += String.fromCodePoint(code3);
- effects.consume(code3);
- return protocolPrefixInside;
- }
- if (code3 === 58) {
- const protocol = buffer.toLowerCase();
- if (protocol === "http" || protocol === "https") {
- effects.consume(code3);
- return protocolSlashesInside;
- }
- }
- return nok(code3);
- }
- function protocolSlashesInside(code3) {
- if (code3 === 47) {
- effects.consume(code3);
- if (seen) {
- return afterProtocol;
- }
- seen = true;
- return protocolSlashesInside;
- }
- return nok(code3);
- }
- function afterProtocol(code3) {
- return code3 === null || asciiControl(code3) || markdownLineEndingOrSpace(code3) || unicodeWhitespace(code3) || unicodePunctuation(code3) ? nok(code3) : effects.attempt(domain, effects.attempt(path, protocolAfter), nok)(code3);
- }
- function protocolAfter(code3) {
- effects.exit("literalAutolinkHttp");
- effects.exit("literalAutolink");
- return ok5(code3);
- }
- }
- function tokenizeWwwPrefix(effects, ok5, nok) {
- let size = 0;
- return wwwPrefixInside;
- function wwwPrefixInside(code3) {
- if ((code3 === 87 || code3 === 119) && size < 3) {
- size++;
- effects.consume(code3);
- return wwwPrefixInside;
- }
- if (code3 === 46 && size === 3) {
- effects.consume(code3);
- return wwwPrefixAfter;
- }
- return nok(code3);
- }
- function wwwPrefixAfter(code3) {
- return code3 === null ? nok(code3) : ok5(code3);
- }
- }
- function tokenizeDomain(effects, ok5, nok) {
- let underscoreInLastSegment;
- let underscoreInLastLastSegment;
- let seen;
- return domainInside;
- function domainInside(code3) {
- if (code3 === 46 || code3 === 95) {
- return effects.check(trail, domainAfter, domainAtPunctuation)(code3);
- }
- if (code3 === null || markdownLineEndingOrSpace(code3) || unicodeWhitespace(code3) || code3 !== 45 && unicodePunctuation(code3)) {
- return domainAfter(code3);
- }
- seen = true;
- effects.consume(code3);
- return domainInside;
- }
- function domainAtPunctuation(code3) {
- if (code3 === 95) {
- underscoreInLastSegment = true;
- } else {
- underscoreInLastLastSegment = underscoreInLastSegment;
- underscoreInLastSegment = void 0;
- }
- effects.consume(code3);
- return domainInside;
- }
- function domainAfter(code3) {
- if (underscoreInLastLastSegment || underscoreInLastSegment || !seen) {
- return nok(code3);
- }
- return ok5(code3);
- }
- }
- function tokenizePath(effects, ok5) {
- let sizeOpen = 0;
- let sizeClose = 0;
- return pathInside;
- function pathInside(code3) {
- if (code3 === 40) {
- sizeOpen++;
- effects.consume(code3);
- return pathInside;
- }
- if (code3 === 41 && sizeClose < sizeOpen) {
- return pathAtPunctuation(code3);
- }
- if (code3 === 33 || code3 === 34 || code3 === 38 || code3 === 39 || code3 === 41 || code3 === 42 || code3 === 44 || code3 === 46 || code3 === 58 || code3 === 59 || code3 === 60 || code3 === 63 || code3 === 93 || code3 === 95 || code3 === 126) {
- return effects.check(trail, ok5, pathAtPunctuation)(code3);
- }
- if (code3 === null || markdownLineEndingOrSpace(code3) || unicodeWhitespace(code3)) {
- return ok5(code3);
- }
- effects.consume(code3);
- return pathInside;
- }
- function pathAtPunctuation(code3) {
- if (code3 === 41) {
- sizeClose++;
- }
- effects.consume(code3);
- return pathInside;
- }
- }
- function tokenizeTrail(effects, ok5, nok) {
- return trail2;
- function trail2(code3) {
- if (code3 === 33 || code3 === 34 || code3 === 39 || code3 === 41 || code3 === 42 || code3 === 44 || code3 === 46 || code3 === 58 || code3 === 59 || code3 === 63 || code3 === 95 || code3 === 126) {
- effects.consume(code3);
- return trail2;
- }
- if (code3 === 38) {
- effects.consume(code3);
- return trailCharacterReferenceStart;
- }
- if (code3 === 93) {
- effects.consume(code3);
- return trailBracketAfter;
- }
- if (
- // `<` is an end.
- code3 === 60 || // So is whitespace.
- code3 === null || markdownLineEndingOrSpace(code3) || unicodeWhitespace(code3)
- ) {
- return ok5(code3);
- }
- return nok(code3);
- }
- function trailBracketAfter(code3) {
- if (code3 === null || code3 === 40 || code3 === 91 || markdownLineEndingOrSpace(code3) || unicodeWhitespace(code3)) {
- return ok5(code3);
- }
- return trail2(code3);
- }
- function trailCharacterReferenceStart(code3) {
- return asciiAlpha(code3) ? trailCharacterReferenceInside(code3) : nok(code3);
- }
- function trailCharacterReferenceInside(code3) {
- if (code3 === 59) {
- effects.consume(code3);
- return trail2;
- }
- if (asciiAlpha(code3)) {
- effects.consume(code3);
- return trailCharacterReferenceInside;
- }
- return nok(code3);
- }
- }
- function tokenizeEmailDomainDotTrail(effects, ok5, nok) {
- return start;
- function start(code3) {
- effects.consume(code3);
- return after;
- }
- function after(code3) {
- return asciiAlphanumeric(code3) ? nok(code3) : ok5(code3);
- }
- }
- function previousWww(code3) {
- return code3 === null || code3 === 40 || code3 === 42 || code3 === 95 || code3 === 91 || code3 === 93 || code3 === 126 || markdownLineEndingOrSpace(code3);
- }
- function previousProtocol(code3) {
- return !asciiAlpha(code3);
- }
- function previousEmail(code3) {
- return !(code3 === 47 || gfmAtext(code3));
- }
- function gfmAtext(code3) {
- return code3 === 43 || code3 === 45 || code3 === 46 || code3 === 95 || asciiAlphanumeric(code3);
- }
- function previousUnbalanced(events) {
- let index = events.length;
- let result = false;
- while (index--) {
- const token = events[index][1];
- if ((token.type === "labelLink" || token.type === "labelImage") && !token._balanced) {
- result = true;
- break;
- }
- if (token._gfmAutolinkLiteralWalkedInto) {
- result = false;
- break;
- }
- }
- if (events.length > 0 && !result) {
- events[events.length - 1][1]._gfmAutolinkLiteralWalkedInto = true;
- }
- return result;
- }
- // node_modules/micromark-util-classify-character/index.js
- function classifyCharacter(code3) {
- if (code3 === null || markdownLineEndingOrSpace(code3) || unicodeWhitespace(code3)) {
- return 1;
- }
- if (unicodePunctuation(code3)) {
- return 2;
- }
- }
- // node_modules/micromark-util-resolve-all/index.js
- function resolveAll(constructs2, events, context) {
- const called = [];
- let index = -1;
- while (++index < constructs2.length) {
- const resolve = constructs2[index].resolveAll;
- if (resolve && !called.includes(resolve)) {
- events = resolve(events, context);
- called.push(resolve);
- }
- }
- return events;
- }
- // node_modules/micromark-factory-space/index.js
- function factorySpace(effects, ok5, type, max) {
- const limit = max ? max - 1 : Number.POSITIVE_INFINITY;
- let size = 0;
- return start;
- function start(code3) {
- if (markdownSpace(code3)) {
- effects.enter(type);
- return prefix(code3);
- }
- return ok5(code3);
- }
- function prefix(code3) {
- if (markdownSpace(code3) && size++ < limit) {
- effects.consume(code3);
- return prefix;
- }
- effects.exit(type);
- return ok5(code3);
- }
- }
- // node_modules/micromark-core-commonmark/lib/blank-line.js
- var blankLine = {
- tokenize: tokenizeBlankLine,
- partial: true
- };
- function tokenizeBlankLine(effects, ok5, nok) {
- return start;
- function start(code3) {
- return markdownSpace(code3) ? factorySpace(effects, after, "linePrefix")(code3) : after(code3);
- }
- function after(code3) {
- return code3 === null || markdownLineEnding(code3) ? ok5(code3) : nok(code3);
- }
- }
- // node_modules/micromark-extension-gfm-footnote/lib/syntax.js
- var indent = {
- tokenize: tokenizeIndent,
- partial: true
- };
- function gfmFootnote() {
- return {
- document: {
- [91]: {
- name: "gfmFootnoteDefinition",
- tokenize: tokenizeDefinitionStart,
- continuation: {
- tokenize: tokenizeDefinitionContinuation
- },
- exit: gfmFootnoteDefinitionEnd
- }
- },
- text: {
- [91]: {
- name: "gfmFootnoteCall",
- tokenize: tokenizeGfmFootnoteCall
- },
- [93]: {
- name: "gfmPotentialFootnoteCall",
- add: "after",
- tokenize: tokenizePotentialGfmFootnoteCall,
- resolveTo: resolveToPotentialGfmFootnoteCall
- }
- }
- };
- }
- function tokenizePotentialGfmFootnoteCall(effects, ok5, nok) {
- const self = this;
- let index = self.events.length;
- const defined = self.parser.gfmFootnotes || (self.parser.gfmFootnotes = []);
- let labelStart;
- while (index--) {
- const token = self.events[index][1];
- if (token.type === "labelImage") {
- labelStart = token;
- break;
- }
- if (token.type === "gfmFootnoteCall" || token.type === "labelLink" || token.type === "label" || token.type === "image" || token.type === "link") {
- break;
- }
- }
- return start;
- function start(code3) {
- if (!labelStart || !labelStart._balanced) {
- return nok(code3);
- }
- const id = normalizeIdentifier(self.sliceSerialize({
- start: labelStart.end,
- end: self.now()
- }));
- if (id.codePointAt(0) !== 94 || !defined.includes(id.slice(1))) {
- return nok(code3);
- }
- effects.enter("gfmFootnoteCallLabelMarker");
- effects.consume(code3);
- effects.exit("gfmFootnoteCallLabelMarker");
- return ok5(code3);
- }
- }
- function resolveToPotentialGfmFootnoteCall(events, context) {
- let index = events.length;
- let labelStart;
- while (index--) {
- if (events[index][1].type === "labelImage" && events[index][0] === "enter") {
- labelStart = events[index][1];
- break;
- }
- }
- events[index + 1][1].type = "data";
- events[index + 3][1].type = "gfmFootnoteCallLabelMarker";
- const call = {
- type: "gfmFootnoteCall",
- start: Object.assign({}, events[index + 3][1].start),
- end: Object.assign({}, events[events.length - 1][1].end)
- };
- const marker = {
- type: "gfmFootnoteCallMarker",
- start: Object.assign({}, events[index + 3][1].end),
- end: Object.assign({}, events[index + 3][1].end)
- };
- marker.end.column++;
- marker.end.offset++;
- marker.end._bufferIndex++;
- const string = {
- type: "gfmFootnoteCallString",
- start: Object.assign({}, marker.end),
- end: Object.assign({}, events[events.length - 1][1].start)
- };
- const chunk = {
- type: "chunkString",
- contentType: "string",
- start: Object.assign({}, string.start),
- end: Object.assign({}, string.end)
- };
- const replacement = [
- // Take the `labelImageMarker` (now `data`, the `!`)
- events[index + 1],
- events[index + 2],
- ["enter", call, context],
- // The `[`
- events[index + 3],
- events[index + 4],
- // The `^`.
- ["enter", marker, context],
- ["exit", marker, context],
- // Everything in between.
- ["enter", string, context],
- ["enter", chunk, context],
- ["exit", chunk, context],
- ["exit", string, context],
- // The ending (`]`, properly parsed and labelled).
- events[events.length - 2],
- events[events.length - 1],
- ["exit", call, context]
- ];
- events.splice(index, events.length - index + 1, ...replacement);
- return events;
- }
- function tokenizeGfmFootnoteCall(effects, ok5, nok) {
- const self = this;
- const defined = self.parser.gfmFootnotes || (self.parser.gfmFootnotes = []);
- let size = 0;
- let data;
- return start;
- function start(code3) {
- effects.enter("gfmFootnoteCall");
- effects.enter("gfmFootnoteCallLabelMarker");
- effects.consume(code3);
- effects.exit("gfmFootnoteCallLabelMarker");
- return callStart;
- }
- function callStart(code3) {
- if (code3 !== 94) return nok(code3);
- effects.enter("gfmFootnoteCallMarker");
- effects.consume(code3);
- effects.exit("gfmFootnoteCallMarker");
- effects.enter("gfmFootnoteCallString");
- effects.enter("chunkString").contentType = "string";
- return callData;
- }
- function callData(code3) {
- if (
- // Too long.
- size > 999 || // Closing brace with nothing.
- code3 === 93 && !data || // Space or tab is not supported by GFM for some reason.
- // `\n` and `[` not being supported makes sense.
- code3 === null || code3 === 91 || markdownLineEndingOrSpace(code3)
- ) {
- return nok(code3);
- }
- if (code3 === 93) {
- effects.exit("chunkString");
- const token = effects.exit("gfmFootnoteCallString");
- if (!defined.includes(normalizeIdentifier(self.sliceSerialize(token)))) {
- return nok(code3);
- }
- effects.enter("gfmFootnoteCallLabelMarker");
- effects.consume(code3);
- effects.exit("gfmFootnoteCallLabelMarker");
- effects.exit("gfmFootnoteCall");
- return ok5;
- }
- if (!markdownLineEndingOrSpace(code3)) {
- data = true;
- }
- size++;
- effects.consume(code3);
- return code3 === 92 ? callEscape : callData;
- }
- function callEscape(code3) {
- if (code3 === 91 || code3 === 92 || code3 === 93) {
- effects.consume(code3);
- size++;
- return callData;
- }
- return callData(code3);
- }
- }
- function tokenizeDefinitionStart(effects, ok5, nok) {
- const self = this;
- const defined = self.parser.gfmFootnotes || (self.parser.gfmFootnotes = []);
- let identifier;
- let size = 0;
- let data;
- return start;
- function start(code3) {
- effects.enter("gfmFootnoteDefinition")._container = true;
- effects.enter("gfmFootnoteDefinitionLabel");
- effects.enter("gfmFootnoteDefinitionLabelMarker");
- effects.consume(code3);
- effects.exit("gfmFootnoteDefinitionLabelMarker");
- return labelAtMarker;
- }
- function labelAtMarker(code3) {
- if (code3 === 94) {
- effects.enter("gfmFootnoteDefinitionMarker");
- effects.consume(code3);
- effects.exit("gfmFootnoteDefinitionMarker");
- effects.enter("gfmFootnoteDefinitionLabelString");
- effects.enter("chunkString").contentType = "string";
- return labelInside;
- }
- return nok(code3);
- }
- function labelInside(code3) {
- if (
- // Too long.
- size > 999 || // Closing brace with nothing.
- code3 === 93 && !data || // Space or tab is not supported by GFM for some reason.
- // `\n` and `[` not being supported makes sense.
- code3 === null || code3 === 91 || markdownLineEndingOrSpace(code3)
- ) {
- return nok(code3);
- }
- if (code3 === 93) {
- effects.exit("chunkString");
- const token = effects.exit("gfmFootnoteDefinitionLabelString");
- identifier = normalizeIdentifier(self.sliceSerialize(token));
- effects.enter("gfmFootnoteDefinitionLabelMarker");
- effects.consume(code3);
- effects.exit("gfmFootnoteDefinitionLabelMarker");
- effects.exit("gfmFootnoteDefinitionLabel");
- return labelAfter;
- }
- if (!markdownLineEndingOrSpace(code3)) {
- data = true;
- }
- size++;
- effects.consume(code3);
- return code3 === 92 ? labelEscape : labelInside;
- }
- function labelEscape(code3) {
- if (code3 === 91 || code3 === 92 || code3 === 93) {
- effects.consume(code3);
- size++;
- return labelInside;
- }
- return labelInside(code3);
- }
- function labelAfter(code3) {
- if (code3 === 58) {
- effects.enter("definitionMarker");
- effects.consume(code3);
- effects.exit("definitionMarker");
- if (!defined.includes(identifier)) {
- defined.push(identifier);
- }
- return factorySpace(effects, whitespaceAfter, "gfmFootnoteDefinitionWhitespace");
- }
- return nok(code3);
- }
- function whitespaceAfter(code3) {
- return ok5(code3);
- }
- }
- function tokenizeDefinitionContinuation(effects, ok5, nok) {
- return effects.check(blankLine, ok5, effects.attempt(indent, ok5, nok));
- }
- function gfmFootnoteDefinitionEnd(effects) {
- effects.exit("gfmFootnoteDefinition");
- }
- function tokenizeIndent(effects, ok5, nok) {
- const self = this;
- return factorySpace(effects, afterPrefix, "gfmFootnoteDefinitionIndent", 4 + 1);
- function afterPrefix(code3) {
- const tail = self.events[self.events.length - 1];
- return tail && tail[1].type === "gfmFootnoteDefinitionIndent" && tail[2].sliceSerialize(tail[1], true).length === 4 ? ok5(code3) : nok(code3);
- }
- }
- // node_modules/micromark-extension-gfm-strikethrough/lib/syntax.js
- function gfmStrikethrough(options) {
- const options_ = options || {};
- let single = options_.singleTilde;
- const tokenizer = {
- name: "strikethrough",
- tokenize: tokenizeStrikethrough,
- resolveAll: resolveAllStrikethrough
- };
- if (single === null || single === void 0) {
- single = true;
- }
- return {
- text: {
- [126]: tokenizer
- },
- insideSpan: {
- null: [tokenizer]
- },
- attentionMarkers: {
- null: [126]
- }
- };
- function resolveAllStrikethrough(events, context) {
- let index = -1;
- while (++index < events.length) {
- if (events[index][0] === "enter" && events[index][1].type === "strikethroughSequenceTemporary" && events[index][1]._close) {
- let open = index;
- while (open--) {
- if (events[open][0] === "exit" && events[open][1].type === "strikethroughSequenceTemporary" && events[open][1]._open && // If the sizes are the same:
- events[index][1].end.offset - events[index][1].start.offset === events[open][1].end.offset - events[open][1].start.offset) {
- events[index][1].type = "strikethroughSequence";
- events[open][1].type = "strikethroughSequence";
- const strikethrough = {
- type: "strikethrough",
- start: Object.assign({}, events[open][1].start),
- end: Object.assign({}, events[index][1].end)
- };
- const text3 = {
- type: "strikethroughText",
- start: Object.assign({}, events[open][1].end),
- end: Object.assign({}, events[index][1].start)
- };
- const nextEvents = [["enter", strikethrough, context], ["enter", events[open][1], context], ["exit", events[open][1], context], ["enter", text3, context]];
- const insideSpan = context.parser.constructs.insideSpan.null;
- if (insideSpan) {
- splice(nextEvents, nextEvents.length, 0, resolveAll(insideSpan, events.slice(open + 1, index), context));
- }
- splice(nextEvents, nextEvents.length, 0, [["exit", text3, context], ["enter", events[index][1], context], ["exit", events[index][1], context], ["exit", strikethrough, context]]);
- splice(events, open - 1, index - open + 3, nextEvents);
- index = open + nextEvents.length - 2;
- break;
- }
- }
- }
- }
- index = -1;
- while (++index < events.length) {
- if (events[index][1].type === "strikethroughSequenceTemporary") {
- events[index][1].type = "data";
- }
- }
- return events;
- }
- function tokenizeStrikethrough(effects, ok5, nok) {
- const previous2 = this.previous;
- const events = this.events;
- let size = 0;
- return start;
- function start(code3) {
- if (previous2 === 126 && events[events.length - 1][1].type !== "characterEscape") {
- return nok(code3);
- }
- effects.enter("strikethroughSequenceTemporary");
- return more(code3);
- }
- function more(code3) {
- const before = classifyCharacter(previous2);
- if (code3 === 126) {
- if (size > 1) return nok(code3);
- effects.consume(code3);
- size++;
- return more;
- }
- if (size < 2 && !single) return nok(code3);
- const token = effects.exit("strikethroughSequenceTemporary");
- const after = classifyCharacter(code3);
- token._open = !after || after === 2 && Boolean(before);
- token._close = !before || before === 2 && Boolean(after);
- return ok5(code3);
- }
- }
- }
- // node_modules/micromark-extension-gfm-table/lib/edit-map.js
- var EditMap = class {
- /**
- * Create a new edit map.
- */
- constructor() {
- this.map = [];
- }
- /**
- * Create an edit: a remove and/or add at a certain place.
- *
- * @param {number} index
- * @param {number} remove
- * @param {Array<Event>} add
- * @returns {undefined}
- */
- add(index, remove, add) {
- addImplementation(this, index, remove, add);
- }
- // To do: add this when moving to `micromark`.
- // /**
- // * Create an edit: but insert `add` before existing additions.
- // *
- // * @param {number} index
- // * @param {number} remove
- // * @param {Array<Event>} add
- // * @returns {undefined}
- // */
- // addBefore(index, remove, add) {
- // addImplementation(this, index, remove, add, true)
- // }
- /**
- * Done, change the events.
- *
- * @param {Array<Event>} events
- * @returns {undefined}
- */
- consume(events) {
- this.map.sort(function(a, b) {
- return a[0] - b[0];
- });
- if (this.map.length === 0) {
- return;
- }
- let index = this.map.length;
- const vecs = [];
- while (index > 0) {
- index -= 1;
- vecs.push(events.slice(this.map[index][0] + this.map[index][1]), this.map[index][2]);
- events.length = this.map[index][0];
- }
- vecs.push([...events]);
- events.length = 0;
- let slice = vecs.pop();
- while (slice) {
- events.push(...slice);
- slice = vecs.pop();
- }
- this.map.length = 0;
- }
- };
- function addImplementation(editMap, at, remove, add) {
- let index = 0;
- if (remove === 0 && add.length === 0) {
- return;
- }
- while (index < editMap.map.length) {
- if (editMap.map[index][0] === at) {
- editMap.map[index][1] += remove;
- editMap.map[index][2].push(...add);
- return;
- }
- index += 1;
- }
- editMap.map.push([at, remove, add]);
- }
- // node_modules/micromark-extension-gfm-table/lib/infer.js
- function gfmTableAlign(events, index) {
- let inDelimiterRow = false;
- const align = [];
- while (index < events.length) {
- const event = events[index];
- if (inDelimiterRow) {
- if (event[0] === "enter") {
- if (event[1].type === "tableContent") {
- align.push(events[index + 1][1].type === "tableDelimiterMarker" ? "left" : "none");
- }
- } else if (event[1].type === "tableContent") {
- if (events[index - 1][1].type === "tableDelimiterMarker") {
- const alignIndex = align.length - 1;
- align[alignIndex] = align[alignIndex] === "left" ? "center" : "right";
- }
- } else if (event[1].type === "tableDelimiterRow") {
- break;
- }
- } else if (event[0] === "enter" && event[1].type === "tableDelimiterRow") {
- inDelimiterRow = true;
- }
- index += 1;
- }
- return align;
- }
- // node_modules/micromark-extension-gfm-table/lib/syntax.js
- function gfmTable() {
- return {
- flow: {
- null: {
- name: "table",
- tokenize: tokenizeTable,
- resolveAll: resolveTable
- }
- }
- };
- }
- function tokenizeTable(effects, ok5, nok) {
- const self = this;
- let size = 0;
- let sizeB = 0;
- let seen;
- return start;
- function start(code3) {
- let index = self.events.length - 1;
- while (index > -1) {
- const type = self.events[index][1].type;
- if (type === "lineEnding" || // Note: markdown-rs uses `whitespace` instead of `linePrefix`
- type === "linePrefix") index--;
- else break;
- }
- const tail = index > -1 ? self.events[index][1].type : null;
- const next = tail === "tableHead" || tail === "tableRow" ? bodyRowStart : headRowBefore;
- if (next === bodyRowStart && self.parser.lazy[self.now().line]) {
- return nok(code3);
- }
- return next(code3);
- }
- function headRowBefore(code3) {
- effects.enter("tableHead");
- effects.enter("tableRow");
- return headRowStart(code3);
- }
- function headRowStart(code3) {
- if (code3 === 124) {
- return headRowBreak(code3);
- }
- seen = true;
- sizeB += 1;
- return headRowBreak(code3);
- }
- function headRowBreak(code3) {
- if (code3 === null) {
- return nok(code3);
- }
- if (markdownLineEnding(code3)) {
- if (sizeB > 1) {
- sizeB = 0;
- self.interrupt = true;
- effects.exit("tableRow");
- effects.enter("lineEnding");
- effects.consume(code3);
- effects.exit("lineEnding");
- return headDelimiterStart;
- }
- return nok(code3);
- }
- if (markdownSpace(code3)) {
- return factorySpace(effects, headRowBreak, "whitespace")(code3);
- }
- sizeB += 1;
- if (seen) {
- seen = false;
- size += 1;
- }
- if (code3 === 124) {
- effects.enter("tableCellDivider");
- effects.consume(code3);
- effects.exit("tableCellDivider");
- seen = true;
- return headRowBreak;
- }
- effects.enter("data");
- return headRowData(code3);
- }
- function headRowData(code3) {
- if (code3 === null || code3 === 124 || markdownLineEndingOrSpace(code3)) {
- effects.exit("data");
- return headRowBreak(code3);
- }
- effects.consume(code3);
- return code3 === 92 ? headRowEscape : headRowData;
- }
- function headRowEscape(code3) {
- if (code3 === 92 || code3 === 124) {
- effects.consume(code3);
- return headRowData;
- }
- return headRowData(code3);
- }
- function headDelimiterStart(code3) {
- self.interrupt = false;
- if (self.parser.lazy[self.now().line]) {
- return nok(code3);
- }
- effects.enter("tableDelimiterRow");
- seen = false;
- if (markdownSpace(code3)) {
- return factorySpace(effects, headDelimiterBefore, "linePrefix", self.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(code3);
- }
- return headDelimiterBefore(code3);
- }
- function headDelimiterBefore(code3) {
- if (code3 === 45 || code3 === 58) {
- return headDelimiterValueBefore(code3);
- }
- if (code3 === 124) {
- seen = true;
- effects.enter("tableCellDivider");
- effects.consume(code3);
- effects.exit("tableCellDivider");
- return headDelimiterCellBefore;
- }
- return headDelimiterNok(code3);
- }
- function headDelimiterCellBefore(code3) {
- if (markdownSpace(code3)) {
- return factorySpace(effects, headDelimiterValueBefore, "whitespace")(code3);
- }
- return headDelimiterValueBefore(code3);
- }
- function headDelimiterValueBefore(code3) {
- if (code3 === 58) {
- sizeB += 1;
- seen = true;
- effects.enter("tableDelimiterMarker");
- effects.consume(code3);
- effects.exit("tableDelimiterMarker");
- return headDelimiterLeftAlignmentAfter;
- }
- if (code3 === 45) {
- sizeB += 1;
- return headDelimiterLeftAlignmentAfter(code3);
- }
- if (code3 === null || markdownLineEnding(code3)) {
- return headDelimiterCellAfter(code3);
- }
- return headDelimiterNok(code3);
- }
- function headDelimiterLeftAlignmentAfter(code3) {
- if (code3 === 45) {
- effects.enter("tableDelimiterFiller");
- return headDelimiterFiller(code3);
- }
- return headDelimiterNok(code3);
- }
- function headDelimiterFiller(code3) {
- if (code3 === 45) {
- effects.consume(code3);
- return headDelimiterFiller;
- }
- if (code3 === 58) {
- seen = true;
- effects.exit("tableDelimiterFiller");
- effects.enter("tableDelimiterMarker");
- effects.consume(code3);
- effects.exit("tableDelimiterMarker");
- return headDelimiterRightAlignmentAfter;
- }
- effects.exit("tableDelimiterFiller");
- return headDelimiterRightAlignmentAfter(code3);
- }
- function headDelimiterRightAlignmentAfter(code3) {
- if (markdownSpace(code3)) {
- return factorySpace(effects, headDelimiterCellAfter, "whitespace")(code3);
- }
- return headDelimiterCellAfter(code3);
- }
- function headDelimiterCellAfter(code3) {
- if (code3 === 124) {
- return headDelimiterBefore(code3);
- }
- if (code3 === null || markdownLineEnding(code3)) {
- if (!seen || size !== sizeB) {
- return headDelimiterNok(code3);
- }
- effects.exit("tableDelimiterRow");
- effects.exit("tableHead");
- return ok5(code3);
- }
- return headDelimiterNok(code3);
- }
- function headDelimiterNok(code3) {
- return nok(code3);
- }
- function bodyRowStart(code3) {
- effects.enter("tableRow");
- return bodyRowBreak(code3);
- }
- function bodyRowBreak(code3) {
- if (code3 === 124) {
- effects.enter("tableCellDivider");
- effects.consume(code3);
- effects.exit("tableCellDivider");
- return bodyRowBreak;
- }
- if (code3 === null || markdownLineEnding(code3)) {
- effects.exit("tableRow");
- return ok5(code3);
- }
- if (markdownSpace(code3)) {
- return factorySpace(effects, bodyRowBreak, "whitespace")(code3);
- }
- effects.enter("data");
- return bodyRowData(code3);
- }
- function bodyRowData(code3) {
- if (code3 === null || code3 === 124 || markdownLineEndingOrSpace(code3)) {
- effects.exit("data");
- return bodyRowBreak(code3);
- }
- effects.consume(code3);
- return code3 === 92 ? bodyRowEscape : bodyRowData;
- }
- function bodyRowEscape(code3) {
- if (code3 === 92 || code3 === 124) {
- effects.consume(code3);
- return bodyRowData;
- }
- return bodyRowData(code3);
- }
- }
- function resolveTable(events, context) {
- let index = -1;
- let inFirstCellAwaitingPipe = true;
- let rowKind = 0;
- let lastCell = [0, 0, 0, 0];
- let cell = [0, 0, 0, 0];
- let afterHeadAwaitingFirstBodyRow = false;
- let lastTableEnd = 0;
- let currentTable;
- let currentBody;
- let currentCell;
- const map4 = new EditMap();
- while (++index < events.length) {
- const event = events[index];
- const token = event[1];
- if (event[0] === "enter") {
- if (token.type === "tableHead") {
- afterHeadAwaitingFirstBodyRow = false;
- if (lastTableEnd !== 0) {
- flushTableEnd(map4, context, lastTableEnd, currentTable, currentBody);
- currentBody = void 0;
- lastTableEnd = 0;
- }
- currentTable = {
- type: "table",
- start: Object.assign({}, token.start),
- // Note: correct end is set later.
- end: Object.assign({}, token.end)
- };
- map4.add(index, 0, [["enter", currentTable, context]]);
- } else if (token.type === "tableRow" || token.type === "tableDelimiterRow") {
- inFirstCellAwaitingPipe = true;
- currentCell = void 0;
- lastCell = [0, 0, 0, 0];
- cell = [0, index + 1, 0, 0];
- if (afterHeadAwaitingFirstBodyRow) {
- afterHeadAwaitingFirstBodyRow = false;
- currentBody = {
- type: "tableBody",
- start: Object.assign({}, token.start),
- // Note: correct end is set later.
- end: Object.assign({}, token.end)
- };
- map4.add(index, 0, [["enter", currentBody, context]]);
- }
- rowKind = token.type === "tableDelimiterRow" ? 2 : currentBody ? 3 : 1;
- } else if (rowKind && (token.type === "data" || token.type === "tableDelimiterMarker" || token.type === "tableDelimiterFiller")) {
- inFirstCellAwaitingPipe = false;
- if (cell[2] === 0) {
- if (lastCell[1] !== 0) {
- cell[0] = cell[1];
- currentCell = flushCell(map4, context, lastCell, rowKind, void 0, currentCell);
- lastCell = [0, 0, 0, 0];
- }
- cell[2] = index;
- }
- } else if (token.type === "tableCellDivider") {
- if (inFirstCellAwaitingPipe) {
- inFirstCellAwaitingPipe = false;
- } else {
- if (lastCell[1] !== 0) {
- cell[0] = cell[1];
- currentCell = flushCell(map4, context, lastCell, rowKind, void 0, currentCell);
- }
- lastCell = cell;
- cell = [lastCell[1], index, 0, 0];
- }
- }
- } else if (token.type === "tableHead") {
- afterHeadAwaitingFirstBodyRow = true;
- lastTableEnd = index;
- } else if (token.type === "tableRow" || token.type === "tableDelimiterRow") {
- lastTableEnd = index;
- if (lastCell[1] !== 0) {
- cell[0] = cell[1];
- currentCell = flushCell(map4, context, lastCell, rowKind, index, currentCell);
- } else if (cell[1] !== 0) {
- currentCell = flushCell(map4, context, cell, rowKind, index, currentCell);
- }
- rowKind = 0;
- } else if (rowKind && (token.type === "data" || token.type === "tableDelimiterMarker" || token.type === "tableDelimiterFiller")) {
- cell[3] = index;
- }
- }
- if (lastTableEnd !== 0) {
- flushTableEnd(map4, context, lastTableEnd, currentTable, currentBody);
- }
- map4.consume(context.events);
- index = -1;
- while (++index < context.events.length) {
- const event = context.events[index];
- if (event[0] === "enter" && event[1].type === "table") {
- event[1]._align = gfmTableAlign(context.events, index);
- }
- }
- return events;
- }
- function flushCell(map4, context, range, rowKind, rowEnd, previousCell) {
- const groupName = rowKind === 1 ? "tableHeader" : rowKind === 2 ? "tableDelimiter" : "tableData";
- const valueName = "tableContent";
- if (range[0] !== 0) {
- previousCell.end = Object.assign({}, getPoint(context.events, range[0]));
- map4.add(range[0], 0, [["exit", previousCell, context]]);
- }
- const now = getPoint(context.events, range[1]);
- previousCell = {
- type: groupName,
- start: Object.assign({}, now),
- // Note: correct end is set later.
- end: Object.assign({}, now)
- };
- map4.add(range[1], 0, [["enter", previousCell, context]]);
- if (range[2] !== 0) {
- const relatedStart = getPoint(context.events, range[2]);
- const relatedEnd = getPoint(context.events, range[3]);
- const valueToken = {
- type: valueName,
- start: Object.assign({}, relatedStart),
- end: Object.assign({}, relatedEnd)
- };
- map4.add(range[2], 0, [["enter", valueToken, context]]);
- if (rowKind !== 2) {
- const start = context.events[range[2]];
- const end = context.events[range[3]];
- start[1].end = Object.assign({}, end[1].end);
- start[1].type = "chunkText";
- start[1].contentType = "text";
- if (range[3] > range[2] + 1) {
- const a = range[2] + 1;
- const b = range[3] - range[2] - 1;
- map4.add(a, b, []);
- }
- }
- map4.add(range[3] + 1, 0, [["exit", valueToken, context]]);
- }
- if (rowEnd !== void 0) {
- previousCell.end = Object.assign({}, getPoint(context.events, rowEnd));
- map4.add(rowEnd, 0, [["exit", previousCell, context]]);
- previousCell = void 0;
- }
- return previousCell;
- }
- function flushTableEnd(map4, context, index, table, tableBody) {
- const exits = [];
- const related = getPoint(context.events, index);
- if (tableBody) {
- tableBody.end = Object.assign({}, related);
- exits.push(["exit", tableBody, context]);
- }
- table.end = Object.assign({}, related);
- exits.push(["exit", table, context]);
- map4.add(index + 1, 0, exits);
- }
- function getPoint(events, index) {
- const event = events[index];
- const side = event[0] === "enter" ? "start" : "end";
- return event[1][side];
- }
- // node_modules/micromark-extension-gfm-task-list-item/lib/syntax.js
- var tasklistCheck = {
- name: "tasklistCheck",
- tokenize: tokenizeTasklistCheck
- };
- function gfmTaskListItem() {
- return {
- text: {
- [91]: tasklistCheck
- }
- };
- }
- function tokenizeTasklistCheck(effects, ok5, nok) {
- const self = this;
- return open;
- function open(code3) {
- if (
- // Exit if there’s stuff before.
- self.previous !== null || // Exit if not in the first content that is the first child of a list
- // item.
- !self._gfmTasklistFirstContentOfListItem
- ) {
- return nok(code3);
- }
- effects.enter("taskListCheck");
- effects.enter("taskListCheckMarker");
- effects.consume(code3);
- effects.exit("taskListCheckMarker");
- return inside;
- }
- function inside(code3) {
- if (markdownLineEndingOrSpace(code3)) {
- effects.enter("taskListCheckValueUnchecked");
- effects.consume(code3);
- effects.exit("taskListCheckValueUnchecked");
- return close;
- }
- if (code3 === 88 || code3 === 120) {
- effects.enter("taskListCheckValueChecked");
- effects.consume(code3);
- effects.exit("taskListCheckValueChecked");
- return close;
- }
- return nok(code3);
- }
- function close(code3) {
- if (code3 === 93) {
- effects.enter("taskListCheckMarker");
- effects.consume(code3);
- effects.exit("taskListCheckMarker");
- effects.exit("taskListCheck");
- return after;
- }
- return nok(code3);
- }
- function after(code3) {
- if (markdownLineEnding(code3)) {
- return ok5(code3);
- }
- if (markdownSpace(code3)) {
- return effects.check({
- tokenize: spaceThenNonSpace
- }, ok5, nok)(code3);
- }
- return nok(code3);
- }
- }
- function spaceThenNonSpace(effects, ok5, nok) {
- return factorySpace(effects, after, "whitespace");
- function after(code3) {
- return code3 === null ? nok(code3) : ok5(code3);
- }
- }
- // node_modules/micromark-extension-gfm/index.js
- function gfm(options) {
- return combineExtensions([
- gfmAutolinkLiteral(),
- gfmFootnote(),
- gfmStrikethrough(options),
- gfmTable(),
- gfmTaskListItem()
- ]);
- }
- // node_modules/remark-gfm/lib/index.js
- var emptyOptions2 = {};
- function remarkGfm(options) {
- const self = (
- /** @type {Processor} */
- this
- );
- const settings = options || emptyOptions2;
- const data = self.data();
- const micromarkExtensions = data.micromarkExtensions || (data.micromarkExtensions = []);
- const fromMarkdownExtensions = data.fromMarkdownExtensions || (data.fromMarkdownExtensions = []);
- const toMarkdownExtensions = data.toMarkdownExtensions || (data.toMarkdownExtensions = []);
- micromarkExtensions.push(gfm(settings));
- fromMarkdownExtensions.push(gfmFromMarkdown());
- toMarkdownExtensions.push(gfmToMarkdown(settings));
- }
- // remark-gfm.js
- var remark_gfm_default = remarkGfm;
|