nkString, { contentType: constants.contentTypeString }); return info(code2); } function info(code2) { if (code2 === codes.eof || markdownLineEnding(code2)) { effects.exit(types.chunkString); effects.exit(types.codeFencedFenceInfo); return infoBefore(code2); } if (markdownSpace(code2)) { effects.exit(types.chunkString); effects.exit(types.codeFencedFenceInfo); return factorySpace(effects, metaBefore, types.whitespace)(code2); } if (code2 === codes.graveAccent && code2 === marker) { return nok(code2); } effects.consume(code2); return info; } function metaBefore(code2) { if (code2 === codes.eof || markdownLineEnding(code2)) { return infoBefore(code2); } effects.enter(types.codeFencedFenceMeta); effects.enter(types.chunkString, { contentType: constants.contentTypeString }); return meta(code2); } function meta(code2) { if (code2 === codes.eof || markdownLineEnding(code2)) { effects.exit(types.chunkString); effects.exit(types.codeFencedFenceMeta); return infoBefore(code2); } if (code2 === codes.graveAccent && code2 === marker) { return nok(code2); } effects.consume(code2); return meta; } function atNonLazyBreak(code2) { ok(markdownLineEnding(code2), "expected eol"); return effects.attempt(closeStart, after, contentBefore)(code2); } function contentBefore(code2) { ok(markdownLineEnding(code2), "expected eol"); effects.enter(types.lineEnding); effects.consume(code2); effects.exit(types.lineEnding); return contentStart; } function contentStart(code2) { return initialPrefix > 0 && markdownSpace(code2) ? factorySpace( effects, beforeContentChunk, types.linePrefix, initialPrefix + 1 )(code2) : beforeContentChunk(code2); } function beforeContentChunk(code2) { if (code2 === codes.eof || markdownLineEnding(code2)) { return effects.check(nonLazyContinuation, atNonLazyBreak, after)(code2); } effects.enter(types.codeFlowValue); return contentChunk(code2); } function contentChunk(code2) { if (code2 === codes.eof || markdownLineEnding(code2)) { effects.exit(types.codeFlowValue); return beforeContentChunk(code2); } effects.consume(code2); return contentChunk; } function after(code2) { effects.exit(types.codeFenced); return ok3(code2); } function tokenizeCloseStart(effects2, ok4, nok2) { let size = 0; return startBefore; function startBefore(code2) { ok(markdownLineEnding(code2), "expected eol"); effects2.enter(types.lineEnding); effects2.consume(code2); effects2.exit(types.lineEnding); return start3; } function start3(code2) { ok( self2.parser.constructs.disable.null, "expected `disable.null` to be populated" ); effects2.enter(types.codeFencedFence); return markdownSpace(code2) ? factorySpace( effects2, beforeSequenceClose, types.linePrefix, self2.parser.constructs.disable.null.includes("codeIndented") ? void 0 : constants.tabSize )(code2) : beforeSequenceClose(code2); } function beforeSequenceClose(code2) { if (code2 === marker) { effects2.enter(types.codeFencedFenceSequence); return sequenceClose(code2); } return nok2(code2); } function sequenceClose(code2) { if (code2 === marker) { size++; effects2.consume(code2); return sequenceClose; } if (size >= sizeOpen) { effects2.exit(types.codeFencedFenceSequence); return markdownSpace(code2) ? factorySpace(effects2, sequenceCloseAfter, types.whitespace)(code2) : sequenceCloseAfter(code2); } return nok2(code2); } function sequenceCloseAfter(code2) { if (code2 === codes.eof || markdownLineEnding(code2)) { effects2.exit(types.codeFencedFence); return ok4(code2); } return nok2(code2); } } } function tokenizeNonLazyContinuation(effects, ok3, nok) { const self2 = this; return start2; function start2(code2) { if (code2 === codes.eof) { return nok(code2); } ok(markdownLineEnding(code2), "expected eol"); effects.enter(types.lineEnding); effects.consume(code2); effects.exit(types.lineEnding); return lineStart; } function lineStart(code2) { return self2.parser.lazy[self2.now().line] ? nok(code2) : ok3(code2); } } // node_modules/micromark-core-commonmark/dev/lib/code-indented.js var codeIndented = { name: "codeIndented", tokenize: tokenizeCodeIndented }; var furtherStart = { partial: true, tokenize: tokenizeFurtherStart }; function tokenizeCodeIndented(effects, ok3, nok) { const self2 = this; return start2; function start2(code2) { ok(markdownSpace(code2)); effects.enter(types.codeIndented); return factorySpace( effects, afterPrefix, types.linePrefix, constants.tabSize + 1 )(code2); } function afterPrefix(code2) { const tail = self2.events[self2.events.length - 1]; return tail && tail[1].type === types.linePrefix && tail[2].sliceSerialize(tail[1], true).length >= constants.tabSize ? atBreak(code2) : nok(code2); } function atBreak(code2) { if (code2 === codes.eof) { return after(code2); } if (markdownLineEnding(code2)) { return effects.attempt(furtherStart, atBreak, after)(code2); } effects.enter(types.codeFlowValue); return inside(code2); } function inside(code2) { if (code2 === codes.eof || markdownLineEnding(code2)) { effects.exit(types.codeFlowValue); return atBreak(code2); } effects.consume(code2); return inside; } function after(code2) { effects.exit(types.codeIndented); return ok3(code2); } } function tokenizeFurtherStart(effects, ok3, nok) { const self2 = this; return furtherStart2; function furtherStart2(code2) { if (self2.parser.lazy[self2.now().line]) { return nok(code2); } if (markdownLineEnding(code2)) { effects.enter(types.lineEnding); effects.consume(code2); effects.exit(types.lineEnding); return furtherStart2; } return factorySpace( effects, afterPrefix, types.linePrefix, constants.tabSize + 1 )(code2); } function afterPrefix(code2) { const tail = self2.events[self2.events.length - 1]; return tail && tail[1].type === types.linePrefix && tail[2].sliceSerialize(tail[1], true).length >= constants.tabSize ? ok3(code2) : markdownLineEnding(code2) ? furtherStart2(code2) : nok(code2); } } // node_modules/micromark-core-commonmark/dev/lib/code-text.js var codeText = { name: "codeText", previous, resolve: resolveCodeText, tokenize: tokenizeCodeText }; function resolveCodeText(events) { let tailExitIndex = events.length - 4; let headEnterIndex = 3; let index2; let enter; if ((events[headEnterIndex][1].type === types.lineEnding || events[headEnterIndex][1].type === "space") && (events[tailExitIndex][1].type === types.lineEnding || events[tailExitIndex][1].type === "space")) { index2 = headEnterIndex; while (++index2 < tailExitIndex) { if (events[index2][1].type === types.codeTextData) { events[headEnterIndex][1].type = types.codeTextPadding; events[tailExitIndex][1].type = types.codeTextPadding; headEnterIndex += 2; tailExitIndex -= 2; break; } } } index2 = headEnterIndex - 1; tailExitIndex++; while (++index2 <= tailExitIndex) { if (enter === void 0) { if (index2 !== tailExitIndex && events[index2][1].type !== types.lineEnding) { enter = index2; } } else if (index2 === tailExitIndex || events[index2][1].type === types.lineEnding) { events[enter][1].type = types.codeTextData; if (index2 !== enter + 2) { events[enter][1].end = events[index2 - 1][1].end; events.splice(enter + 2, index2 - enter - 2); tailExitIndex -= index2 - enter - 2; index2 = enter + 2; } enter = void 0; } } return events; } function previous(code2) { return code2 !== codes.graveAccent || this.events[this.events.length - 1][1].type === types.characterEscape; } function tokenizeCodeText(effects, ok3, nok) { const self2 = this; let sizeOpen = 0; let size; let token; return start2; function start2(code2) { ok(code2 === codes.graveAccent, "expected `` ` ``"); ok(previous.call(self2, self2.previous), "expected correct previous"); effects.enter(types.codeText); effects.enter(types.codeTextSequence); return sequenceOpen(code2); } function sequenceOpen(code2) { if (code2 === codes.graveAccent) { effects.consume(code2); sizeOpen++; return sequenceOpen; } effects.exit(types.codeTextSequence); return between(code2); } function between(code2) { if (code2 === codes.eof) { return nok(code2); } if (code2 === codes.space) { effects.enter("space"); effects.consume(code2); effects.exit("space"); return between; } if (code2 === codes.graveAccent) { token = effects.enter(types.codeTextSequence); size = 0; return sequenceClose(code2); } if (markdownLineEnding(code2)) { effects.enter(types.lineEnding); effects.consume(code2); effects.exit(types.lineEnding); return between; } effects.enter(types.codeTextData); return data(code2); } function data(code2) { if (code2 === codes.eof || code2 === codes.space || code2 === codes.graveAccent || markdownLineEnding(code2)) { effects.exit(types.codeTextData); return between(code2); } effects.consume(code2); return data; } function sequenceClose(code2) { if (code2 === codes.graveAccent) { effects.consume(code2); size++; return sequenceClose; } if (size === sizeOpen) { effects.exit(types.codeTextSequence); effects.exit(types.codeText); return ok3(code2); } token.type = types.codeTextData; return data(code2); } } // node_modules/micromark-util-subtokenize/dev/lib/splice-buffer.js var SpliceBuffer = class { /** * @param {ReadonlyArray | null | undefined} [initial] * Initial items (optional). * @returns * Splice buffer. */ constructor(initial) { this.left = initial ? [...initial] : []; this.right = []; } /** * Array access; * does not move the cursor. * * @param {number} index * Index. * @return {T} * Item. */ get(index2) { if (index2 < 0 || index2 >= this.left.length + this.right.length) { throw new RangeError( "Cannot access index `" + index2 + "` in a splice buffer of size `" + (this.left.length + this.right.length) + "`" ); } if (index2 < this.left.length) return this.left[index2]; return this.right[this.right.length - index2 + this.left.length - 1]; } /** * The length of the splice buffer, one greater than the largest index in the * array. */ get length() { return this.left.length + this.right.length; } /** * Remove and return `list[0]`; * moves the cursor to `0`. * * @returns {T | undefined} * Item, optional. */ shift() { this.setCursor(0); return this.right.pop(); } /** * Slice the buffer to get an array; * does not move the cursor. * * @param {number} start * Start. * @param {number | null | undefined} [end] * End (optional). * @returns {Array} * Array of items. */ slice(start2, end) { const stop = end === null || end === void 0 ? Number.POSITIVE_INFINITY : end; if (stop < this.left.length) { return this.left.slice(start2, stop); } if (start2 > this.left.length) { return this.right.slice( this.right.length - stop + this.left.length, this.right.length - start2 + this.left.length ).reverse(); } return this.left.slice(start2).concat( this.right.slice(this.right.length - stop + this.left.length).reverse() ); } /** * Mimics the behavior of Array.prototype.splice() except for the change of * interface necessary to avoid segfaults when patching in very large arrays. * * This operation moves cursor is moved to `start` and results in the cursor * placed after any inserted items. * * @param {number} start * Start; * zero-based index at which to start changing the array; * negative numbers count backwards from the end of the array and values * that are out-of bounds are clamped to the appropriate end of the array. * @param {number | null | undefined} [deleteCount=0] * Delete count (default: `0`); * maximum number of elements to delete, starting from start. * @param {Array | null | undefined} [items=[]] * Items to include in place of the deleted items (default: `[]`). * @return {Array} * Any removed items. */ splice(start2, deleteCount, items) { const count = deleteCount || 0; this.setCursor(Math.trunc(start2)); const removed = this.right.splice( this.right.length - count, Number.POSITIVE_INFINITY ); if (items) chunkedPush(this.left, items); return removed.reverse(); } /** * Remove and return the highest-numbered item in the array, so * `list[list.length - 1]`; * Moves the cursor to `length`. * * @returns {T | undefined} * Item, optional. */ pop() { this.setCursor(Number.POSITIVE_INFINITY); return this.left.pop(); } /** * Inserts a single item to the high-numbered side of the array; * moves the cursor to `length`. * * @param {T} item * Item. * @returns {undefined} * Nothing. */ push(item) { this.setCursor(Number.POSITIVE_INFINITY); this.left.push(item); } /** * Inserts many items to the high-numbered side of the array. * Moves the cursor to `length`. * * @param {Array} items * Items. * @returns {undefined} * Nothing. */ pushMany(items) { this.setCursor(Number.POSITIVE_INFINITY); chunkedPush(this.left, items); } /** * Inserts a single item to the low-numbered side of the array; * Moves the cursor to `0`. * * @param {T} item * Item. * @returns {undefined} * Nothing. */ unshift(item) { this.setCursor(0); this.right.push(item); } /** * Inserts many items to the low-numbered side of the array; * moves the cursor to `0`. * * @param {Array} items * Items. * @returns {undefined} * Nothing. */ unshiftMany(items) { this.setCursor(0); chunkedPush(this.right, items.reverse()); } /** * Move the cursor to a specific position in the array. Requires * time proportional to the distance moved. * * If `n < 0`, the cursor will end up at the beginning. * If `n > length`, the cursor will end up at the end. * * @param {number} n * Position. * @return {undefined} * Nothing. */ setCursor(n) { if (n === this.left.length || n > this.left.length && this.right.length === 0 || n < 0 && this.left.length === 0) return; if (n < this.left.length) { const removed = this.left.splice(n, Number.POSITIVE_INFINITY); chunkedPush(this.right, removed.reverse()); } else { const removed = this.right.splice( this.left.length + this.right.length - n, Number.POSITIVE_INFINITY ); chunkedPush(this.left, removed.reverse()); } } }; function chunkedPush(list3, right) { let chunkStart = 0; if (right.length < constants.v8MaxSafeChunkSize) { list3.push(...right); } else { while (chunkStart < right.length) { list3.push( ...right.slice(chunkStart, chunkStart + constants.v8MaxSafeChunkSize) ); chunkStart += constants.v8MaxSafeChunkSize; } } } // node_modules/micromark-util-subtokenize/dev/index.js function subtokenize(eventsArray) { const jumps = {}; let index2 = -1; let event; let lineIndex; let otherIndex; let otherEvent; let parameters; let subevents; let more; const events = new SpliceBuffer(eventsArray); while (++index2 < events.length) { while (index2 in jumps) { index2 = jumps[index2]; } event = events.get(index2); if (index2 && event[1].type === types.chunkFlow && events.get(index2 - 1)[1].type === types.listItemPrefix) { ok(event[1]._tokenizer, "expected `_tokenizer` on subtokens"); subevents = event[1]._tokenizer.events; otherIndex = 0; if (otherIndex < subevents.length && subevents[otherIndex][1].type === types.lineEndingBlank) { otherIndex += 2; } if (otherIndex < subevents.length && subevents[otherIndex][1].type === types.content) { while (++otherIndex < subevents.length) { if (subevents[otherIndex][1].type === types.content) { break; } if (subevents[otherIndex][1].type === types.chunkText) { subevents[otherIndex][1]._isInFirstContentOfListItem = true; otherIndex++; } } } } if (event[0] === "enter") { if (event[1].contentType) { Object.assign(jumps, subcontent(events, index2)); index2 = jumps[index2]; more = true; } } else if (event[1]._container) { otherIndex = index2; lineIndex = void 0; while (otherIndex--) { otherEvent = events.get(otherIndex); if (otherEvent[1].type === types.lineEnding || otherEvent[1].type === types.lineEndingBlank) { if (otherEvent[0] === "enter") { if (lineIndex) { events.get(lineIndex)[1].type = types.lineEndingBlank; } otherEvent[1].type = types.lineEnding; lineIndex = otherIndex; } } else if (otherEvent[1].type === types.linePrefix || otherEvent[1].type === types.listItemIndent) { } else { break; } } if (lineIndex) { event[1].end = { ...events.get(lineIndex)[1].start }; parameters = events.slice(lineIndex, index2); parameters.unshift(event); events.splice(lineIndex, index2 - lineIndex + 1, parameters); } } } splice(eventsArray, 0, Number.POSITIVE_INFINITY, events.slice(0)); return !more; } function subcontent(events, eventIndex) { const token = events.get(eventIndex)[1]; const context = events.get(eventIndex)[2]; let startPosition = eventIndex - 1; const startPositions = []; ok(token.contentType, "expected `contentType` on subtokens"); let tokenizer = token._tokenizer; if (!tokenizer) { tokenizer = context.parser[token.contentType](token.start); if (token._contentTypeTextTrailing) { tokenizer._contentTypeTextTrailing = true; } } const childEvents = tokenizer.events; const jumps = []; const gaps = {}; let stream; let previous2; let index2 = -1; let current = token; let adjust = 0; let start2 = 0; const breaks = [start2]; while (current) { while (events.get(++startPosition)[1] !== current) { } ok( !previous2 || current.previous === previous2, "expected previous to match" ); ok(!previous2 || previous2.next === current, "expected next to match"); startPositions.push(startPosition); if (!current._tokenizer) { stream = context.sliceStream(current); if (!current.next) { stream.push(codes.eof); } if (previous2) { tokenizer.defineSkip(current.start); } if (current._isInFirstContentOfListItem) { tokenizer._gfmTasklistFirstContentOfListItem = true; } tokenizer.write(stream); if (current._isInFirstContentOfListItem) { tokenizer._gfmTasklistFirstContentOfListItem = void 0; } } previous2 = current; current = current.next; } current = token; while (++index2 < childEvents.length) { if ( // Find a void token that includes a break. childEvents[index2][0] === "exit" && childEvents[index2 - 1][0] === "enter" && childEvents[index2][1].type === childEvents[index2 - 1][1].type && childEvents[index2][1].start.line !== childEvents[index2][1].end.line ) { ok(current, "expected a current token"); start2 = index2 + 1; breaks.push(start2); current._tokenizer = void 0; current.previous = void 0; current = current.next; } } tokenizer.events = []; if (current) { current._tokenizer = void 0; current.previous = void 0; ok(!current.next, "expected no next token"); } else { breaks.pop(); } index2 = breaks.length; while (index2--) { const slice = childEvents.slice(breaks[index2], breaks[index2 + 1]); const start3 = startPositions.pop(); ok(start3 !== void 0, "expected a start position when splicing"); jumps.push([start3, start3 + slice.length - 1]); events.splice(start3, 2, slice); } jumps.reverse(); index2 = -1; while (++index2 < jumps.length) { gaps[adjust + jumps[index2][0]] = adjust + jumps[index2][1]; adjust += jumps[index2][1] - jumps[index2][0] - 1; } return gaps; } // node_modules/micromark-core-commonmark/dev/lib/content.js var content2 = { resolve: resolveContent, tokenize: tokenizeContent }; var continuationConstruct = { partial: true, tokenize: tokenizeContinuation }; function resolveContent(events) { subtokenize(events); return events; } function tokenizeContent(effects, ok3) { let previous2; return chunkStart; function chunkStart(code2) { ok( code2 !== codes.eof && !markdownLineEnding(code2), "expected no eof or eol" ); effects.enter(types.content); previous2 = effects.enter(types.chunkContent, { contentType: constants.contentTypeContent }); return chunkInside(code2); } function chunkInside(code2) { if (code2 === codes.eof) { return contentEnd(code2); } if (markdownLineEnding(code2)) { return effects.check( continuationConstruct, contentContinue, contentEnd )(code2); } effects.consume(code2); return chunkInside; } function contentEnd(code2) { effects.exit(types.chunkContent); effects.exit(types.content); return ok3(code2); } function contentContinue(code2) { ok(markdownLineEnding(code2), "expected eol"); effects.consume(code2); effects.exit(types.chunkContent); ok(previous2, "expected previous token"); previous2.next = effects.enter(types.chunkContent, { contentType: constants.contentTypeContent, previous: previous2 }); previous2 = previous2.next; return chunkInside; } } function tokenizeContinuation(effects, ok3, nok) { const self2 = this; return startLookahead; function startLookahead(code2) { ok(markdownLineEnding(code2), "expected a line ending"); effects.exit(types.chunkContent); effects.enter(types.lineEnding); effects.consume(code2); effects.exit(types.lineEnding); return factorySpace(effects, prefixed, types.linePrefix); } function prefixed(code2) { if (code2 === codes.eof || markdownLineEnding(code2)) { return nok(code2); } ok( self2.parser.constructs.disable.null, "expected `disable.null` to be populated" ); const tail = self2.events[self2.events.length - 1]; if (!self2.parser.constructs.disable.null.includes("codeIndented") && tail && tail[1].type === types.linePrefix && tail[2].sliceSerialize(tail[1], true).length >= constants.tabSize) { return ok3(code2); } return effects.interrupt(self2.parser.constructs.flow, nok, ok3)(code2); } } // node_modules/micromark-factory-destination/dev/index.js function factoryDestination(effects, ok3, nok, type, literalType, literalMarkerType, rawType, stringType, max) { const limit = max || Number.POSITIVE_INFINITY; let balance = 0; return start2; function start2(code2) { if (code2 === codes.lessThan) { effects.enter(type); effects.enter(literalType); effects.enter(literalMarkerType); effects.consume(code2); effects.exit(literalMarkerType); return enclosedBefore; } if (code2 === codes.eof || code2 === codes.space || code2 === codes.rightParenthesis || asciiControl(code2)) { return nok(code2); } effects.enter(type); effects.enter(rawType); effects.enter(stringType); effects.enter(types.chunkString, { contentType: constants.contentTypeString }); return raw(code2); } function enclosedBefore(code2) { if (code2 === codes.greaterThan) { effects.enter(literalMarkerType); effects.consume(code2); effects.exit(literalMarkerType); effects.exit(literalType); effects.exit(type); return ok3; } effects.enter(stringType); effects.enter(types.chunkString, { contentType: constants.contentTypeString }); return enclosed(code2); } function enclosed(code2) { if (code2 === codes.greaterThan) { effects.exit(types.chunkString); effects.exit(stringType); return enclosedBefore(code2); } if (code2 === codes.eof || code2 === codes.lessThan || markdownLineEnding(code2)) { return nok(code2); } effects.consume(code2); return code2 === codes.backslash ? enclosedEscape : enclosed; } function enclosedEscape(code2) { if (code2 === codes.lessThan || code2 === codes.greaterThan || code2 === codes.backslash) { effects.consume(code2); return enclosed; } return enclosed(code2); } function raw(code2) { if (!balance && (code2 === codes.eof || code2 === codes.rightParenthesis || markdownLineEndingOrSpace(code2))) { effects.exit(types.chunkString); effects.exit(stringType); effects.exit(rawType); effects.exit(type); return ok3(code2); } if (balance < limit && code2 === codes.leftParenthesis) { effects.consume(code2); balance++; return raw; } if (code2 === codes.rightParenthesis) { effects.consume(code2); balance--; return raw; } if (code2 === codes.eof || code2 === codes.space || code2 === codes.leftParenthesis || asciiControl(code2)) { return nok(code2); } effects.consume(code2); return code2 === codes.backslash ? rawEscape : raw; } function rawEscape(code2) { if (code2 === codes.leftParenthesis || code2 === codes.rightParenthesis || code2 === codes.backslash) { effects.consume(code2); return raw; } return raw(code2); } } // node_modules/micromark-factory-label/dev/index.js function factoryLabel(effects, ok3, nok, type, markerType, stringType) { const self2 = this; let size = 0; let seen; return start2; function start2(code2) { ok(code2 === codes.leftSquareBracket, "expected `[`"); effects.enter(type); effects.enter(markerType); effects.consume(code2); effects.exit(markerType); effects.enter(stringType); return atBreak; } function atBreak(code2) { if (size > constants.linkReferenceSizeMax || code2 === codes.eof || code2 === codes.leftSquareBracket || code2 === codes.rightSquareBracket && !seen || // To do: remove in the future once we’ve switched from // `micromark-extension-footnote` to `micromark-extension-gfm-footnote`, // which doesn’t need this. // Hidden footnotes hook. /* c8 ignore next 3 */ code2 === codes.caret && !size && "_hiddenFootnoteSupport" in self2.parser.constructs) { return nok(code2); } if (code2 === codes.rightSquareBracket) { effects.exit(stringType); effects.enter(markerType); effects.consume(code2); effects.exit(markerType); effects.exit(type); return ok3; } if (markdownLineEnding(code2)) { effects.enter(types.lineEnding); effects.consume(code2); effects.exit(types.lineEnding); return atBreak; } effects.enter(types.chunkString, { contentType: constants.contentTypeString }); return labelInside(code2); } function labelInside(code2) { if (code2 === codes.eof || code2 === codes.leftSquareBracket || code2 === codes.rightSquareBracket || markdownLineEnding(code2) || size++ > constants.linkReferenceSizeMax) { effects.exit(types.chunkString); return atBreak(code2); } effects.consume(code2); if (!seen) seen = !markdownSpace(code2); return code2 === codes.backslash ? labelEscape : labelInside; } function labelEscape(code2) { if (code2 === codes.leftSquareBracket || code2 === codes.backslash || code2 === codes.rightSquareBracket) { effects.consume(code2); size++; return labelInside; } return labelInside(code2); } } // node_modules/micromark-factory-title/dev/index.js function factoryTitle(effects, ok3, nok, type, markerType, stringType) { let marker; return start2; function start2(code2) { if (code2 === codes.quotationMark || code2 === codes.apostrophe || code2 === codes.leftParenthesis) { effects.enter(type); effects.enter(markerType); effects.consume(code2); effects.exit(markerType); marker = code2 === codes.leftParenthesis ? codes.rightParenthesis : code2; return begin; } return nok(code2); } function begin(code2) { if (code2 === marker) { effects.enter(markerType); effects.consume(code2); effects.exit(markerType); effects.exit(type); return ok3; } effects.enter(stringType); return atBreak(code2); } function atBreak(code2) { if (code2 === marker) { effects.exit(stringType); return begin(marker); } if (code2 === codes.eof) { return nok(code2); } if (markdownLineEnding(code2)) { effects.enter(types.lineEnding); effects.consume(code2); effects.exit(types.lineEnding); return factorySpace(effects, atBreak, types.linePrefix); } effects.enter(types.chunkString, { contentType: constants.contentTypeString }); return inside(code2); } function inside(code2) { if (code2 === marker || code2 === codes.eof || markdownLineEnding(code2)) { effects.exit(types.chunkString); return atBreak(code2); } effects.consume(code2); return code2 === codes.backslash ? escape : inside; } function escape(code2) { if (code2 === marker || code2 === codes.backslash) { effects.consume(code2); return inside; } return inside(code2); } } // node_modules/micromark-factory-whitespace/dev/index.js function factoryWhitespace(effects, ok3) { let seen; return start2; function start2(code2) { if (markdownLineEnding(code2)) { effects.enter(types.lineEnding); effects.consume(code2); effects.exit(types.lineEnding); seen = true; return start2; } if (markdownSpace(code2)) { return factorySpace( effects, start2, seen ? types.linePrefix : types.lineSuffix )(code2); } return ok3(code2); } } // node_modules/micromark-core-commonmark/dev/lib/definition.js var definition = { name: "definition", tokenize: tokenizeDefinition }; var titleBefore = { partial: true, tokenize: tokenizeTitleBefore }; function tokenizeDefinition(effects, ok3, nok) { const self2 = this; let identifier; return start2; function start2(code2) { effects.enter(types.definition); return before(code2); } function before(code2) { ok(code2 === codes.leftSquareBracket, "expected `[`"); return factoryLabel.call( self2, effects, labelAfter, // Note: we don’t need to reset the way `markdown-rs` does. nok, types.definitionLabel, types.definitionLabelMarker, types.definitionLabelString )(code2); } function labelAfter(code2) { identifier = normalizeIdentifier( self2.sliceSerialize(self2.events[self2.events.length - 1][1]).slice(1, -1) ); if (code2 === codes.colon) { effects.enter(types.definitionMarker); effects.consume(code2); effects.exit(types.definitionMarker); return markerAfter; } return nok(code2); } function markerAfter(code2) { return markdownLineEndingOrSpace(code2) ? factoryWhitespace(effects, destinationBefore)(code2) : destinationBefore(code2); } function destinationBefore(code2) { return factoryDestination( effects, destinationAfter, // Note: we don’t need to reset the way `markdown-rs` does. nok, types.definitionDestination, types.definitionDestinationLiteral, types.definitionDestinationLiteralMarker, types.definitionDestinationRaw, types.definitionDestinationString )(code2); } function destinationAfter(code2) { return effects.attempt(titleBefore, after, after)(code2); } function after(code2) { return markdownSpace(code2) ? factorySpace(effects, afterWhitespace, types.whitespace)(code2) : afterWhitespace(code2); } function afterWhitespace(code2) { if (code2 === codes.eof || markdownLineEnding(code2)) { effects.exit(types.definition); self2.parser.defined.push(identifier); return ok3(code2); } return nok(code2); } } function tokenizeTitleBefore(effects, ok3, nok) { return titleBefore2; function titleBefore2(code2) { return markdownLineEndingOrSpace(code2) ? factoryWhitespace(effects, beforeMarker)(code2) : nok(code2); } function beforeMarker(code2) { return factoryTitle( effects, titleAfter, nok, types.definitionTitle, types.definitionTitleMarker, types.definitionTitleString )(code2); } function titleAfter(code2) { return markdownSpace(code2) ? factorySpace( effects, titleAfterOptionalWhitespace, types.whitespace )(code2) : titleAfterOptionalWhitespace(code2); } function titleAfterOptionalWhitespace(code2) { return code2 === codes.eof || markdownLineEnding(code2) ? ok3(code2) : nok(code2); } } // node_modules/micromark-core-commonmark/dev/lib/hard-break-escape.js var hardBreakEscape = { name: "hardBreakEscape", tokenize: tokenizeHardBreakEscape }; function tokenizeHardBreakEscape(effects, ok3, nok) { return start2; function start2(code2) { ok(code2 === codes.backslash, "expected `\\`"); effects.enter(types.hardBreakEscape); effects.consume(code2); return after; } function after(code2) { if (markdownLineEnding(code2)) { effects.exit(types.hardBreakEscape); return ok3(code2); } return nok(code2); } } // node_modules/micromark-core-commonmark/dev/lib/heading-atx.js var headingAtx = { name: "headingAtx", resolve: resolveHeadingAtx, tokenize: tokenizeHeadingAtx }; function resolveHeadingAtx(events, context) { let contentEnd = events.length - 2; let contentStart = 3; let content3; let text5; if (events[contentStart][1].type === types.whitespace) { contentStart += 2; } if (contentEnd - 2 > contentStart && events[contentEnd][1].type === types.whitespace) { contentEnd -= 2; } if (events[contentEnd][1].type === types.atxHeadingSequence && (contentStart === contentEnd - 1 || contentEnd - 4 > contentStart && events[contentEnd - 2][1].type === types.whitespace)) { contentEnd -= contentStart + 1 === contentEnd ? 2 : 4; } if (contentEnd > contentStart) { content3 = { type: types.atxHeadingText, start: events[contentStart][1].start, end: events[contentEnd][1].end }; text5 = { type: types.chunkText, start: events[contentStart][1].start, end: events[contentEnd][1].end, contentType: constants.contentTypeText }; splice(events, contentStart, contentEnd - contentStart + 1, [ ["enter", content3, context], ["enter", text5, context], ["exit", text5, context], ["exit", content3, context] ]); } return events; } function tokenizeHeadingAtx(effects, ok3, nok) { let size = 0; return start2; function start2(code2) { effects.enter(types.atxHeading); return before(code2); } function before(code2) { ok(code2 === codes.numberSign, "expected `#`"); effects.enter(types.atxHeadingSequence); return sequenceOpen(code2); } function sequenceOpen(code2) { if (code2 === codes.numberSign && size++ < constants.atxHeadingOpeningFenceSizeMax) { effects.consume(code2); return sequenceOpen; } if (code2 === codes.eof || markdownLineEndingOrSpace(code2)) { effects.exit(types.atxHeadingSequence); return atBreak(code2); } return nok(code2); } function atBreak(code2) { if (code2 === codes.numberSign) { effects.enter(types.atxHeadingSequence); return sequenceFurther(code2); } if (code2 === codes.eof || markdownLineEnding(code2)) { effects.exit(types.atxHeading); return ok3(code2); } if (markdownSpace(code2)) { return factorySpace(effects, atBreak, types.whitespace)(code2); } effects.enter(types.atxHeadingText); return data(code2); } function sequenceFurther(code2) { if (code2 === codes.numberSign) { effects.consume(code2); return sequenceFurther; } effects.exit(types.atxHeadingSequence); return atBreak(code2); } function data(code2) { if (code2 === codes.eof || code2 === codes.numberSign || markdownLineEndingOrSpace(code2)) { effects.exit(types.atxHeadingText); return atBreak(code2); } effects.consume(code2); return data; } } // node_modules/micromark-util-html-tag-name/index.js var htmlBlockNames = [ "address", "article", "aside", "base", "basefont", "blockquote", "body", "caption", "center", "col", "colgroup", "dd", "details", "dialog", "dir", "div", "dl", "dt", "fieldset", "figcaption", "figure", "footer", "form", "frame", "frameset", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hr", "html", "iframe", "legend", "li", "link", "main", "menu", "menuitem", "nav", "noframes", "ol", "optgroup", "option", "p", "param", "search", "section", "summary", "table", "tbody", "td", "tfoot", "th", "thead", "title", "tr", "track", "ul" ]; var htmlRawNames = ["pre", "script", "style", "textarea"]; // node_modules/micromark-core-commonmark/dev/lib/html-flow.js var htmlFlow = { concrete: true, name: "htmlFlow", resolveTo: resolveToHtmlFlow, tokenize: tokenizeHtmlFlow }; var blankLineBefore = { partial: true, tokenize: tokenizeBlankLineBefore }; var nonLazyContinuationStart = { partial: true, tokenize: tokenizeNonLazyContinuationStart }; function resolveToHtmlFlow(events) { let index2 = events.length; while (index2--) { if (events[index2][0] === "enter" && events[index2][1].type === types.htmlFlow) { break; } } if (index2 > 1 && events[index2 - 2][1].type === types.linePrefix) { events[index2][1].start = events[index2 - 2][1].start; events[index2 + 1][1].start = events[index2 - 2][1].start; events.splice(index2 - 2, 2); } return events; } function tokenizeHtmlFlow(effects, ok3, nok) { const self2 = this; let marker; let closingTag; let buffer; let index2; let markerB; return start2; function start2(code2) { return before(code2); } function before(code2) { ok(code2 === codes.lessThan, "expected `<`"); effects.enter(types.htmlFlow); effects.enter(types.htmlFlowData); effects.consume(code2); return open; } function open(code2) { if (code2 === codes.exclamationMark) { effects.consume(code2); return declarationOpen; } if (code2 === codes.slash) { effects.consume(code2); closingTag = true; return tagCloseStart; } if (code2 === codes.questionMark) { effects.consume(code2); marker = constants.htmlInstruction; return self2.interrupt ? ok3 : continuationDeclarationInside; } if (asciiAlpha(code2)) { ok(code2 !== null); effects.consume(code2); buffer = String.fromCharCode(code2); return tagName; } return nok(code2); } function declarationOpen(code2) { if (code2 === codes.dash) { effects.consume(code2); marker = constants.htmlComment; return commentOpenInside; } if (code2 === codes.leftSquareBracket) { effects.consume(code2); marker = constants.htmlCdata; index2 = 0; return cdataOpenInside; } if (asciiAlpha(code2)) { effects.consume(code2); marker = constants.htmlDeclaration; return self2.interrupt ? ok3 : continuationDeclarationInside; } return nok(code2); } function commentOpenInside(code2) { if (code2 === codes.dash) { effects.consume(code2); return self2.interrupt ? ok3 : continuationDeclarationInside; } return nok(code2); } function cdataOpenInside(code2) { const value = constants.cdataOpeningString; if (code2 === value.charCodeAt(index2++)) { effects.consume(code2); if (index2 === value.length) { return self2.interrupt ? ok3 : continuation; } return cdataOpenInside; } return nok(code2); } function tagCloseStart(code2) { if (asciiAlpha(code2)) { ok(code2 !== null); effects.consume(code2); buffer = String.fromCharCode(code2); return tagName; } return nok(code2); } function tagName(code2) { if (code2 === codes.eof || code2 === codes.slash || code2 === codes.greaterThan || markdownLineEndingOrSpace(code2)) { const slash = code2 === codes.slash; const name2 = buffer.toLowerCase(); if (!slash && !closingTag && htmlRawNames.includes(name2)) { marker = constants.htmlRaw; return self2.interrupt ? ok3(code2) : continuation(code2); } if (htmlBlockNames.includes(buffer.toLowerCase())) { marker = constants.htmlBasic; if (slash) { effects.consume(code2); return basicSelfClosing; } return self2.interrupt ? ok3(code2) : continuation(code2); } marker = constants.htmlComplete; return self2.interrupt && !self2.parser.lazy[self2.now().line] ? nok(code2) : closingTag ? completeClosingTagAfter(code2) : completeAttributeNameBefore(code2); } if (code2 === codes.dash || asciiAlphanumeric(code2)) { effects.consume(code2); buffer += String.fromCharCode(code2); return tagName; } return nok(code2); } function basicSelfClosing(code2) { if (code2 === codes.greaterThan) { effects.consume(code2); return self2.interrupt ? ok3 : continuation; } return nok(code2); } function completeClosingTagAfter(code2) { if (markdownSpace(code2)) { effects.consume(code2); return completeClosingTagAfter; } return completeEnd(code2); } function completeAttributeNameBefore(code2) { if (code2 === codes.slash) { effects.consume(code2); return completeEnd; } if (code2 === codes.colon || code2 === codes.underscore || asciiAlpha(code2)) { effects.consume(code2); return completeAttributeName; } if (markdownSpace(code2)) { effects.consume(code2); return completeAttributeNameBefore; } return completeEnd(code2); } function completeAttributeName(code2) { if (code2 === codes.dash || code2 === codes.dot || code2 === codes.colon || code2 === codes.underscore || asciiAlphanumeric(code2)) { effects.consume(code2); return completeAttributeName; } return completeAttributeNameAfter(code2); } function completeAttributeNameAfter(code2) { if (code2 === codes.equalsTo) { effects.consume(code2); return completeAttributeValueBefore; } if (markdownSpace(code2)) { effects.consume(code2); return completeAttributeNameAfter; } return completeAttributeNameBefore(code2); } function completeAttributeValueBefore(code2) { if (code2 === codes.eof || code2 === codes.lessThan || code2 === codes.equalsTo || code2 === codes.greaterThan || code2 === codes.graveAccent) { return nok(code2); } if (code2 === codes.quotationMark || code2 === codes.apostrophe) { effects.consume(code2); markerB = code2; return completeAttributeValueQuoted; } if (markdownSpace(code2)) { effects.consume(code2); return completeAttributeValueBefore; } return completeAttributeValueUnquoted(code2); } function completeAttributeValueQuoted(code2) { if (code2 === markerB) { effects.consume(code2); markerB = null; return completeAttributeValueQuotedAfter; } if (code2 === codes.eof || markdownLineEnding(code2)) { return nok(code2); } effects.consume(code2); return completeAttributeValueQuoted; } function completeAttributeValueUnquoted(code2) { if (code2 === codes.eof || code2 === codes.quotationMark || code2 === codes.apostrophe || code2 === codes.slash || code2 === codes.lessThan || code2 === codes.equalsTo || code2 === codes.greaterThan || code2 === codes.graveAccent || markdownLineEndingOrSpace(code2)) { return completeAttributeNameAfter(code2); } effects.consume(code2); return completeAttributeValueUnquoted; } function completeAttributeValueQuotedAfter(code2) { if (code2 === codes.slash || code2 === codes.greaterThan || markdownSpace(code2)) { return completeAttributeNameBefore(code2); } return nok(code2); } function completeEnd(code2) { if (code2 === codes.greaterThan) { effects.consume(code2); return completeAfter; } return nok(code2); } function completeAfter(code2) { if (code2 === codes.eof || markdownLineEnding(code2)) { return continuation(code2); } if (markdownSpace(code2)) { effects.consume(code2); return completeAfter; } return nok(code2); } function continuation(code2) { if (code2 === codes.dash && marker === constants.htmlComment) { effects.consume(code2); return continuationCommentInside; } if (code2 === codes.lessThan && marker === constants.htmlRaw) { effects.consume(code2); return continuationRawTagOpen; } if (code2 === codes.greaterThan && marker === constants.htmlDeclaration) { effects.consume(code2); return continuationClose; } if (code2 === codes.questionMark && marker === constants.htmlInstruction) { effects.consume(code2); return continuationDeclarationInside; } if (code2 === codes.rightSquareBracket && marker === constants.htmlCdata) { effects.consume(code2); return continuationCdataInside; } if (markdownLineEnding(code2) && (marker === constants.htmlBasic || marker === constants.htmlComplete)) { effects.exit(types.htmlFlowData); return effects.check( blankLineBefore, continuationAfter, continuationStart )(code2); } if (code2 === codes.eof || markdownLineEnding(code2)) { effects.exit(types.htmlFlowData); return continuationStart(code2); } effects.consume(code2); return continuation; } function continuationStart(code2) { return effects.check( nonLazyContinuationStart, continuationStartNonLazy, continuationAfter )(code2); } function continuationStartNonLazy(code2) { ok(markdownLineEnding(code2)); effects.enter(types.lineEnding); effects.consume(code2); effects.exit(types.lineEnding); return continuationBefore; } function continuationBefore(code2) { if (code2 === codes.eof || markdownLineEnding(code2)) { return continuationStart(code2); } effects.enter(types.htmlFlowData); return continuation(code2); } function continuationCommentInside(code2) { if (code2 === codes.dash) { effects.consume(code2); return continuationDeclarationInside; } return continuation(code2); } function continuationRawTagOpen(code2) { if (code2 === codes.slash) { effects.consume(code2); buffer = ""; return continuationRawEndTag; } return continuation(code2); } function continuationRawEndTag(code2) { if (code2 === codes.greaterThan) { const name2 = buffer.toLowerCase(); if (htmlRawNames.includes(name2)) { effects.consume(code2); return continuationClose; } return continuation(code2); } if (asciiAlpha(code2) && buffer.length < constants.htmlRawSizeMax) { ok(code2 !== null); effects.consume(code2); buffer += String.fromCharCode(code2); return continuationRawEndTag; } return continuation(code2); } function continuationCdataInside(code2) { if (code2 === codes.rightSquareBracket) { effects.consume(code2); return continuationDeclarationInside; } return continuation(code2); } function continuationDeclarationInside(code2) { if (code2 === codes.greaterThan) { effects.consume(code2); return continuationClose; } if (code2 === codes.dash && marker === constants.htmlComment) { effects.consume(code2); return continuationDeclarationInside; } return continuation(code2); } function continuationClose(code2) { if (code2 === codes.eof || markdownLineEnding(code2)) { effects.exit(types.htmlFlowData); return continuationAfter(code2); } effects.consume(code2); return continuationClose; } function continuationAfter(code2) { effects.exit(types.htmlFlow); return ok3(code2); } } function tokenizeNonLazyContinuationStart(effects, ok3, nok) { const self2 = this; return start2; function start2(code2) { if (markdownLineEnding(code2)) { effects.enter(types.lineEnding); effects.consume(code2); effects.exit(types.lineEnding); return after; } return nok(code2); } function after(code2) { return self2.parser.lazy[self2.now().line] ? nok(code2) : ok3(code2); } } function tokenizeBlankLineBefore(effects, ok3, nok) { return start2; function start2(code2) { ok(markdownLineEnding(code2), "expected a line ending"); effects.enter(types.lineEnding); effects.consume(code2); effects.exit(types.lineEnding); return effects.attempt(blankLine, ok3, nok); } } // node_modules/micromark-core-commonmark/dev/lib/html-text.js var htmlText = { name: "htmlText", tokenize: tokenizeHtmlText }; function tokenizeHtmlText(effects, ok3, nok) { const self2 = this; let marker; let index2; let returnState; return start2; function start2(code2) { ok(code2 === codes.lessThan, "expected `<`"); effects.enter(types.htmlText); effects.enter(types.htmlTextData); effects.consume(code2); return open; } function open(code2) { if (code2 === codes.exclamationMark) { effects.consume(code2); return declarationOpen; } if (code2 === codes.slash) { effects.consume(code2); return tagCloseStart; } if (code2 === codes.questionMark) { effects.consume(code2); return instruction; } if (asciiAlpha(code2)) { effects.consume(code2); return tagOpen; } return nok(code2); } function declarationOpen(code2) { if (code2 === codes.dash) { effects.consume(code2); return commentOpenInside; } if (code2 === codes.leftSquareBracket) { effects.consume(code2); index2 = 0; return cdataOpenInside; } if (asciiAlpha(code2)) { effects.consume(code2); return declaration; } return nok(code2); } function commentOpenInside(code2) { if (code2 === codes.dash) { effects.consume(code2); return commentEnd; } return nok(code2); } function comment(code2) { if (code2 === codes.eof) { return nok(code2); } if (code2 === codes.dash) { effects.consume(code2); return commentClose; } if (markdownLineEnding(code2)) { returnState = comment; return lineEndingBefore(code2); } effects.consume(code2); return comment; } function commentClose(code2) { if (code2 === codes.dash) { effects.consume(code2); return commentEnd; } return comment(code2); } function commentEnd(code2) { return code2 === codes.greaterThan ? end(code2) : code2 === codes.dash ? commentClose(code2) : comment(code2); } function cdataOpenInside(code2) { const value = constants.cdataOpeningString; if (code2 === value.charCodeAt(index2++)) { effects.consume(code2); return index2 === value.length ? cdata : cdataOpenInside; } return nok(code2); } function cdata(code2) { if (code2 === codes.eof) { return nok(code2); } if (code2 === codes.rightSquareBracket) { effects.consume(code2); return cdataClose; } if (markdownLineEnding(code2)) { returnState = cdata; return lineEndingBefore(code2); } effects.consume(code2); return cdata; } function cdataClose(code2) { if (code2 === codes.rightSquareBracket) { effects.consume(code2); return cdataEnd; } return cdata(code2); } function cdataEnd(code2) { if (code2 === codes.greaterThan) { return end(code2); } if (code2 === codes.rightSquareBracket) { effects.consume(code2); return cdataEnd; } return cdata(code2); } function declaration(code2) { if (code2 === codes.eof || code2 === codes.greaterThan) { return end(code2); } if (markdownLineEnding(code2)) { returnState = declaration; return lineEndingBefore(code2); } effects.consume(code2); return declaration; } function instruction(code2) { if (code2 === codes.eof) { return nok(code2); } if (code2 === codes.questionMark) { effects.consume(code2); return instructionClose; } if (markdownLineEnding(code2)) { returnState = instruction; return lineEndingBefore(code2); } effects.consume(code2); return instruction; } function instructionClose(code2) { return code2 === codes.greaterThan ? end(code2) : instruction(code2); } function tagCloseStart(code2) { if (asciiAlpha(code2)) { effects.consume(code2); return tagClose; } return nok(code2); } function tagClose(code2) { if (code2 === codes.dash || asciiAlphanumeric(code2)) { effects.consume(code2); return tagClose; } return tagCloseBetween(code2); } function tagCloseBetween(code2) { if (markdownLineEnding(code2)) { returnState = tagCloseBetween; return lineEndingBefore(code2); } if (markdownSpace(code2)) { effects.consume(code2); return tagCloseBetween; } return end(code2); } function tagOpen(code2) { if (code2 === codes.dash || asciiAlphanumeric(code2)) { effects.consume(code2); return tagOpen; } if (code2 === codes.slash || code2 === codes.greaterThan || markdownLineEndingOrSpace(code2)) { return tagOpenBetween(code2); } return nok(code2); } function tagOpenBetween(code2) { if (code2 === codes.slash) { effects.consume(code2); return end; } if (code2 === codes.colon || code2 === codes.underscore || asciiAlpha(code2)) { effects.consume(code2); return tagOpenAttributeName; } if (markdownLineEnding(code2)) { returnState = tagOpenBetween; return lineEndingBefore(code2); } if (markdownSpace(code2)) { effects.consume(code2); return tagOpenBetween; } return end(code2); } function tagOpenAttributeName(code2) { if (code2 === codes.dash || code2 === codes.dot || code2 === codes.colon || code2 === codes.underscore || asciiAlphanumeric(code2)) { effects.consume(code2); return tagOpenAttributeName; } return tagOpenAttributeNameAfter(code2); } function tagOpenAttributeNameAfter(code2) { if (code2 === codes.equalsTo) { effects.consume(code2); return tagOpenAttributeValueBefore; } if (markdownLineEnding(code2)) { returnState = tagOpenAttributeNameAfter; return lineEndingBefore(code2); } if (markdownSpace(code2)) { effects.consume(code2); return tagOpenAttributeNameAfter; } return tagOpenBetween(code2); } function tagOpenAttributeValueBefore(code2) { if (code2 === codes.eof || code2 === codes.lessThan || code2 === codes.equalsTo || code2 === codes.greaterThan || code2 === codes.graveAccent) { return nok(code2); } if (code2 === codes.quotationMark || code2 === codes.apostrophe) { effects.consume(code2); marker = code2; return tagOpenAttributeValueQuoted; } if (markdownLineEnding(code2)) { returnState = tagOpenAttributeValueBefore; return lineEndingBefore(code2); } if (markdownSpace(code2)) { effects.consume(code2); return tagOpenAttributeValueBefore; } effects.consume(code2); return tagOpenAttributeValueUnquoted; } function tagOpenAttributeValueQuoted(code2) { if (code2 === marker) { effects.consume(code2); marker = void 0; return tagOpenAttributeValueQuotedAfter; } if (code2 === codes.eof) { return nok(code2); } if (markdownLineEnding(code2)) { returnState = tagOpenAttributeValueQuoted; return lineEndingBefore(code2); } effects.consume(code2); return tagOpenAttributeValueQuoted; } function tagOpenAttributeValueUnquoted(code2) { if (code2 === codes.eof || code2 === codes.quotationMark || code2 === codes.apostrophe || code2 === codes.lessThan || code2 === codes.equalsTo || code2 === codes.graveAccent) { return nok(code2); } if (code2 === codes.slash || code2 === codes.greaterThan || markdownLineEndingOrSpace(code2)) { return tagOpenBetween(code2); } effects.consume(code2); return tagOpenAttributeValueUnquoted; } function tagOpenAttributeValueQuotedAfter(code2) { if (code2 === codes.slash || code2 === codes.greaterThan || markdownLineEndingOrSpace(code2)) { return tagOpenBetween(code2); } return nok(code2); } function end(code2) { if (code2 === codes.greaterThan) { effects.consume(code2); effects.exit(types.htmlTextData); effects.exit(types.htmlText); return ok3; } return nok(code2); } function lineEndingBefore(code2) { ok(returnState, "expected return state"); ok(markdownLineEnding(code2), "expected eol"); effects.exit(types.htmlTextData); effects.enter(types.lineEnding); effects.consume(code2); effects.exit(types.lineEnding); return lineEndingAfter; } function lineEndingAfter(code2) { ok( self2.parser.constructs.disable.null, "expected `disable.null` to be populated" ); return markdownSpace(code2) ? factorySpace( effects, lineEndingAfterPrefix, types.linePrefix, self2.parser.constructs.disable.null.includes("codeIndented") ? void 0 : constants.tabSize )(code2) : lineEndingAfterPrefix(code2); } function lineEndingAfterPrefix(code2) { effects.enter(types.htmlTextData); return returnState(code2); } } // node_modules/micromark-core-commonmark/dev/lib/label-end.js var labelEnd = { name: "labelEnd", resolveAll: resolveAllLabelEnd, resolveTo: resolveToLabelEnd, tokenize: tokenizeLabelEnd }; var resourceConstruct = { tokenize: tokenizeResource }; var referenceFullConstruct = { tokenize: tokenizeReferenceFull }; var referenceCollapsedConstruct = { tokenize: tokenizeReferenceCollapsed }; function resolveAllLabelEnd(events) { let index2 = -1; const newEvents = []; while (++index2 < events.length) { const token = events[index2][1]; newEvents.push(events[index2]); if (token.type === types.labelImage || token.type === types.labelLink || token.type === types.labelEnd) { const offset = token.type === types.labelImage ? 4 : 2; token.type = types.data; index2 += offset; } } if (events.length !== newEvents.length) { splice(events, 0, events.length, newEvents); } return events; } function resolveToLabelEnd(events, context) { let index2 = events.length; let offset = 0; let token; let open; let close; let media; while (index2--) { token = events[index2][1]; if (open) { if (token.type === types.link || token.type === types.labelLink && token._inactive) { break; } if (events[index2][0] === "enter" && token.type === types.labelLink) { token._inactive = true; } } else if (close) { if (events[index2][0] === "enter" && (token.type === types.labelImage || token.type === types.labelLink) && !token._balanced) { open = index2; if (token.type !== types.labelLink) { offset = 2; break; } } } else if (token.type === types.labelEnd) { close = index2; } } ok(open !== void 0, "`open` is supposed to be found"); ok(close !== void 0, "`close` is supposed to be found"); const group = { type: events[open][1].type === types.labelLink ? types.link : types.image, start: { ...events[open][1].start }, end: { ...events[events.length - 1][1].end } }; const label = { type: types.label, start: { ...events[open][1].start }, end: { ...events[close][1].end } }; const text5 = { type: types.labelText, start: { ...events[open + offset + 2][1].end }, end: { ...events[close - 2][1].start } }; media = [ ["enter", group, context], ["enter", label, context] ]; media = push(media, events.slice(open + 1, open + offset + 3)); media = push(media, [["enter", text5, context]]); ok( context.parser.constructs.insideSpan.null, "expected `insideSpan.null` to be populated" ); media = push( media, resolveAll( context.parser.constructs.insideSpan.null, events.slice(open + offset + 4, close - 3), context ) ); media = push(media, [ ["exit", text5, context], events[close - 2], events[close - 1], ["exit", label, context] ]); media = push(media, events.slice(close + 1)); media = push(media, [["exit", group, context]]); splice(events, open, events.length, media); return events; } function tokenizeLabelEnd(effects, ok3, nok) { const self2 = this; let index2 = self2.events.length; let labelStart; let defined; while (index2--) { if ((self2.events[index2][1].type === types.labelImage || self2.events[index2][1].type === types.labelLink) && !self2.events[index2][1]._balanced) { labelStart = self2.events[index2][1]; break; } } return start2; function start2(code2) { ok(code2 === codes.rightSquareBracket, "expected `]`"); if (!labelStart) { return nok(code2); } if (labelStart._inactive) { return labelEndNok(code2); } defined = self2.parser.defined.includes( normalizeIdentifier( self2.sliceSerialize({ start: labelStart.end, end: self2.now() }) ) ); effects.enter(types.labelEnd); effects.enter(types.labelMarker); effects.consume(code2); effects.exit(types.labelMarker); effects.exit(types.labelEnd); return after; } function after(code2) { if (code2 === codes.leftParenthesis) { return effects.attempt( resourceConstruct, labelEndOk, defined ? labelEndOk : labelEndNok )(code2); } if (code2 === codes.leftSquareBracket) { return effects.attempt( referenceFullConstruct, labelEndOk, defined ? referenceNotFull : labelEndNok )(code2); } return defined ? labelEndOk(code2) : labelEndNok(code2); }