@depup/markdown-it 15.0.2-depup.9 → 15.0.3-depup.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"markdown-it.cjs.js","names":[],"sources":["../node_modules/entities/dist/decode-codepoint.js","../node_modules/entities/dist/internal/decode-shared.js","../node_modules/entities/dist/generated/decode-data-html.js","../node_modules/entities/dist/internal/bin-trie-flags.js","../node_modules/entities/dist/decode.js","../src/common/utils.ts","../src/helpers/parse_link_label.ts","../src/helpers/parse_link_destination.ts","../src/helpers/parse_link_title.ts","../src/helpers/index.ts","../src/token.ts","../src/ruler.ts","../src/renderer.ts","../src/rules_core/state_core.ts","../src/rules_core/normalize.ts","../src/rules_core/block.ts","../src/rules_core/strip_references.ts","../src/rules_core/inline.ts","../src/rules_core/linkify.ts","../src/rules_core/replacements.ts","../src/rules_core/smartquotes.ts","../src/rules_core/text_join.ts","../src/parser_core.ts","../src/rules_block/state_block.ts","../src/rules_block/table.ts","../src/rules_block/code.ts","../src/rules_block/fence.ts","../src/rules_block/blockquote.ts","../src/rules_block/hr.ts","../src/rules_block/list.ts","../src/rules_block/reference.ts","../src/common/html_blocks.ts","../src/common/html_re.ts","../src/rules_block/html_block.ts","../src/rules_block/heading.ts","../src/rules_block/lheading.ts","../src/rules_block/paragraph.ts","../src/parser_block.ts","../src/rules_inline/state_inline.ts","../src/rules_inline/text.ts","../src/rules_inline/linkify.ts","../src/rules_inline/newline.ts","../src/rules_inline/escape.ts","../src/rules_inline/backticks.ts","../src/rules_inline/strikethrough.ts","../src/rules_inline/emphasis.ts","../src/rules_inline/link.ts","../src/rules_inline/image.ts","../src/rules_inline/autolink.ts","../src/rules_inline/html_inline.ts","../src/rules_inline/entity.ts","../src/rules_inline/balance_pairs.ts","../src/rules_inline/fragments_join.ts","../src/parser_inline.ts","../src/presets/default.ts","../src/presets/zero.ts","../src/presets/commonmark.ts","../src/markdownit.ts","../src/index.ts"],"sourcesContent":["// Adapted from https://github.com/mathiasbynens/he/blob/36afe179392226cf1b6ccdb16ebbb7a5a844d93a/src/he.js#L106-L134\nconst decodeMap = new Map([\n [0, 65_533],\n // C1 Unicode control character reference replacements\n [128, 8364],\n [130, 8218],\n [131, 402],\n [132, 8222],\n [133, 8230],\n [134, 8224],\n [135, 8225],\n [136, 710],\n [137, 8240],\n [138, 352],\n [139, 8249],\n [140, 338],\n [142, 381],\n [145, 8216],\n [146, 8217],\n [147, 8220],\n [148, 8221],\n [149, 8226],\n [150, 8211],\n [151, 8212],\n [152, 732],\n [153, 8482],\n [154, 353],\n [155, 8250],\n [156, 339],\n [158, 382],\n [159, 376],\n]);\n/**\n * Replace the given code point with a replacement character if it is a\n * surrogate or is outside the valid range. Otherwise return the code\n * point unchanged.\n * @param codePoint Unicode code point to convert.\n */\nexport function replaceCodePoint(codePoint) {\n if ((codePoint >= 0xd8_00 && codePoint <= 0xdf_ff) ||\n codePoint > 0x10_ff_ff) {\n return 0xff_fd;\n }\n return decodeMap.get(codePoint) ?? codePoint;\n}\n//# sourceMappingURL=decode-codepoint.js.map","/**\n * Shared base64 decode helper for generated decode data.\n * Assumes global atob is available.\n * @param input Input string to encode or decode.\n */\nexport function decodeBase64(input) {\n const binary = atob(input);\n const evenLength = binary.length & ~1; // Round down to even length\n const out = new Uint16Array(evenLength / 2);\n for (let index = 0, outIndex = 0; index < evenLength; index += 2) {\n const lo = binary.charCodeAt(index);\n const hi = binary.charCodeAt(index + 1);\n out[outIndex++] = lo | (hi << 8);\n }\n return out;\n}\n//# sourceMappingURL=decode-shared.js.map","// Generated using scripts/write-decode-map.ts\nimport { decodeBase64 } from \"../internal/decode-shared.js\";\n/** Packed HTML decode trie data. */\nexport const htmlDecodeTree = /* #__PURE__ */ decodeBase64(\"QR08ALkAAgH6AYsDNQR2BO0EPgXZBQEGLAbdBxMISQrvCmQLfQurDKQNLw4fD4YPpA+6D/IPAAAAAAAAAAAAAAAAKhBMEY8TmxUW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XJwAKAYIXIAAOA12DTdcABmAADgNdho3WWgQCJhAHQA6ABqD2MAcgAA4DXYzNzjCuQRUC4AAFQuAABYLmIuAAAAAGMubS5wLnQuAAAAAIguki4AAJouJxIqEnQAcgDpAB0ScgAA4DXYNd0AAUFhWy5eLnIA8gDnAnIA8gCTB75jAAFBYWYuaS5yAPIA4AJyAPIAjAdhAPAAeh5pAHMAAKD7IoABZHB0APgReS6DLgABZmx9LoAuAOA12GnddQDzAP8RaQBtAOUABBIAAUFhiy6OLnIA8gDuAnIA8gCaBwABY3GVLgoScgAA4DXYzdwAAXB0nS6hLmwAdQDzACUScgDpACASAARhY2VmaW9zdbEuvC7ELsguzC7PLtQu2S5jAAABdXm2LrsudABlADuA/QD9QE9kAAFpecAuwy5yAGMAd2FLZG4AO4ClAKVAcgAA4DXYNt1jAHkAV2RwAGYAAOA12GrdYwByAADgNdjO3AABY23dLt8ueQBOZGwAO4D/AP9AAAVhY2RlZmhpb3N38y73Lv8uAi8MLxAvEy8YLx0vIi9jInV0ZQB6YQABYXn7Lv4u8iFvbn5hN2RvAHQAfGEAAWV0Bi8KL3QAcgDmAB8QYQC2Y3IAAOA12DfdYwB5ADZk5yJyYXJyAKDdIXAAZgAA4DXYa91jAHIAAOA12M/cAAFqbiYvKC8AoA0gagAAoAwg\");\n//# sourceMappingURL=decode-data-html.js.map","/**\n * Bit flags & masks for the binary trie encoding used for entity decoding.\n *\n * Bit layout (16 bits total):\n * 15..14 VALUE_LENGTH (+1 encoding; 0 => no value)\n * 13 FLAG13. If valueLength>0: semicolon required flag (implicit ';').\n * If valueLength==0: compact run flag.\n * 12..7 BRANCH_LENGTH Branch length (0 => single branch in 6..0 if jumpOffset==char) OR run length (when compact run)\n * 6..0 JUMP_TABLE Jump offset (jump table) OR single-branch char code OR first run char\n */\nexport var BinTrieFlags;\n(function (BinTrieFlags) {\n BinTrieFlags[BinTrieFlags[\"VALUE_LENGTH\"] = 49152] = \"VALUE_LENGTH\";\n BinTrieFlags[BinTrieFlags[\"FLAG13\"] = 8192] = \"FLAG13\";\n BinTrieFlags[BinTrieFlags[\"BRANCH_LENGTH\"] = 8064] = \"BRANCH_LENGTH\";\n BinTrieFlags[BinTrieFlags[\"JUMP_TABLE\"] = 127] = \"JUMP_TABLE\";\n})(BinTrieFlags || (BinTrieFlags = {}));\n//# sourceMappingURL=bin-trie-flags.js.map","import { replaceCodePoint } from \"./decode-codepoint.js\";\nimport { htmlDecodeTree } from \"./generated/decode-data-html.js\";\nimport { xmlDecodeTree } from \"./generated/decode-data-xml.js\";\nimport { BinTrieFlags } from \"./internal/bin-trie-flags.js\";\nvar CharCodes;\n(function (CharCodes) {\n CharCodes[CharCodes[\"NUM\"] = 35] = \"NUM\";\n CharCodes[CharCodes[\"SEMI\"] = 59] = \"SEMI\";\n CharCodes[CharCodes[\"EQUALS\"] = 61] = \"EQUALS\";\n CharCodes[CharCodes[\"ZERO\"] = 48] = \"ZERO\";\n CharCodes[CharCodes[\"NINE\"] = 57] = \"NINE\";\n CharCodes[CharCodes[\"LOWER_A\"] = 97] = \"LOWER_A\";\n CharCodes[CharCodes[\"LOWER_F\"] = 102] = \"LOWER_F\";\n CharCodes[CharCodes[\"LOWER_X\"] = 120] = \"LOWER_X\";\n CharCodes[CharCodes[\"LOWER_Z\"] = 122] = \"LOWER_Z\";\n CharCodes[CharCodes[\"UPPER_A\"] = 65] = \"UPPER_A\";\n CharCodes[CharCodes[\"UPPER_F\"] = 70] = \"UPPER_F\";\n CharCodes[CharCodes[\"UPPER_Z\"] = 90] = \"UPPER_Z\";\n})(CharCodes || (CharCodes = {}));\n/** Bit that needs to be set to convert an upper case ASCII character to lower case */\nconst TO_LOWER_BIT = 0b10_0000;\nfunction isNumber(code) {\n return code >= CharCodes.ZERO && code <= CharCodes.NINE;\n}\nfunction isHexadecimalCharacter(code) {\n return ((code >= CharCodes.UPPER_A && code <= CharCodes.UPPER_F) ||\n (code >= CharCodes.LOWER_A && code <= CharCodes.LOWER_F));\n}\nfunction isAsciiAlphaNumeric(code) {\n return ((code >= CharCodes.UPPER_A && code <= CharCodes.UPPER_Z) ||\n (code >= CharCodes.LOWER_A && code <= CharCodes.LOWER_Z) ||\n isNumber(code));\n}\n/**\n * Checks if the given character is a valid end character for an entity in an attribute.\n *\n * Attribute values that aren't terminated properly aren't parsed, and shouldn't lead to a parser error.\n * See the example in https://html.spec.whatwg.org/multipage/parsing.html#named-character-reference-state\n * @param code Code point to decode.\n */\nfunction isEntityInAttributeInvalidEnd(code) {\n return code === CharCodes.EQUALS || isAsciiAlphaNumeric(code);\n}\nvar EntityDecoderState;\n(function (EntityDecoderState) {\n EntityDecoderState[EntityDecoderState[\"EntityStart\"] = 0] = \"EntityStart\";\n EntityDecoderState[EntityDecoderState[\"NumericStart\"] = 1] = \"NumericStart\";\n EntityDecoderState[EntityDecoderState[\"NumericDecimal\"] = 2] = \"NumericDecimal\";\n EntityDecoderState[EntityDecoderState[\"NumericHex\"] = 3] = \"NumericHex\";\n EntityDecoderState[EntityDecoderState[\"NamedEntity\"] = 4] = \"NamedEntity\";\n})(EntityDecoderState || (EntityDecoderState = {}));\n/**\n * Decoding mode for named entities.\n */\nexport var DecodingMode;\n(function (DecodingMode) {\n /** Entities in text nodes that can end with any character. */\n DecodingMode[DecodingMode[\"Legacy\"] = 0] = \"Legacy\";\n /** Only allow entities terminated with a semicolon. */\n DecodingMode[DecodingMode[\"Strict\"] = 1] = \"Strict\";\n /** Entities in attributes have limitations on ending characters. */\n DecodingMode[DecodingMode[\"Attribute\"] = 2] = \"Attribute\";\n})(DecodingMode || (DecodingMode = {}));\n/**\n * Token decoder with support of writing partial entities.\n */\nexport class EntityDecoder {\n decodeTree;\n emitCodePoint;\n errors;\n constructor(\n /** The tree used to decode entities. */\n // biome-ignore lint/correctness/noUnusedPrivateClassMembers: False positive\n decodeTree, \n /**\n * The function that is called when a codepoint is decoded.\n *\n * For multi-byte named entities, this will be called multiple times,\n * with the second codepoint, and the same `consumed` value.\n * @param codepoint The decoded codepoint.\n * @param consumed The number of bytes consumed by the decoder.\n */\n emitCodePoint, \n /** An object that is used to produce errors. */\n errors) {\n this.decodeTree = decodeTree;\n this.emitCodePoint = emitCodePoint;\n this.errors = errors;\n }\n /** The current state of the decoder. */\n state = EntityDecoderState.EntityStart;\n /** Characters that were consumed while parsing an entity. */\n consumed = 1;\n /**\n * The result of the entity.\n *\n * Either the result index of a numeric entity, or the codepoint of a\n * numeric entity.\n */\n result = 0;\n /** The current index in the decode tree. */\n treeIndex = 0;\n /** The number of characters that were consumed in excess. */\n excess = 1;\n /** The mode in which the decoder is operating. */\n decodeMode = DecodingMode.Strict;\n /** The number of characters that have been consumed in the current run. */\n runConsumed = 0;\n /**\n * Resets the instance to make it reusable.\n * @param decodeMode Entity decoding mode to use.\n */\n startEntity(decodeMode) {\n this.decodeMode = decodeMode;\n this.state = EntityDecoderState.EntityStart;\n this.result = 0;\n this.treeIndex = 0;\n this.excess = 1;\n this.consumed = 1;\n this.runConsumed = 0;\n }\n /**\n * Write an entity to the decoder. This can be called multiple times with partial entities.\n * If the entity is incomplete, the decoder will return -1.\n *\n * Mirrors the implementation of `getDecoder`, but with the ability to stop decoding if the\n * entity is incomplete, and resume when the next string is written.\n * @param input The string containing the entity (or a continuation of the entity).\n * @param offset The offset at which the entity begins. Should be 0 if this is not the first call.\n * @returns The number of characters that were consumed, or -1 if the entity is incomplete.\n */\n write(input, offset) {\n switch (this.state) {\n case EntityDecoderState.EntityStart: {\n if (input.charCodeAt(offset) === CharCodes.NUM) {\n this.state = EntityDecoderState.NumericStart;\n this.consumed += 1;\n return this.stateNumericStart(input, offset + 1);\n }\n this.state = EntityDecoderState.NamedEntity;\n return this.stateNamedEntity(input, offset);\n }\n case EntityDecoderState.NumericStart: {\n return this.stateNumericStart(input, offset);\n }\n case EntityDecoderState.NumericDecimal: {\n return this.stateNumericDecimal(input, offset);\n }\n case EntityDecoderState.NumericHex: {\n return this.stateNumericHex(input, offset);\n }\n case EntityDecoderState.NamedEntity: {\n return this.stateNamedEntity(input, offset);\n }\n }\n }\n /**\n * Switches between the numeric decimal and hexadecimal states.\n *\n * Equivalent to the `Numeric character reference state` in the HTML spec.\n * @param input The string containing the entity (or a continuation of the entity).\n * @param offset The current offset.\n * @returns The number of characters that were consumed, or -1 if the entity is incomplete.\n */\n stateNumericStart(input, offset) {\n if (offset >= input.length) {\n return -1;\n }\n if ((input.charCodeAt(offset) | TO_LOWER_BIT) === CharCodes.LOWER_X) {\n this.state = EntityDecoderState.NumericHex;\n this.consumed += 1;\n return this.stateNumericHex(input, offset + 1);\n }\n this.state = EntityDecoderState.NumericDecimal;\n return this.stateNumericDecimal(input, offset);\n }\n /**\n * Parses a hexadecimal numeric entity.\n *\n * Equivalent to the `Hexademical character reference state` in the HTML spec.\n * @param input The string containing the entity (or a continuation of the entity).\n * @param offset The current offset.\n * @returns The number of characters that were consumed, or -1 if the entity is incomplete.\n */\n stateNumericHex(input, offset) {\n while (offset < input.length) {\n const char = input.charCodeAt(offset);\n if (isNumber(char) || isHexadecimalCharacter(char)) {\n // Convert hex digit to value (0-15); 'a'/'A' -> 10.\n const digit = char <= CharCodes.NINE\n ? char - CharCodes.ZERO\n : (char | TO_LOWER_BIT) - CharCodes.LOWER_A + 10;\n this.result = this.result * 16 + digit;\n this.consumed++;\n offset++;\n }\n else {\n return this.emitNumericEntity(char, 3);\n }\n }\n return -1; // Incomplete entity\n }\n /**\n * Parses a decimal numeric entity.\n *\n * Equivalent to the `Decimal character reference state` in the HTML spec.\n * @param input The string containing the entity (or a continuation of the entity).\n * @param offset The current offset.\n * @returns The number of characters that were consumed, or -1 if the entity is incomplete.\n */\n stateNumericDecimal(input, offset) {\n while (offset < input.length) {\n const char = input.charCodeAt(offset);\n if (isNumber(char)) {\n this.result = this.result * 10 + (char - CharCodes.ZERO);\n this.consumed++;\n offset++;\n }\n else {\n return this.emitNumericEntity(char, 2);\n }\n }\n return -1; // Incomplete entity\n }\n /**\n * Validate and emit a numeric entity.\n *\n * Implements the logic from the `Hexademical character reference start\n * state` and `Numeric character reference end state` in the HTML spec.\n * @param lastCp The last code point of the entity. Used to see if the\n * entity was terminated with a semicolon.\n * @param expectedLength The minimum number of characters that should be\n * consumed. Used to validate that at least one digit\n * was consumed.\n * @returns The number of characters that were consumed.\n */\n emitNumericEntity(lastCp, expectedLength) {\n // Ensure we consumed at least one digit.\n if (this.consumed <= expectedLength) {\n this.errors?.absenceOfDigitsInNumericCharacterReference(this.consumed);\n return 0;\n }\n // Figure out if this is a legit end of the entity\n if (lastCp === CharCodes.SEMI) {\n this.consumed += 1;\n }\n else if (this.decodeMode === DecodingMode.Strict) {\n return 0;\n }\n this.emitCodePoint(replaceCodePoint(this.result), this.consumed);\n if (this.errors) {\n if (lastCp !== CharCodes.SEMI) {\n this.errors.missingSemicolonAfterCharacterReference();\n }\n this.errors.validateNumericCharacterReference(this.result);\n }\n return this.consumed;\n }\n /**\n * Parses a named entity.\n *\n * Equivalent to the `Named character reference state` in the HTML spec.\n * @param input The string containing the entity (or a continuation of the entity).\n * @param offset The current offset.\n * @returns The number of characters that were consumed, or -1 if the entity is incomplete.\n */\n stateNamedEntity(input, offset) {\n const { decodeTree } = this;\n let current = decodeTree[this.treeIndex];\n // The length is the number of bytes of the value, including the current byte.\n let valueLength = (current & BinTrieFlags.VALUE_LENGTH) >> 14;\n while (offset < input.length) {\n // Handle compact runs (possibly inline): valueLength == 0 and SEMI_REQUIRED bit set.\n if (valueLength === 0 && (current & BinTrieFlags.FLAG13) !== 0) {\n const runLength = (current & BinTrieFlags.BRANCH_LENGTH) >> 7; /* 2..63 */\n // If we are starting a run, check the first char.\n if (this.runConsumed === 0) {\n const firstChar = current & BinTrieFlags.JUMP_TABLE;\n if (input.charCodeAt(offset) !== firstChar) {\n return this.result === 0\n ? 0\n : this.emitNotTerminatedNamedEntity();\n }\n offset++;\n this.excess++;\n this.runConsumed++;\n }\n // Check remaining characters in the run.\n while (this.runConsumed < runLength) {\n if (offset >= input.length) {\n return -1;\n }\n const charIndexInPacked = this.runConsumed - 1;\n const packedWord = decodeTree[this.treeIndex + 1 + (charIndexInPacked >> 1)];\n const expectedChar = charIndexInPacked % 2 === 0\n ? packedWord & 0xff\n : (packedWord >> 8) & 0xff;\n if (input.charCodeAt(offset) !== expectedChar) {\n this.runConsumed = 0;\n return this.result === 0\n ? 0\n : this.emitNotTerminatedNamedEntity();\n }\n offset++;\n this.excess++;\n this.runConsumed++;\n }\n this.runConsumed = 0;\n this.treeIndex += 1 + (runLength >> 1);\n current = decodeTree[this.treeIndex];\n valueLength = (current & BinTrieFlags.VALUE_LENGTH) >> 14;\n }\n if (offset >= input.length)\n break;\n const char = input.charCodeAt(offset);\n /*\n * Implicit semicolon handling for nodes that require a semicolon but\n * don't have an explicit ';' branch stored in the trie. If we have\n * a value on the current node, it requires a semicolon, and the\n * current input character is a semicolon, emit the entity using the\n * current node (without descending further).\n */\n if (char === CharCodes.SEMI &&\n valueLength !== 0 &&\n (current & BinTrieFlags.FLAG13) !== 0) {\n return this.emitNamedEntityData(this.treeIndex, valueLength, this.consumed + this.excess);\n }\n this.treeIndex = determineBranch(decodeTree, current, this.treeIndex + Math.max(1, valueLength), char);\n if (this.treeIndex < 0) {\n return this.result === 0 ||\n // If we are parsing an attribute\n (this.decodeMode === DecodingMode.Attribute &&\n // We shouldn't have consumed any characters after the entity,\n (valueLength === 0 ||\n // And there should be no invalid characters.\n isEntityInAttributeInvalidEnd(char)))\n ? 0\n : this.emitNotTerminatedNamedEntity();\n }\n current = decodeTree[this.treeIndex];\n valueLength = (current & BinTrieFlags.VALUE_LENGTH) >> 14;\n // If the branch is a value, store it and continue\n if (valueLength !== 0) {\n // If the entity is terminated by a semicolon, we are done.\n if (char === CharCodes.SEMI) {\n return this.emitNamedEntityData(this.treeIndex, valueLength, this.consumed + this.excess);\n }\n // If we encounter a non-terminated (legacy) entity while parsing strictly, then ignore it.\n if (this.decodeMode !== DecodingMode.Strict &&\n (current & BinTrieFlags.FLAG13) === 0) {\n this.result = this.treeIndex;\n this.consumed += this.excess;\n this.excess = 0;\n }\n }\n // Increment offset & excess for next iteration\n offset++;\n this.excess++;\n }\n return -1;\n }\n /**\n * Emit a named entity that was not terminated with a semicolon.\n * @returns The number of characters consumed.\n */\n emitNotTerminatedNamedEntity() {\n const { result, decodeTree } = this;\n const valueLength = (decodeTree[result] & BinTrieFlags.VALUE_LENGTH) >> 14;\n this.emitNamedEntityData(result, valueLength, this.consumed);\n this.errors?.missingSemicolonAfterCharacterReference();\n return this.consumed;\n }\n /**\n * Emit a named entity.\n * @param result The index of the entity in the decode tree.\n * @param valueLength The number of bytes in the entity.\n * @param consumed The number of characters consumed.\n * @returns The number of characters consumed.\n */\n emitNamedEntityData(result, valueLength, consumed) {\n const { decodeTree } = this;\n this.emitCodePoint(valueLength === 1\n ? decodeTree[result] &\n ~(BinTrieFlags.VALUE_LENGTH | BinTrieFlags.FLAG13)\n : decodeTree[result + 1], consumed);\n if (valueLength === 3) {\n // For multi-byte values, we need to emit the second byte.\n this.emitCodePoint(decodeTree[result + 2], consumed);\n }\n return consumed;\n }\n /**\n * Signal to the parser that the end of the input was reached.\n *\n * Remaining data will be emitted and relevant errors will be produced.\n * @returns The number of characters consumed.\n */\n end() {\n switch (this.state) {\n case EntityDecoderState.NamedEntity: {\n // Emit a named entity if we have one.\n return this.result !== 0 &&\n (this.decodeMode !== DecodingMode.Attribute ||\n this.result === this.treeIndex)\n ? this.emitNotTerminatedNamedEntity()\n : 0;\n }\n // Otherwise, emit a numeric entity if we have one.\n case EntityDecoderState.NumericDecimal: {\n return this.emitNumericEntity(0, 2);\n }\n case EntityDecoderState.NumericHex: {\n return this.emitNumericEntity(0, 3);\n }\n case EntityDecoderState.NumericStart: {\n this.errors?.absenceOfDigitsInNumericCharacterReference(this.consumed);\n return 0;\n }\n case EntityDecoderState.EntityStart: {\n // Return 0 if we have no entity.\n return 0;\n }\n }\n }\n}\n/**\n * Creates a function that decodes entities in a string.\n * @param decodeTree The decode tree.\n * @returns A function that decodes entities in a string.\n */\nfunction getDecoder(decodeTree) {\n let returnValue = \"\";\n const decoder = new EntityDecoder(decodeTree, (data) => (returnValue += String.fromCodePoint(data)));\n return function decodeWithTrie(input, decodeMode) {\n let lastIndex = 0;\n let offset = 0;\n while ((offset = input.indexOf(\"&\", offset)) >= 0) {\n returnValue += input.slice(lastIndex, offset);\n decoder.startEntity(decodeMode);\n const length = decoder.write(input, \n // Skip the \"&\"\n offset + 1);\n if (length < 0) {\n lastIndex = offset + decoder.end();\n break;\n }\n lastIndex = offset + length;\n // If `length` is 0, skip the current `&` and continue.\n offset = length === 0 ? lastIndex + 1 : lastIndex;\n }\n const result = returnValue + input.slice(lastIndex);\n // Make sure we don't keep a reference to the final string.\n returnValue = \"\";\n return result;\n };\n}\n/**\n * Determines the branch of the current node that is taken given the current\n * character. This function is used to traverse the trie.\n * @param decodeTree The trie.\n * @param current The current node.\n * @param nodeIndex Index immediately after the current node header.\n * @param char The current character.\n * @returns The index of the next node, or -1 if no branch is taken.\n */\nexport function determineBranch(decodeTree, current, nodeIndex, char) {\n const branchCount = (current & BinTrieFlags.BRANCH_LENGTH) >> 7;\n const jumpOffset = current & BinTrieFlags.JUMP_TABLE;\n // Case 1: Single branch encoded in jump offset\n if (branchCount === 0) {\n return jumpOffset !== 0 && char === jumpOffset ? nodeIndex : -1;\n }\n // Case 2: Multiple branches encoded in jump table\n if (jumpOffset) {\n const value = char - jumpOffset;\n return value < 0 || value >= branchCount\n ? -1\n : decodeTree[nodeIndex + value] - 1;\n }\n // Case 3: Multiple branches encoded in packed dictionary (two keys per uint16)\n const packedKeySlots = (branchCount + 1) >> 1;\n /*\n * Treat packed keys as a virtual sorted array of length `branchCount`.\n * Key(i) = low byte for even i, high byte for odd i in slot i>>1.\n */\n let lo = 0;\n let hi = branchCount - 1;\n while (lo <= hi) {\n const mid = (lo + hi) >>> 1;\n const slot = mid >> 1;\n const packed = decodeTree[nodeIndex + slot];\n const midKey = (packed >> ((mid & 1) * 8)) & 0xff;\n if (midKey < char) {\n lo = mid + 1;\n }\n else if (midKey > char) {\n hi = mid - 1;\n }\n else {\n return decodeTree[nodeIndex + packedKeySlots + mid];\n }\n }\n return -1;\n}\nconst htmlDecoder = /* #__PURE__ */ getDecoder(htmlDecodeTree);\nconst xmlDecoder = /* #__PURE__ */ getDecoder(xmlDecodeTree);\n/**\n * Decodes an HTML string.\n * @param htmlString The string to decode.\n * @param mode The decoding mode.\n * @returns The decoded string.\n */\nexport function decodeHTML(htmlString, mode = DecodingMode.Legacy) {\n return htmlDecoder(htmlString, mode);\n}\n/**\n * Decodes an HTML string in an attribute.\n * @param htmlAttribute The string to decode.\n * @returns The decoded string.\n */\nexport function decodeHTMLAttribute(htmlAttribute) {\n return htmlDecoder(htmlAttribute, DecodingMode.Attribute);\n}\n/**\n * Decodes an HTML string, requiring all entities to be terminated by a semicolon.\n * @param htmlString The string to decode.\n * @returns The decoded string.\n */\nexport function decodeHTMLStrict(htmlString) {\n return htmlDecoder(htmlString, DecodingMode.Strict);\n}\n/**\n * Decodes an XML string, requiring all entities to be terminated by a semicolon.\n * @param xmlString The string to decode.\n * @returns The decoded string.\n */\nexport function decodeXML(xmlString) {\n return xmlDecoder(xmlString, DecodingMode.Strict);\n}\nexport { replaceCodePoint } from \"./decode-codepoint.js\";\n// Re-export for use by eg. htmlparser2\nexport { htmlDecodeTree } from \"./generated/decode-data-html.js\";\nexport { xmlDecodeTree } from \"./generated/decode-data-xml.js\";\n//# sourceMappingURL=decode.js.map","/**\n * Common utility functions exposed through `md.utils` for use by plugins.\n *\n * @module md.utils\n */\n\nimport * as mdurl from 'mdurl'\nimport * as ucmicro from 'uc.micro'\nimport { decodeHTMLStrict } from 'entities'\n\n/** @hidden */\ntype ClassToWrap = new (...args: any[]) => object\n\n/** Wraps a class so it can be called with or without `new`. */\nfunction callable<T extends ClassToWrap> (\n cls: T\n): T & ((...args: ConstructorParameters<T>) => InstanceType<T>)\nfunction callable<T extends ClassToWrap> (cls: T) {\n const wrapper = function (...args: ConstructorParameters<T>) {\n const newTarget =\n new.target && new.target !== wrapper\n ? new.target\n : cls\n\n return Reflect.construct(cls, args, newTarget)\n }\n\n Object.defineProperty(wrapper, 'name', { value: cls.name })\n Object.setPrototypeOf(wrapper, cls)\n wrapper.prototype = cls.prototype\n\n return wrapper\n}\n\n/**\n * Returns a copy of a token array with the token at `pos` replaced by\n * `newElements`. Used to transform token streams without modifying the\n * original array.\n */\nfunction arrayReplaceAt<T> (src: T[], pos: number, newElements: T[]): T[] {\n return ([] as T[]).concat(src.slice(0, pos), newElements, src.slice(pos + 1))\n}\n\n/** Checks whether a code point can be decoded from a numeric HTML entity. */\nfunction isValidEntityCode (c: number) {\n // broken sequence\n if (c >= 0xD800 && c <= 0xDFFF) { return false }\n // never used\n if (c >= 0xFDD0 && c <= 0xFDEF) { return false }\n if ((c & 0xFFFF) === 0xFFFF || (c & 0xFFFF) === 0xFFFE) { return false }\n // control codes\n if (c >= 0x00 && c <= 0x08) { return false }\n if (c === 0x0B) { return false }\n if (c >= 0x0E && c <= 0x1F) { return false }\n if (c >= 0x7F && c <= 0x9F) { return false }\n // out of range\n if (c > 0x10FFFF) { return false }\n return true\n}\n\n/**\n * Converts a Unicode code point to a string, like `String.fromCodePoint()`,\n * but does not throw for invalid input.\n */\nfunction fromCodePoint (c: number) {\n /* eslint no-bitwise:0 */\n if (c > 0xffff) {\n c -= 0x10000\n const surrogate1 = 0xd800 + (c >> 10)\n const surrogate2 = 0xdc00 + (c & 0x3ff)\n\n return String.fromCharCode(surrogate1, surrogate2)\n }\n return String.fromCharCode(c)\n}\n\nconst UNESCAPE_MD_RE = /\\\\([!\"#$%&'()*+,\\-./:;<=>?@[\\\\\\]^_`{|}~])/g\nconst ENTITY_RE = /&([a-z#][a-z0-9]{1,31});/gi\nconst UNESCAPE_ALL_RE = new RegExp(`${UNESCAPE_MD_RE.source}|${ENTITY_RE.source}`, 'gi')\n\nconst DIGITAL_ENTITY_TEST_RE = /^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i\n\nfunction replaceEntityPattern (match: string, name: string) {\n if (name.charCodeAt(0) === 0x23/* # */ && DIGITAL_ENTITY_TEST_RE.test(name)) {\n const code = name[1].toLowerCase() === 'x'\n ? parseInt(name.slice(2), 16)\n : parseInt(name.slice(1), 10)\n\n if (isValidEntityCode(code)) {\n return fromCodePoint(code)\n }\n\n return match\n }\n\n const decoded = decodeHTMLStrict(match)\n if (decoded !== match) {\n return decoded\n }\n\n return match\n}\n\n/** Decodes Markdown backslash escapes. */\nfunction unescapeMd (str: string) {\n if (str.indexOf('\\\\') < 0) { return str }\n return str.replace(UNESCAPE_MD_RE, '$1')\n}\n\n/**\n * Decodes Markdown backslash escapes and HTML character references in link\n * destinations, link titles, and fenced code info strings.\n */\nfunction unescapeAll (str: string) {\n if (str.indexOf('\\\\') < 0 && str.indexOf('&') < 0) { return str }\n\n return str.replace(UNESCAPE_ALL_RE, function (match, escaped, entity) {\n if (escaped) { return escaped }\n return replaceEntityPattern(match, entity)\n })\n}\n\nconst HTML_ESCAPE_TEST_RE = /[&<>\"]/\nconst HTML_ESCAPE_REPLACE_RE = /[&<>\"]/g\nconst HTML_REPLACEMENTS = {\n '&': '&amp;',\n '<': '&lt;',\n '>': '&gt;',\n '\"': '&quot;'\n}\n\nfunction replaceUnsafeChar (ch: string): string {\n return HTML_REPLACEMENTS[ch as keyof typeof HTML_REPLACEMENTS]\n}\n\n/** Escapes HTML special characters in a string. */\nfunction escapeHtml (str: string) {\n if (HTML_ESCAPE_TEST_RE.test(str)) {\n return str.replace(HTML_ESCAPE_REPLACE_RE, replaceUnsafeChar)\n }\n return str\n}\n\nconst REGEXP_ESCAPE_RE = /[.?*+^$[\\]\\\\(){}|-]/g\n\n/** Escapes regular expression metacharacters in a string. */\nfunction escapeRE (str: string) {\n return str.replace(REGEXP_ESCAPE_RE, '\\\\$&')\n}\n\n/** Checks whether a character code is an ASCII space or tab. */\nfunction isSpace (code: number) {\n switch (code) {\n case 0x09:\n case 0x20:\n return true\n }\n return false\n}\n\n/**\n * Checks whether a character code is whitespace recognized by Markdown.\n *\n * Matches the Unicode `Zs` category or `\\t`, `\\f`, `\\v`, `\\r`, `\\n`.\n */\nfunction isWhiteSpace (code: number) {\n if (code >= 0x2000 && code <= 0x200A) { return true }\n switch (code) {\n case 0x09: // \\t\n case 0x0A: // \\n\n case 0x0B: // \\v\n case 0x0C: // \\f\n case 0x0D: // \\r\n case 0x20:\n case 0xA0:\n case 0x1680:\n case 0x202F:\n case 0x205F:\n case 0x3000:\n return true\n }\n return false\n}\n\n/**\n * Checks whether a character is Unicode punctuation or a symbol.\n *\n * Does not support astral characters.\n */\nfunction isPunctChar (ch: string) {\n return ucmicro.P.test(ch) || ucmicro.S.test(ch)\n}\n\n/** Checks whether a Unicode code point is punctuation or a symbol. */\nfunction isPunctCharCode (code: number) {\n return isPunctChar(fromCodePoint(code))\n}\n\n/**\n * Markdown ASCII punctuation characters.\n *\n * !, \", #, $, %, &, ', (, ), *, +, ,, -, ., /, :, ;, <, =, >, ?, @,\n * [, \\, ], ^, _, `, {, |, }, or ~\n *\n * http://spec.commonmark.org/0.15/#ascii-punctuation-character\n *\n * Don't confuse with Unicode punctuation. It lacks some characters in the\n * ASCII range.\n */\nfunction isMdAsciiPunct (ch: number) {\n switch (ch) {\n case 0x21/* ! */:\n case 0x22/* \" */:\n case 0x23/* # */:\n case 0x24/* $ */:\n case 0x25/* % */:\n case 0x26/* & */:\n case 0x27/* ' */:\n case 0x28/* ( */:\n case 0x29/* ) */:\n case 0x2A/* * */:\n case 0x2B/* + */:\n case 0x2C/* , */:\n case 0x2D/* - */:\n case 0x2E/* . */:\n case 0x2F/* / */:\n case 0x3A/* : */:\n case 0x3B/* ; */:\n case 0x3C/* < */:\n case 0x3D/* = */:\n case 0x3E/* > */:\n case 0x3F/* ? */:\n case 0x40/* @ */:\n case 0x5B/* [ */:\n case 0x5C/* \\ */:\n case 0x5D/* ] */:\n case 0x5E/* ^ */:\n case 0x5F/* _ */:\n case 0x60/* ` */:\n case 0x7B/* { */:\n case 0x7C/* | */:\n case 0x7D/* } */:\n case 0x7E/* ~ */:\n return true\n default:\n return false\n }\n}\n\n/** Normalizes `[reference labels]` for case-insensitive lookup. */\nfunction normalizeReference (str: string) {\n // Trim and collapse whitespace\n //\n str = str.trim().replace(/\\s+/g, ' ')\n\n // .toLowerCase().toUpperCase() should get rid of all differences\n // between letter variants.\n //\n // Simple .toLowerCase() doesn't normalize 125 code points correctly,\n // and .toUpperCase doesn't normalize 6 of them (list of exceptions:\n // İ, ϴ, ẞ, Ω, K, Å - those are already uppercased, but have differently\n // uppercased versions).\n //\n // Here's an example showing how it happens. Lets take greek letter omega:\n // uppercase U+0398 (Θ), U+03f4 (ϴ) and lowercase U+03b8 (θ), U+03d1 (ϑ)\n //\n // Unicode entries:\n // 0398;GREEK CAPITAL LETTER THETA;Lu;0;L;;;;;N;;;;03B8;\n // 03B8;GREEK SMALL LETTER THETA;Ll;0;L;;;;;N;;;0398;;0398\n // 03D1;GREEK THETA SYMBOL;Ll;0;L;<compat> 03B8;;;;N;GREEK SMALL LETTER SCRIPT THETA;;0398;;0398\n // 03F4;GREEK CAPITAL THETA SYMBOL;Lu;0;L;<compat> 0398;;;;N;;;;03B8;\n //\n // Case-insensitive comparison should treat all of them as equivalent.\n //\n // But .toLowerCase() doesn't change ϑ (it's already lowercase),\n // and .toUpperCase() doesn't change ϴ (already uppercase).\n //\n // Applying first lower then upper case normalizes any character:\n // '\\u0398\\u03f4\\u03b8\\u03d1'.toLowerCase().toUpperCase() === '\\u0398\\u0398\\u0398\\u0398'\n //\n // Note: this is equivalent to unicode case folding; unicode normalization\n // is a different step that is not required here.\n //\n // Final result should be uppercased, because it's later stored in an object\n // (this avoid a conflict with Object.prototype members,\n // most notably, `__proto__`)\n //\n return str.toLowerCase().toUpperCase()\n}\n\nfunction isAsciiTrimmable (c: number) {\n return c === 0x20 || c === 0x09 || c === 0x0a || c === 0x0d\n}\n\n/**\n * \"Light\" `.trim()` for blocks (headings, paragraphs), where Unicode spaces\n * should be preserved.\n */\nfunction asciiTrim (str: string) {\n let start = 0\n for (; start < str.length; start++) {\n if (!isAsciiTrimmable(str.charCodeAt(start))) {\n break\n }\n }\n let end = str.length - 1\n for (; end >= start; end--) {\n if (!isAsciiTrimmable(str.charCodeAt(end))) {\n break\n }\n }\n return str.slice(start, end + 1)\n}\n\n/**\n * Libraries commonly used by markdown-it and its plugins, re-exported to\n * reduce duplicate dependencies in browser bundles.\n */\nconst lib = { mdurl, ucmicro }\n\nexport {\n lib,\n callable,\n unescapeMd,\n unescapeAll,\n isValidEntityCode,\n fromCodePoint,\n escapeHtml,\n arrayReplaceAt,\n isSpace,\n isWhiteSpace,\n isMdAsciiPunct,\n isPunctChar,\n isPunctCharCode,\n escapeRE,\n normalizeReference,\n asciiTrim\n}\n","import type StateInline from '../rules_inline/state_inline.ts'\n\n/** Finds the end of a link or image label (`[label]`). */\nexport default function parseLinkLabel (state: StateInline, start: number, disableNested?: boolean): number {\n let level, found, marker, prevPos\n\n const max = state.posMax\n const oldPos = state.pos\n\n state.pos = start + 1\n level = 1\n\n while (state.pos < max) {\n marker = state.src.charCodeAt(state.pos)\n if (marker === 0x5D /* ] */) {\n level--\n if (level === 0) {\n found = true\n break\n }\n }\n\n prevPos = state.pos\n state.md.inline.skipToken(state)\n if (marker === 0x5B /* [ */) {\n if (prevPos === state.pos - 1) {\n // increase level if we find text `[`, which is not a part of any token\n level++\n } else if (disableNested) {\n state.pos = oldPos\n return -1\n }\n }\n }\n\n let labelEnd = -1\n\n if (found) {\n labelEnd = state.pos\n }\n\n // restore old state\n state.pos = oldPos\n\n return labelEnd\n}\n","import { unescapeAll } from '../common/utils.ts'\n\n/** Parses the destination in `[label](destination \"title\")`. */\nexport default function parseLinkDestination (str: string, start: number, max: number) {\n let code\n let pos = start\n\n const result = {\n ok: false,\n pos: 0,\n str: ''\n }\n\n if (str.charCodeAt(pos) === 0x3C /* < */) {\n pos++\n while (pos < max) {\n code = str.charCodeAt(pos)\n if (code === 0x0A /* \\n */) { return result }\n if (code === 0x3C /* < */) { return result }\n if (code === 0x3E /* > */) {\n result.pos = pos + 1\n result.str = unescapeAll(str.slice(start + 1, pos))\n result.ok = true\n return result\n }\n if (code === 0x5C /* \\ */ && pos + 1 < max) {\n pos += 2\n continue\n }\n\n pos++\n }\n\n // no closing '>'\n return result\n }\n\n // this should be ... } else { ... branch\n\n let level = 0\n while (pos < max) {\n code = str.charCodeAt(pos)\n\n if (code === 0x20) { break }\n\n // ascii control characters\n if (code < 0x20 || code === 0x7F) { break }\n\n if (code === 0x5C /* \\ */ && pos + 1 < max) {\n if (str.charCodeAt(pos + 1) === 0x20) { pos++; continue }\n pos += 2\n continue\n }\n\n if (code === 0x28 /* ( */) {\n level++\n if (level > 32) { return result }\n }\n\n if (code === 0x29 /* ) */) {\n if (level === 0) { break }\n level--\n }\n\n pos++\n }\n\n if (start === pos) { return result }\n if (level !== 0) { return result }\n\n result.str = unescapeAll(str.slice(start, pos))\n result.pos = pos\n result.ok = true\n return result\n}\n","import { unescapeAll } from '../common/utils.ts'\n\n/** @inline */\ninterface ParseLinkTitleResult {\n ok: boolean\n can_continue: boolean\n pos: number\n str: string\n marker: number\n}\n\n/**\n * Parses the optional title in `[label](destination \"title\")` or\n * `[label]: destination \"title\"`.\n *\n * `prev_state` continues a reference title on the next source line.\n */\nexport default function parseLinkTitle (\n str: string,\n start: number,\n max: number,\n prev_state?: ParseLinkTitleResult\n): ParseLinkTitleResult {\n let code\n let pos = start\n\n const state = {\n // if `true`, this is a valid link title\n ok: false,\n // if `true`, this link can be continued on the next line\n can_continue: false,\n // if `ok`, it's the position of the first character after the closing marker\n pos: 0,\n // if `ok`, it's the unescaped title\n str: '',\n // expected closing marker character code\n marker: 0\n }\n\n if (prev_state) {\n // this is a continuation of a previous parseLinkTitle call on the next line,\n // used in reference links only\n state.str = prev_state.str\n state.marker = prev_state.marker\n } else {\n if (pos >= max) { return state }\n\n let marker = str.charCodeAt(pos)\n if (marker !== 0x22 /* \" */ && marker !== 0x27 /* ' */ && marker !== 0x28 /* ( */) { return state }\n\n start++\n pos++\n\n // if opening marker is \"(\", switch it to closing marker \")\"\n if (marker === 0x28) { marker = 0x29 }\n\n state.marker = marker\n }\n\n while (pos < max) {\n code = str.charCodeAt(pos)\n if (code === state.marker) {\n state.pos = pos + 1\n state.str += unescapeAll(str.slice(start, pos))\n state.ok = true\n return state\n } else if (code === 0x28 /* ( */ && state.marker === 0x29 /* ) */) {\n return state\n } else if (code === 0x5C /* \\ */ && pos + 1 < max) {\n pos++\n }\n\n pos++\n }\n\n // no closing marker found, but this link title may continue on the next line (for references)\n state.can_continue = true\n state.str += unescapeAll(str.slice(start, pos))\n return state\n}\n","/**\n * Functions used to parse links and images, split out of parser rules because\n * of their size.\n *\n * @module md.helpers\n */\n\n// Just a shortcut for bulk export\n\nimport parseLinkLabel from './parse_link_label.ts'\nimport parseLinkDestination from './parse_link_destination.ts'\nimport parseLinkTitle from './parse_link_title.ts'\n\nexport {\n parseLinkLabel,\n parseLinkDestination,\n parseLinkTitle\n}\n","// Token class\n\n/** @inline */\ntype TokenNesting = -1 | 0 | 1\n\n/** @inline */\ntype TokenAttribute = [name: string, value: string | number]\n\n/**\n * Represents one item in the parsed token stream, storing parsed data and\n * providing helpers for managing HTML attributes.\n */\nclass Token {\n /**\n * Type of the token (string, e.g. \"paragraph_open\")\n */\n declare type: string\n\n /**\n * html tag name, e.g. \"p\"\n */\n declare tag: string\n\n /** Html attributes. Format: `[ [ name1, value1 ], [ name2, value2 ] ]` */\n declare attrs: TokenAttribute[] | null\n\n /**\n * Source map info. Format: `[ line_begin, line_end ]`\n */\n map: [number, number] | null = null\n\n /**\n * Level change (number in {-1, 0, 1} set), where:\n *\n * - `1` means the tag is opening\n * - `0` means the tag is self-closing\n * - `-1` means the tag is closing\n */\n declare nesting: TokenNesting\n\n /**\n * nesting level, the same as `state.level`\n */\n level = 0\n\n /**\n * An array of child nodes (inline and img tokens)\n */\n children: Token[] | null = null\n\n /**\n * In a case of self-closing tag (code, html, fence, etc.),\n * it has contents of this tag.\n */\n content = ''\n\n /**\n * '*' or '_' for emphasis, fence string for fence, etc.\n */\n markup = ''\n\n /**\n * Additional information:\n *\n * - Info string for \"fence\" tokens\n * - The value \"auto\" for autolink \"link_open\" and \"link_close\" tokens\n * - The string value of the item marker for ordered-list \"list_item_open\" tokens\n */\n info = ''\n\n /** A place for plugins to store an arbitrary data */\n declare meta: Record<string, unknown> | null\n\n /**\n * True for block-level tokens, false for inline tokens.\n * Used in renderer to calculate line breaks\n */\n block = false\n\n /**\n * If it's true, ignore this element when rendering. Used for tight lists\n * to hide paragraphs.\n */\n hidden = false\n\n constructor (type: string, tag: string, nesting: TokenNesting) {\n this.type = type\n this.tag = tag\n\n this.attrs = null\n\n this.nesting = nesting\n\n this.meta = null\n }\n\n /**\n * Search attribute index by name.\n */\n attrIndex (name: string): number {\n if (!this.attrs) { return -1 }\n\n const attrs = this.attrs\n\n for (let i = 0, len = attrs.length; i < len; i++) {\n if (attrs[i][0] === name) { return i }\n }\n return -1\n }\n\n /**\n * Add `[ name, value ]` attribute to list. Init attrs if necessary\n */\n attrPush (attrData: TokenAttribute): void {\n if (this.attrs) {\n this.attrs.push(attrData)\n } else {\n this.attrs = [attrData]\n }\n }\n\n /**\n * Set `name` attribute to `value`. Override old value if exists.\n */\n attrSet (name: string, value: string | number): void {\n const idx = this.attrIndex(name)\n const attrData: TokenAttribute = [name, value]\n\n if (idx < 0) {\n this.attrPush(attrData)\n } else {\n this.attrs![idx] = attrData\n }\n }\n\n /**\n * Get the value of attribute `name`, or null if it does not exist.\n */\n attrGet (name: string): string | number | null {\n const idx = this.attrIndex(name)\n let value = null\n if (idx >= 0) {\n value = this.attrs![idx][1]\n }\n return value\n }\n\n /**\n * Join value to existing attribute via space. Or create new attribute if not\n * exists. Useful to operate with token classes.\n */\n attrJoin (name: string, value: string | number): void {\n const idx = this.attrIndex(name)\n\n if (idx < 0) {\n this.attrPush([name, value])\n } else {\n this.attrs![idx][1] = `${this.attrs![idx][1]} ${value}`\n }\n }\n}\n\nexport default Token\n","/** @inline */\ntype RuleOptions = { alt?: string[] }\n\n/**\n * Helper class, used by {@link MarkdownIt.core}, {@link MarkdownIt.block} and\n * {@link MarkdownIt.inline} to manage sequences of functions (rules):\n *\n * - keep rules in defined order\n * - assign the name to each rule\n * - enable/disable rules\n * - add/replace rules\n * - allow assign rules to additional named chains (in the same)\n * - cacheing lists of active rules\n *\n * You will not need use this class directly until write plugins. For simple\n * rules control use {@link MarkdownIt.disable}, {@link MarkdownIt.enable} and\n * {@link MarkdownIt.use}.\n */\nclass Ruler<Args extends unknown[], Result> {\n /** @internal */\n __rules__: Array<{\n name: string\n enabled: boolean\n fn: (...args: Args) => Result\n alt: string[]\n }> = []\n\n // Cached rule chains.\n //\n // First level - chain name, '' for default.\n // Second level - diginal anchor for fast filtering by charcodes.\n //\n /** @internal */\n __cache__: Record<string, Array<(...args: Args) => Result>> | null = null\n\n /** @internal */\n __find__ (name: string): number {\n for (let i = 0; i < this.__rules__.length; i++) {\n if (this.__rules__[i].name === name) {\n return i\n }\n }\n return -1\n }\n\n /** @internal */\n __compile__ (): void {\n const chains = new Set<string>()\n\n // collect unique names\n this.__rules__.forEach(rule => {\n if (!rule.enabled) return\n rule.alt.forEach(altName => {\n if (altName) chains.add(altName)\n })\n })\n\n this.__cache__ = Object.create(null)\n\n // Collect default chain\n this.__cache__![''] = []\n this.__rules__.forEach(rule => {\n if (rule.enabled) this.__cache__![''].push(rule.fn)\n })\n\n // Collect alt chains\n chains.forEach(chain => {\n this.__cache__![chain] = []\n\n this.__rules__.forEach(rule => {\n if (rule.enabled && rule.alt.indexOf(chain) >= 0) {\n this.__cache__![chain].push(rule.fn)\n }\n })\n })\n }\n\n /**\n * Replace rule by name with new function & options. Throws error if name not\n * found.\n *\n * @example Replace existing typographer replacement rule with new one\n * ```javascript\n * import MarkdownIt from 'markdown-it'\n * const md = new MarkdownIt()\n *\n * md.core.ruler.at('replacements', function replace(state) {\n * //...\n * });\n * ```\n */\n at (name: string, fn: (...args: Args) => Result, options: RuleOptions = {}): void {\n const index = this.__find__(name)\n\n if (index === -1) { throw new Error(`Parser rule not found: ${name}`) }\n\n this.__rules__[index].fn = fn\n this.__rules__[index].alt = options.alt || []\n this.__cache__ = null\n }\n\n /**\n * Add new rule to chain before one with given name. See also\n * {@link Ruler.after}, {@link Ruler.push}.\n *\n * @example\n * ```javascript\n * import MarkdownIt from 'markdown-it'\n * const md = new MarkdownIt()\n *\n * md.block.ruler.before('paragraph', 'my_rule', function replace(state) {\n * //...\n * });\n * ```\n */\n before (beforeName: string, ruleName: string, fn: (...args: Args) => Result, options: RuleOptions = {}): void {\n const index = this.__find__(beforeName)\n\n if (index === -1) { throw new Error(`Parser rule not found: ${beforeName}`) }\n\n this.__rules__.splice(index, 0, {\n name: ruleName,\n enabled: true,\n fn,\n alt: options.alt || []\n })\n\n this.__cache__ = null\n }\n\n /**\n * Add new rule to chain after one with given name. See also\n * {@link Ruler.before}, {@link Ruler.push}.\n *\n * @example\n * ```javascript\n * import MarkdownIt from 'markdown-it'\n * const md = new MarkdownIt()\n *\n * md.inline.ruler.after('text', 'my_rule', function replace(state) {\n * //...\n * });\n * ```\n */\n after (afterName: string, ruleName: string, fn: (...args: Args) => Result, options: RuleOptions = {}): void {\n const index = this.__find__(afterName)\n\n if (index === -1) { throw new Error(`Parser rule not found: ${afterName}`) }\n\n this.__rules__.splice(index + 1, 0, {\n name: ruleName,\n enabled: true,\n fn,\n alt: options.alt || []\n })\n\n this.__cache__ = null\n }\n\n /**\n * Push new rule to the end of chain. See also\n * {@link Ruler.before}, {@link Ruler.after}.\n *\n * @example\n * ```javascript\n * import MarkdownIt from 'markdown-it'\n * const md = new MarkdownIt()\n *\n * md.core.ruler.push('my_rule', function replace(state) {\n * //...\n * });\n * ```\n */\n push (ruleName: string, fn: (...args: Args) => Result, options: RuleOptions = {}): void {\n this.__rules__.push({\n name: ruleName,\n enabled: true,\n fn,\n alt: options.alt || []\n })\n\n this.__cache__ = null\n }\n\n /**\n * Enable rules with given names. If any rule name not found - throw Error.\n * Errors can be disabled by second param.\n *\n * See also {@link Ruler.disable}, {@link Ruler.enableOnly}.\n *\n * Returns list of found rule names (if no exception happened).\n */\n enable (list: string | string[], ignoreInvalid = false): string[] {\n if (!Array.isArray(list)) { list = [list] }\n\n const result: string[] = []\n\n // Search by name and enable\n list.forEach(name => {\n const idx = this.__find__(name)\n\n if (idx < 0) {\n if (ignoreInvalid) { return }\n throw new Error(`Rules manager: invalid rule name ${name}`)\n }\n this.__rules__[idx].enabled = true\n result.push(name)\n })\n\n this.__cache__ = null\n return result\n }\n\n /**\n * Enable rules with given names, and disable everything else. If any rule name\n * not found - throw Error. Errors can be disabled by second param.\n *\n * See also {@link Ruler.disable}, {@link Ruler.enable}.\n */\n enableOnly (list: string | string[], ignoreInvalid = false): void {\n if (!Array.isArray(list)) { list = [list] }\n\n this.__rules__.forEach(rule => { rule.enabled = false })\n\n this.enable(list, ignoreInvalid)\n }\n\n /**\n * Disable rules with given names. If any rule name not found - throw Error.\n * Errors can be disabled by second param.\n *\n * See also {@link Ruler.enable}, {@link Ruler.enableOnly}.\n *\n * Returns list of found rule names (if no exception happened).\n */\n disable (list: string | string[], ignoreInvalid = false): string[] {\n if (!Array.isArray(list)) { list = [list] }\n\n const result: string[] = []\n\n // Search by name and disable\n list.forEach(name => {\n const idx = this.__find__(name)\n\n if (idx < 0) {\n if (ignoreInvalid) { return }\n throw new Error(`Rules manager: invalid rule name ${name}`)\n }\n this.__rules__[idx].enabled = false\n result.push(name)\n })\n\n this.__cache__ = null\n return result\n }\n\n /**\n * Return array of active functions (rules) for given chain name. It analyzes\n * rules configuration, compiles caches if not exists and returns result.\n *\n * Default chain name is `''` (empty string). It can't be skipped. That's\n * done intentionally, to keep signature monomorphic for high speed.\n */\n getRules (chainName: string): Array<(...args: Args) => Result> {\n if (!this.__cache__) this.__compile__()\n\n // Chain can be empty, if rules disabled. But we still have to return Array.\n return this.__cache__![chainName] || []\n }\n}\n\nexport default Ruler\n","import { unescapeAll, escapeHtml } from './common/utils.ts'\nimport type Token from './token.ts'\nimport type { Env, MarkdownItOptions } from './types.ts'\n\n/** Function that renders a token at a given position in a token stream. */\nexport type RendererRule = (\n tokens: Token[],\n idx: number,\n options: Required<MarkdownItOptions>,\n env: Env | undefined,\n renderer: Renderer\n) => string\n\nconst default_rules: Record<string, RendererRule> = {}\n\ndefault_rules.code_inline = function (\n tokens: Token[],\n idx: number,\n options: Required<MarkdownItOptions>,\n env: Env | undefined,\n slf: Renderer\n): string {\n const token = tokens[idx]\n\n return `<code${slf.renderAttrs(token)}>${escapeHtml(token.content)}</code>`\n}\n\ndefault_rules.code_block = function (\n tokens: Token[],\n idx: number,\n options: Required<MarkdownItOptions>,\n env: Env | undefined,\n slf: Renderer\n): string {\n const token = tokens[idx]\n\n return `<pre${slf.renderAttrs(token)}><code>${escapeHtml(tokens[idx].content)}</code></pre>\\n`\n}\n\ndefault_rules.fence = function (\n tokens: Token[],\n idx: number,\n options: Required<MarkdownItOptions>,\n env: Env | undefined,\n slf: Renderer\n): string {\n const token = tokens[idx]\n const info = token.info ? unescapeAll(token.info).trim() : ''\n let langName = ''\n let langAttrs = ''\n\n if (info) {\n const arr = info.split(/(\\s+)/g)\n langName = arr[0]\n langAttrs = arr.slice(2).join('')\n }\n\n let highlighted\n if (options.highlight) {\n highlighted = options.highlight(token.content, langName, langAttrs) || escapeHtml(token.content)\n } else {\n highlighted = escapeHtml(token.content)\n }\n\n if (highlighted.indexOf('<pre') === 0) {\n return highlighted + '\\n'\n }\n\n // If language exists, inject class gently, without modifying original token.\n // May be, one day we will add .deepClone() for token and simplify this part, but\n // now we prefer to keep things local.\n if (info) {\n const i = token.attrIndex('class')\n const tmpAttrs = token.attrs ? token.attrs.slice() : []\n\n if (i < 0) {\n tmpAttrs.push(['class', `${options.langPrefix}${langName}`])\n } else {\n tmpAttrs[i] = [tmpAttrs[i][0], tmpAttrs[i][1]] // shallow clone\n tmpAttrs[i][1] += ` ${options.langPrefix}${langName}`\n }\n\n // Fake token just to render attributes\n const tmpToken = {\n attrs: tmpAttrs\n }\n\n return `<pre><code${slf.renderAttrs(tmpToken)}>${highlighted}</code></pre>\\n`\n }\n\n return `<pre><code${slf.renderAttrs(token)}>${highlighted}</code></pre>\\n`\n}\n\ndefault_rules.image = function (\n tokens: Token[],\n idx: number,\n options: Required<MarkdownItOptions>,\n env: Env | undefined,\n slf: Renderer\n): string {\n const token = tokens[idx]\n\n // \"alt\" attr MUST be set, even if empty. Because it's mandatory and\n // should be placed on proper position for tests.\n //\n // Replace content with actual value\n\n token.attrs![token.attrIndex('alt')][1] =\n slf.renderInlineAsText(token.children!, options, env)\n\n return slf.renderToken(tokens, idx, options)\n}\n\ndefault_rules.hardbreak = function (\n tokens: Token[],\n idx: number,\n options: Required<MarkdownItOptions>\n): string {\n return options.xhtmlOut ? '<br />\\n' : '<br>\\n'\n}\ndefault_rules.softbreak = function (\n tokens: Token[],\n idx: number,\n options: Required<MarkdownItOptions>\n): string {\n return options.breaks ? (options.xhtmlOut ? '<br />\\n' : '<br>\\n') : '\\n'\n}\n\ndefault_rules.text = function (tokens: Token[], idx: number): string {\n return escapeHtml(tokens[idx].content)\n}\n\ndefault_rules.html_block = function (tokens: Token[], idx: number): string {\n return tokens[idx].content\n}\ndefault_rules.html_inline = function (tokens: Token[], idx: number): string {\n return tokens[idx].content\n}\n\n/**\n * Generates HTML from parsed token stream. Each instance has independent\n * copy of rules. Those can be rewritten with ease. Also, you can add new\n * rules if you create plugin and adds new token types.\n *\n * Creates new renderer instance and fills {@link Renderer.rules} with defaults.\n */\nclass Renderer {\n /**\n * Contains render rules for tokens. Can be updated and extended.\n *\n * See [source code](https://github.com/markdown-it/markdown-it/blob/master/src/renderer.ts)\n * for more details and examples.\n *\n * @example Custom render rules\n * ```javascript\n * import MarkdownIt from 'markdown-it'\n * const md = new MarkdownIt()\n *\n * md.renderer.rules.strong_open = function () { return '<b>'; };\n * md.renderer.rules.strong_close = function () { return '</b>'; };\n *\n * const result = md.renderInline(...);\n * ```\n *\n * @example Each rule is called as independent static function with fixed signature\n * ```javascript\n * function my_token_render(tokens, idx, options, env, renderer) {\n * // ...\n * return renderedHTML;\n * }\n * ```\n */\n rules: Record<string, RendererRule> = Object.assign({}, default_rules)\n\n /**\n * Render token attributes to string.\n */\n renderAttrs (token: Pick<Token, 'attrs'>): string {\n let i, l, result\n\n if (!token.attrs) { return '' }\n\n result = ''\n\n for (i = 0, l = token.attrs.length; i < l; i++) {\n result += ` ${escapeHtml(token.attrs[i][0])}=\"${escapeHtml(String(token.attrs[i][1]))}\"`\n }\n\n return result\n }\n\n /**\n * Default token renderer. Can be overriden by custom function\n * in {@link Renderer.rules}.\n */\n renderToken (tokens: Token[], idx: number, options: Required<MarkdownItOptions>): string {\n const token = tokens[idx]\n let result = ''\n\n // Tight list paragraphs\n if (token.hidden) {\n return ''\n }\n\n // Insert a newline between hidden paragraph and subsequent opening\n // block-level tag.\n //\n // For example, here we should insert a newline before blockquote:\n // - a\n // >\n //\n // Only closing hidden tokens count, to not break on other hidden ones.\n //\n // Hidden tokens without nesting (`reference_definition`) are skipped here\n // and below, or they would break line feeds around neighbour blocks.\n //\n let prev = idx - 1\n while (prev >= 0 && tokens[prev].hidden && tokens[prev].nesting === 0) { prev-- }\n\n if (token.block && token.nesting !== -1 && prev >= 0 &&\n tokens[prev].hidden && tokens[prev].nesting === -1) {\n result += '\\n'\n }\n\n // Add token name, e.g. `<img`\n result += (token.nesting === -1 ? '</' : '<') + token.tag\n\n // Encode attributes, e.g. `<img src=\"foo\"`\n result += this.renderAttrs(token)\n\n // Add a slash for self-closing tags, e.g. `<img src=\"foo\" /`\n if (token.nesting === 0 && options.xhtmlOut) {\n result += ' /'\n }\n\n // Check if we need to add a newline after this tag\n let needLf = false\n if (token.block) {\n needLf = true\n\n if (token.nesting === 1) {\n let next = idx + 1\n while (next < tokens.length && tokens[next].hidden && tokens[next].nesting === 0) { next++ }\n\n if (next < tokens.length) {\n const nextToken = tokens[next]\n\n if (nextToken.type === 'inline' || nextToken.hidden) {\n // Block-level tag containing an inline tag.\n //\n needLf = false\n } else if (nextToken.nesting === -1 && nextToken.tag === token.tag) {\n // Opening tag + closing tag of the same type. E.g. `<li></li>`.\n //\n needLf = false\n }\n }\n }\n }\n\n result += needLf ? '>\\n' : '>'\n\n return result\n }\n\n /**\n * The same as {@link Renderer.render}, but for single token of `inline` type.\n */\n renderInline (tokens: Token[], options: Required<MarkdownItOptions>, env: Env | undefined): string {\n let result = ''\n const rules = this.rules\n\n for (let i = 0, len = tokens.length; i < len; i++) {\n const type = tokens[i].type\n\n if (typeof rules[type] !== 'undefined') {\n result += rules[type](tokens, i, options, env, this)\n } else {\n result += this.renderToken(tokens, i, options)\n }\n }\n\n return result\n }\n\n /**\n * Special kludge for image `alt` attributes to conform CommonMark spec.\n * Don't try to use it! Spec requires to show `alt` content with stripped markup,\n * instead of simple escaping.\n */\n renderInlineAsText (tokens: Token[], options: Required<MarkdownItOptions>, env: Env | undefined): string {\n let result = ''\n\n for (let i = 0, len = tokens.length; i < len; i++) {\n switch (tokens[i].type) {\n case 'text':\n case 'code_inline':\n // code content is added as plain text, without backticks\n result += tokens[i].content\n break\n case 'image':\n result += this.renderInlineAsText(tokens[i].children!, options, env)\n break\n case 'html_inline':\n case 'html_block':\n result += tokens[i].content\n break\n case 'softbreak':\n case 'hardbreak':\n result += '\\n'\n break\n default:\n // all other tokens are skipped\n }\n }\n\n return result\n }\n\n /**\n * Takes token stream and generates HTML. Probably, you will never need to call\n * this method directly.\n */\n render (tokens: Token[], options: Required<MarkdownItOptions>, env?: Env): string {\n let result = ''\n const rules = this.rules\n\n for (let i = 0, len = tokens.length; i < len; i++) {\n const type = tokens[i].type\n\n if (type === 'inline') {\n result += this.renderInline(tokens[i].children!, options, env)\n } else if (typeof rules[type] !== 'undefined') {\n result += rules[type](tokens, i, options, env, this)\n } else {\n result += this.renderToken(tokens, i, options)\n }\n }\n\n return result\n }\n}\n\nexport default Renderer\n","import Token from '../token.ts'\nimport type MarkdownIt from '../markdownit.ts'\nimport type { Env } from '../types.ts'\n\n/** Mutable state passed through the core rules chain. */\nclass StateCore {\n declare src: string\n declare env: Env\n tokens: Token[] = []\n inlineMode = false\n declare md: MarkdownIt\n\n // re-export Token class to use in core rules\n Token = Token\n\n constructor (src: string, md: MarkdownIt, env: Env) {\n this.src = src\n this.env = env\n this.md = md // link to parser instance\n }\n}\n\nexport default StateCore\n","// Normalize input string\n\nimport type StateCore from './state_core.ts'\n\n// https://spec.commonmark.org/0.29/#line-ending\nconst UNNORMALIZED_NEWLINE_RE = /\\r\\n?/g\nconst NULL_RE = /\\0/g\n\nexport default function normalize (state: StateCore): void {\n let str\n\n // Normalize newlines\n str = state.src.replace(UNNORMALIZED_NEWLINE_RE, '\\n')\n\n // Replace NULL characters\n str = str.replace(NULL_RE, '\\uFFFD')\n\n state.src = str\n}\n","import type StateCore from './state_core.ts'\n\nexport default function block (state: StateCore): void {\n let token\n\n if (state.inlineMode) {\n token = new state.Token('inline', '', 0)\n token.content = state.src\n token.map = [0, 1]\n token.children = []\n state.tokens.push(token)\n } else {\n state.md.block.parse(state.src, state.md, state.env, state.tokens)\n }\n}\n","// Drop `reference_definition` tokens to keep the stream backward compatible\n//\n// Those tokens mark places link definitions took in the source. They are new,\n// and plugins walking block tokens may not expect them, so by default the\n// stream stays as it always was. Disable this rule to opt in.\n//\n\nimport type StateCore from './state_core.ts'\n\nexport default function strip_references (state: StateCore): void {\n const tokens = state.tokens\n let last = 0\n\n for (let curr = 0; curr < tokens.length; curr++) {\n if (tokens[curr].type === 'reference_definition') continue\n\n if (curr !== last) { tokens[last] = tokens[curr] }\n\n last++\n }\n\n if (tokens.length !== last) { tokens.length = last }\n}\n","import type StateCore from './state_core.ts'\n\nexport default function inline (state: StateCore): void {\n const tokens = state.tokens\n\n // Parse inlines\n for (let i = 0, l = tokens.length; i < l; i++) {\n const tok = tokens[i]\n if (tok.type === 'inline') {\n state.md.inline.parse(tok.content, state.md, state.env, tok.children!)\n }\n }\n}\n","// Replace link-like texts with link nodes.\n//\n// Currently restricted by `md.validateLink()` to http/https/ftp\n//\n\nimport type StateCore from './state_core.ts'\n\nfunction isLinkOpen (str: string) {\n return /^<a[>\\s]/i.test(str)\n}\nfunction isLinkClose (str: string) {\n return /^<\\/a\\s*>/i.test(str)\n}\n\nexport default function linkify (state: StateCore): void {\n const blockTokens = state.tokens\n\n if (!state.md.options.linkify) { return }\n\n for (let j = 0, l = blockTokens.length; j < l; j++) {\n if (blockTokens[j].type !== 'inline' ||\n !state.md.linkify.test(blockTokens[j].content)) {\n continue\n }\n\n const tokens = blockTokens[j].children!\n const replacements: Array<{ index: number, nodes: typeof tokens }> = []\n\n let htmlLinkLevel = 0\n\n // We scan from the end, to keep position when new tags added.\n // Use reversed logic in links start/end match\n for (let i = tokens.length - 1; i >= 0; i--) {\n const currentToken = tokens[i]\n\n // Skip content of markdown links\n if (currentToken.type === 'link_close') {\n i--\n while (tokens[i].level !== currentToken.level && tokens[i].type !== 'link_open') {\n i--\n }\n continue\n }\n\n // Skip content of html tag links\n if (currentToken.type === 'html_inline') {\n if (isLinkOpen(currentToken.content) && htmlLinkLevel > 0) {\n htmlLinkLevel--\n }\n if (isLinkClose(currentToken.content)) {\n htmlLinkLevel++\n }\n }\n if (htmlLinkLevel > 0) { continue }\n\n if (currentToken.type === 'text' && state.md.linkify.test(currentToken.content)) {\n const text = currentToken.content\n let links = state.md.linkify.match(text)!\n\n // Now split string to nodes\n const nodes = []\n let level = currentToken.level\n let lastPos = 0\n\n // forbid escape sequence at the start of the string,\n // this avoids http\\://example.com/ from being linkified as\n // http:<a href=\"//example.com/\">//example.com/</a>\n if (links.length > 0 &&\n links[0].index === 0 &&\n i > 0 &&\n tokens[i - 1].type === 'text_special') {\n links = links.slice(1)\n }\n\n for (let ln = 0; ln < links.length; ln++) {\n const url = links[ln].url\n const fullUrl = state.md.normalizeLink(url)\n if (!state.md.validateLink(fullUrl)) { continue }\n\n let urlText = links[ln].text\n\n // Linkifier might send raw hostnames like \"example.com\", where url\n // starts with domain name. So we prepend http:// in those cases,\n // and remove it afterwards.\n //\n if (!links[ln].schema) {\n urlText = state.md.normalizeLinkText(`http://${urlText}`).replace(/^http:\\/\\//, '')\n } else if (links[ln].schema === 'mailto:' && !/^mailto:/i.test(urlText)) {\n urlText = state.md.normalizeLinkText(`mailto:${urlText}`).replace(/^mailto:/, '')\n } else {\n urlText = state.md.normalizeLinkText(urlText)\n }\n\n const pos = links[ln].index\n\n if (pos > lastPos) {\n const token = new state.Token('text', '', 0)\n token.content = text.slice(lastPos, pos)\n token.level = level\n nodes.push(token)\n }\n\n const token_o = new state.Token('link_open', 'a', 1)\n token_o.attrs = [['href', fullUrl]]\n token_o.level = level++\n token_o.markup = 'linkify'\n token_o.info = 'auto'\n nodes.push(token_o)\n\n const token_t = new state.Token('text', '', 0)\n token_t.content = urlText\n token_t.level = level\n nodes.push(token_t)\n\n const token_c = new state.Token('link_close', 'a', -1)\n token_c.level = --level\n token_c.markup = 'linkify'\n token_c.info = 'auto'\n nodes.push(token_c)\n\n lastPos = links[ln].lastIndex\n }\n if (lastPos < text.length) {\n const token = new state.Token('text', '', 0)\n token.content = text.slice(lastPos)\n token.level = level\n nodes.push(token)\n }\n\n replacements.push({ index: i, nodes })\n }\n }\n\n if (replacements.length > 0) {\n let newTokensLength = tokens.length\n for (const replacement of replacements) {\n newTokensLength += replacement.nodes.length - 1\n }\n\n const newTokens = new Array<(typeof tokens)[number]>(newTokensLength)\n let replacementIndex = 0\n let newTokenIndex = 0\n\n replacements.reverse()\n\n for (let i = 0; i < tokens.length; i++) {\n const replacement = replacements[replacementIndex]\n\n if (replacement?.index === i) {\n for (const node of replacement.nodes) {\n newTokens[newTokenIndex++] = node\n }\n replacementIndex++\n } else {\n newTokens[newTokenIndex++] = tokens[i]\n }\n }\n\n blockTokens[j].children = newTokens\n }\n }\n}\n","// Simple typographic replacements\n//\n// (c) (C) → ©\n// (tm) (TM) → ™\n// (r) (R) → ®\n// +- → ±\n// ... → … (also ?.... → ?.., !.... → !..)\n// ???????? → ???, !!!!! → !!!, `,,` → `,`\n// -- → &ndash;, --- → &mdash;\n//\n\n// TODO:\n// - fractionals 1/2, 1/4, 3/4 -> ½, ¼, ¾\n// - multiplications 2 x 4 -> 2 × 4\n\nimport type StateCore from './state_core.ts'\nimport type Token from '../token.ts'\n\nconst RARE_RE = /\\+-|\\.\\.|\\?\\?\\?\\?|!!!!|,,|--/\n\n// Workaround for phantomjs - need regex without /g flag,\n// or root check will fail every second time\nconst SCOPED_ABBR_TEST_RE = /\\((c|tm|r)\\)/i\n\nconst SCOPED_ABBR_RE = /\\((c|tm|r)\\)/ig\nconst SCOPED_ABBR: Record<string, string> = {\n c: '©',\n r: '®',\n tm: '™'\n}\n\nfunction replaceFn (match: string, name: string) {\n return SCOPED_ABBR[name.toLowerCase()]\n}\n\nfunction replace_scoped (inlineTokens: Token[]) {\n let inside_autolink = 0\n\n for (let i = inlineTokens.length - 1; i >= 0; i--) {\n const token = inlineTokens[i]\n\n if (token.type === 'text' && !inside_autolink) {\n token.content = token.content.replace(SCOPED_ABBR_RE, replaceFn)\n }\n\n if (token.type === 'link_open' && token.info === 'auto') {\n inside_autolink--\n }\n\n if (token.type === 'link_close' && token.info === 'auto') {\n inside_autolink++\n }\n }\n}\n\nfunction replace_rare (inlineTokens: Token[]) {\n let inside_autolink = 0\n\n for (let i = inlineTokens.length - 1; i >= 0; i--) {\n const token = inlineTokens[i]\n\n if (token.type === 'text' && !inside_autolink) {\n if (RARE_RE.test(token.content)) {\n token.content = token.content\n .replace(/\\+-/g, '±')\n // .., ..., ....... -> …\n // but ?..... & !..... -> ?.. & !..\n .replace(/\\.{2,}/g, '…').replace(/([?!])…/g, '$1..')\n .replace(/([?!]){4,}/g, '$1$1$1').replace(/,{2,}/g, ',')\n // em-dash\n .replace(/(^|[^-])---(?=[^-]|$)/mg, '$1\\u2014')\n // en-dash\n .replace(/(^|\\s)--(?=\\s|$)/mg, '$1\\u2013')\n .replace(/(^|[^-\\s])--(?=[^-\\s]|$)/mg, '$1\\u2013')\n }\n }\n\n if (token.type === 'link_open' && token.info === 'auto') {\n inside_autolink--\n }\n\n if (token.type === 'link_close' && token.info === 'auto') {\n inside_autolink++\n }\n }\n}\n\nexport default function replace (state: StateCore): void {\n let blkIdx\n\n if (!state.md.options.typographer) { return }\n\n for (blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) {\n if (state.tokens[blkIdx].type !== 'inline') { continue }\n\n if (SCOPED_ABBR_TEST_RE.test(state.tokens[blkIdx].content)) {\n replace_scoped(state.tokens[blkIdx].children!)\n }\n\n if (RARE_RE.test(state.tokens[blkIdx].content)) {\n replace_rare(state.tokens[blkIdx].children!)\n }\n }\n}\n","// Convert straight quotation marks to typographic ones\n//\n\nimport { isWhiteSpace, isPunctCharCode, isMdAsciiPunct } from '../common/utils.ts'\nimport type Token from '../token.ts'\nimport type StateCore from './state_core.ts'\n\nconst QUOTE_TEST_RE = /['\"]/\nconst QUOTE_RE = /['\"]/g\nconst APOSTROPHE = '\\u2019' /* ’ */\n// Caps memory on malicious input\nconst MAX_OPENERS = 1000\n\ninterface Replacement {\n pos: number\n ch: string\n}\n\ntype ReplacementMap = Record<string, Replacement[]>\n\ninterface QuoteOpener {\n tokenIdx: number\n contentPos: number\n isSingleQuote: boolean\n level: number\n // stack index of the previous opener of the same quote type, -1 if none\n prevSameQuoteIdx: number\n}\n\n// stack indexes of topmost openers of each type (-1 if none)\ninterface QuoteHeads {\n single: number\n double: number\n}\n\nfunction truncateStack (stack: QuoteOpener[], heads: QuoteHeads, length: number) {\n while (stack.length > length) {\n const item = stack.pop()!\n if (item.isSingleQuote) {\n heads.single = item.prevSameQuoteIdx\n } else {\n heads.double = item.prevSameQuoteIdx\n }\n }\n}\n\nfunction addReplacement (\n replacements: ReplacementMap,\n tokenIdx: number,\n pos: number,\n ch: string\n) {\n if (!replacements[tokenIdx]) {\n replacements[tokenIdx] = []\n }\n\n replacements[tokenIdx].push({ pos, ch })\n}\n\nfunction applyReplacements (str: string, replacements: Replacement[]) {\n let result = ''\n let lastPos = 0\n\n replacements.sort((a, b) => a.pos - b.pos)\n\n for (let i = 0; i < replacements.length; i++) {\n const replacement = replacements[i]\n\n result += str.slice(lastPos, replacement.pos) + replacement.ch\n lastPos = replacement.pos + 1\n }\n\n return result + str.slice(lastPos)\n}\n\nfunction process_inlines (tokens: Token[], state: StateCore) {\n let j\n\n const stack: QuoteOpener[] = []\n const heads: QuoteHeads = { single: -1, double: -1 }\n // token index -> list of replacements in the original token content\n const replacements: ReplacementMap = {}\n\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i]\n\n const thisLevel = tokens[i].level\n\n for (j = stack.length - 1; j >= 0; j--) {\n if (stack[j].level <= thisLevel) { break }\n }\n truncateStack(stack, heads, j + 1)\n\n if (token.type !== 'text') { continue }\n\n const text = token.content\n let pos = 0\n const max = text.length\n\n /* eslint no-labels:0,block-scoped-var:0 */\n OUTER:\n while (pos < max) {\n QUOTE_RE.lastIndex = pos\n const t = QUOTE_RE.exec(text)\n if (!t) { break }\n\n let canOpen = true\n let canClose = true\n pos = t.index + 1\n const isSingle = (t[0] === \"'\")\n\n // Find previous character,\n // default to space if it's the beginning of the line\n //\n let lastChar = 0x20\n\n if (t.index - 1 >= 0) {\n lastChar = text.charCodeAt(t.index - 1)\n } else {\n for (j = i - 1; j >= 0; j--) {\n if (tokens[j].type === 'softbreak' || tokens[j].type === 'hardbreak') break // lastChar defaults to 0x20\n if (!tokens[j].content) continue // should skip all tokens except 'text', 'html_inline' or 'code_inline'\n\n lastChar = tokens[j].content.charCodeAt(tokens[j].content.length - 1)\n break\n }\n }\n\n // Find next character,\n // default to space if it's the end of the line\n //\n let nextChar = 0x20\n\n if (pos < max) {\n nextChar = text.charCodeAt(pos)\n } else {\n for (j = i + 1; j < tokens.length; j++) {\n if (tokens[j].type === 'softbreak' || tokens[j].type === 'hardbreak') break // nextChar defaults to 0x20\n if (!tokens[j].content) continue // should skip all tokens except 'text', 'html_inline' or 'code_inline'\n\n nextChar = tokens[j].content.charCodeAt(0)\n break\n }\n }\n\n const isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctCharCode(lastChar)\n const isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctCharCode(nextChar)\n\n const isLastWhiteSpace = isWhiteSpace(lastChar)\n const isNextWhiteSpace = isWhiteSpace(nextChar)\n\n if (isNextWhiteSpace) {\n canOpen = false\n } else if (isNextPunctChar) {\n if (!(isLastWhiteSpace || isLastPunctChar)) {\n canOpen = false\n }\n }\n\n if (isLastWhiteSpace) {\n canClose = false\n } else if (isLastPunctChar) {\n if (!(isNextWhiteSpace || isNextPunctChar)) {\n canClose = false\n }\n }\n\n if (nextChar === 0x22 /* \" */ && t[0] === '\"') {\n if (lastChar >= 0x30 /* 0 */ && lastChar <= 0x39 /* 9 */) {\n // special case: 1\"\" - count first quote as an inch\n canClose = canOpen = false\n }\n }\n\n if (canOpen && canClose) {\n // Replace quotes in the middle of punctuation sequence, but not\n // in the middle of the words, i.e.:\n //\n // 1. foo \" bar \" baz - not replaced\n // 2. foo-\"-bar-\"-baz - replaced\n // 3. foo\"bar\"baz - not replaced\n //\n canOpen = isLastPunctChar\n canClose = isNextPunctChar\n }\n\n if (!canOpen && !canClose) {\n // middle of word\n if (isSingle) {\n addReplacement(replacements, i, t.index, APOSTROPHE)\n }\n continue\n }\n\n if (canClose) {\n // Stack levels never decrease, so an opener of this type below\n // the current level means there is no match\n j = isSingle ? heads.single : heads.double\n if (j >= 0 && stack[j].level === thisLevel) {\n const item = stack[j]\n\n let openQuote\n let closeQuote\n if (isSingle) {\n openQuote = state.md.options.quotes[2]\n closeQuote = state.md.options.quotes[3]\n } else {\n openQuote = state.md.options.quotes[0]\n closeQuote = state.md.options.quotes[1]\n }\n\n addReplacement(replacements, i, t.index, closeQuote)\n addReplacement(replacements, item.tokenIdx, item.contentPos, openQuote)\n\n truncateStack(stack, heads, j)\n continue OUTER\n }\n }\n\n if (canOpen) {\n if (stack.length >= MAX_OPENERS) { return }\n stack.push({\n tokenIdx: i,\n contentPos: t.index,\n isSingleQuote: isSingle,\n level: thisLevel,\n prevSameQuoteIdx: isSingle ? heads.single : heads.double\n })\n if (isSingle) {\n heads.single = stack.length - 1\n } else {\n heads.double = stack.length - 1\n }\n } else if (canClose && isSingle) {\n addReplacement(replacements, i, t.index, APOSTROPHE)\n }\n }\n }\n\n Object.keys(replacements).forEach(function (tokenIdx) {\n const idx = Number(tokenIdx)\n tokens[idx].content = applyReplacements(tokens[idx].content, replacements[tokenIdx])\n })\n}\n\nexport default function smartquotes (state: StateCore): void {\n /* eslint max-depth:0 */\n if (!state.md.options.typographer) { return }\n\n for (let blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) {\n if (state.tokens[blkIdx].type !== 'inline' ||\n !QUOTE_TEST_RE.test(state.tokens[blkIdx].content)) {\n continue\n }\n\n process_inlines(state.tokens[blkIdx].children!, state)\n }\n}\n","// Join raw text tokens with the rest of the text\n//\n// This is set as a separate rule to provide an opportunity for plugins\n// to run text replacements after text join, but before escape join.\n//\n// For example, `\\:)` shouldn't be replaced with an emoji.\n//\n\nimport type StateCore from './state_core.ts'\nimport type Token from '../token.ts'\n\nfunction join_alt (tokens: Token[]): void {\n let curr, last\n const max = tokens.length\n\n for (curr = 0; curr < max; curr++) {\n if (tokens[curr].type === 'text_special') tokens[curr].type = 'text'\n }\n\n for (curr = last = 0; curr < max; curr++) {\n if (tokens[curr].type === 'text' &&\n curr + 1 < max &&\n tokens[curr + 1].type === 'text') {\n tokens[curr + 1].content = tokens[curr].content + tokens[curr + 1].content\n } else {\n if (curr !== last) { tokens[last] = tokens[curr] }\n\n last++\n }\n }\n\n if (curr !== last) tokens.length = last\n}\n\nexport default function text_join (state: StateCore): void {\n let curr, last\n const blockTokens = state.tokens\n const l = blockTokens.length\n\n for (let j = 0; j < l; j++) {\n if (blockTokens[j].type !== 'inline') continue\n\n const tokens = blockTokens[j].children!\n const max = tokens.length\n\n for (curr = 0; curr < max; curr++) {\n if (tokens[curr].type === 'text_special') tokens[curr].type = 'text'\n\n // image `alt` is parsed into its own token tree\n if (tokens[curr].children) join_alt(tokens[curr].children!)\n }\n\n for (curr = last = 0; curr < max; curr++) {\n if (tokens[curr].type === 'text' &&\n curr + 1 < max &&\n tokens[curr + 1].type === 'text') {\n // collapse two adjacent text nodes\n tokens[curr + 1].content = tokens[curr].content + tokens[curr + 1].content\n } else {\n if (curr !== last) { tokens[last] = tokens[curr] }\n\n last++\n }\n }\n\n if (curr !== last) tokens.length = last\n }\n}\n","import Ruler from './ruler.ts'\nimport StateCore from './rules_core/state_core.ts'\n\nimport r_normalize from './rules_core/normalize.ts'\nimport r_block from './rules_core/block.ts'\nimport r_strip_references from './rules_core/strip_references.ts'\nimport r_inline from './rules_core/inline.ts'\nimport r_linkify from './rules_core/linkify.ts'\nimport r_replacements from './rules_core/replacements.ts'\nimport r_smartquotes from './rules_core/smartquotes.ts'\nimport r_text_join from './rules_core/text_join.ts'\n\nconst _rules: Array<[\n name: string,\n rule: (state: StateCore) => void\n]> = [\n ['normalize', r_normalize],\n ['block', r_block],\n ['strip_references', r_strip_references],\n ['inline', r_inline],\n ['linkify', r_linkify],\n ['replacements', r_replacements],\n ['smartquotes', r_smartquotes],\n // `text_join` finds `text_special` tokens (for escape sequences)\n // and joins them with the rest of the text\n ['text_join', r_text_join]\n]\n\n/**\n * Top-level rules executor. Glues block/inline parsers and does intermediate\n * transformations.\n */\nclass ParserCore {\n /**\n * {@link Ruler} instance. Keep configuration of core rules.\n */\n ruler = new Ruler<[StateCore], void>()\n\n State = StateCore\n\n constructor () {\n for (let i = 0; i < _rules.length; i++) {\n this.ruler.push(_rules[i][0], _rules[i][1])\n }\n }\n\n /**\n * Executes core chain rules.\n */\n process (state: StateCore): void {\n const rules = this.ruler.getRules('')\n\n for (let i = 0, l = rules.length; i < l; i++) {\n rules[i](state)\n }\n }\n}\n\nexport default ParserCore\n","import Token from '../token.ts'\nimport { isSpace } from '../common/utils.ts'\nimport type MarkdownIt from '../markdownit.ts'\nimport type { Env } from '../types.ts'\n\n/** Mutable state passed to block rules while tokenizing a source document. */\nclass StateBlock {\n declare src: string\n declare md: MarkdownIt\n declare env: Env\n declare tokens: Token[]\n\n bMarks: number[] = [] // line begin offsets for fast jumps\n eMarks: number[] = [] // line end offsets for fast jumps\n tShift: number[] = [] // offsets of the first non-space characters (tabs not expanded)\n sCount: number[] = [] // indents for each line (tabs expanded)\n\n // An amount of virtual spaces (tabs expanded) between beginning\n // of each line (bMarks) and real beginning of that line.\n //\n // It exists only as a hack because blockquotes override bMarks\n // losing information in the process.\n //\n // It's used only when expanding tabs, you can think about it as\n // an initial tab length, e.g. bsCount=21 applied to string `\\t123`\n // means first tab should be expanded to 4-21%4 === 3 spaces.\n //\n bsCount: number[] = []\n\n // block parser variables\n\n // required block content indent (for example, if we are\n // inside a list, it would be positioned after list marker)\n blkIndent = 0\n line = 0 // line index in src\n lineMax = 0 // lines count\n tight = false // loose/tight mode for lists\n listIndent = -1 // indent of the current list block (-1 if there isn't any)\n\n // can be 'blockquote', 'list', 'root', 'paragraph' or 'reference'\n // used in lists to determine if they interrupt a paragraph\n parentType = 'root'\n\n level = 0\n\n // re-export Token class to use in block rules\n Token = Token\n\n constructor (src: string, md: MarkdownIt, env: Env, tokens: Token[]) {\n this.src = src\n\n // link to parser instance\n this.md = md\n\n this.env = env\n\n //\n // Internal state vartiables\n //\n\n this.tokens = tokens\n\n // Create caches\n // Generate markers.\n const s = this.src\n\n for (let start = 0, pos = 0, indent = 0, offset = 0, len = s.length, indent_found = false; pos < len; pos++) {\n const ch = s.charCodeAt(pos)\n\n if (!indent_found) {\n if (isSpace(ch)) {\n indent++\n\n if (ch === 0x09) {\n offset += 4 - offset % 4\n } else {\n offset++\n }\n continue\n } else {\n indent_found = true\n }\n }\n\n if (ch === 0x0A || pos === len - 1) {\n if (ch !== 0x0A) { pos++ }\n this.bMarks.push(start)\n this.eMarks.push(pos)\n this.tShift.push(indent)\n this.sCount.push(offset)\n this.bsCount.push(0)\n\n indent_found = false\n indent = 0\n offset = 0\n start = pos + 1\n }\n }\n\n // Push fake entry to simplify cache bounds checks\n this.bMarks.push(s.length)\n this.eMarks.push(s.length)\n this.tShift.push(0)\n this.sCount.push(0)\n this.bsCount.push(0)\n\n this.lineMax = this.bMarks.length - 1 // don't count last fake line\n }\n\n // Push new token to \"stream\".\n //\n push (type: string, tag: string, nesting: -1 | 0 | 1): Token {\n const token = new Token(type, tag, nesting)\n token.block = true\n\n if (nesting < 0) this.level-- // closing tag\n token.level = this.level\n if (nesting > 0) this.level++ // opening tag\n\n this.tokens.push(token)\n return token\n }\n\n isEmpty (line: number): boolean {\n return this.bMarks[line] + this.tShift[line] >= this.eMarks[line]\n }\n\n skipEmptyLines (from: number): number {\n for (let max = this.lineMax; from < max; from++) {\n if (this.bMarks[from] + this.tShift[from] < this.eMarks[from]) {\n break\n }\n }\n return from\n }\n\n // Skip spaces from given position.\n skipSpaces (pos: number): number {\n for (let max = this.src.length; pos < max; pos++) {\n const ch = this.src.charCodeAt(pos)\n if (!isSpace(ch)) { break }\n }\n return pos\n }\n\n // Skip spaces from given position in reverse.\n skipSpacesBack (pos: number, min: number): number {\n if (pos <= min) { return pos }\n\n while (pos > min) {\n if (!isSpace(this.src.charCodeAt(--pos))) { return pos + 1 }\n }\n return pos\n }\n\n // Skip char codes from given position\n skipChars (pos: number, code: number): number {\n for (let max = this.src.length; pos < max; pos++) {\n if (this.src.charCodeAt(pos) !== code) { break }\n }\n return pos\n }\n\n // Skip char codes reverse from given position - 1\n skipCharsBack (pos: number, code: number, min: number): number {\n if (pos <= min) { return pos }\n\n while (pos > min) {\n if (code !== this.src.charCodeAt(--pos)) { return pos + 1 }\n }\n return pos\n }\n\n // cut lines range from source.\n getLines (begin: number, end: number, indent: number, keepLastLF: boolean): string {\n if (begin >= end) {\n return ''\n }\n\n const queue = new Array(end - begin)\n\n for (let i = 0, line = begin; line < end; line++, i++) {\n let lineIndent = 0\n const lineStart = this.bMarks[line]\n let first = lineStart\n let last\n\n if (line + 1 < end || keepLastLF) {\n // No need for bounds check because we have fake entry on tail.\n last = this.eMarks[line] + 1\n } else {\n last = this.eMarks[line]\n }\n\n while (first < last && lineIndent < indent) {\n const ch = this.src.charCodeAt(first)\n\n if (isSpace(ch)) {\n if (ch === 0x09) {\n lineIndent += 4 - (lineIndent + this.bsCount[line]) % 4\n } else {\n lineIndent++\n }\n } else if (first - lineStart < this.tShift[line]) {\n // patched tShift masked characters to look like spaces (blockquotes, list markers)\n lineIndent++\n } else {\n break\n }\n\n first++\n }\n\n if (lineIndent > indent) {\n // partially expanding tabs in code blocks, e.g '\\t\\tfoobar'\n // with indent=2 becomes ' \\tfoobar'\n queue[i] = new Array(lineIndent - indent + 1).join(' ') + this.src.slice(first, last)\n } else {\n queue[i] = this.src.slice(first, last)\n }\n }\n\n return queue.join('')\n }\n}\n\nexport default StateBlock\n","// GFM table, https://github.github.com/gfm/#tables-extension-\n\nimport { isSpace } from '../common/utils.ts'\nimport type StateBlock from './state_block.ts'\n\n// Limit the amount of empty autocompleted cells in a table,\n// see https://github.com/markdown-it/markdown-it/issues/1000,\n//\n// Both pulldown-cmark and commonmark-hs limit the number of cells this way to ~200k.\n// We set it to 65k, which can expand user input by a factor of x370\n// (256x256 square is 1.8kB expanded into 650kB).\nconst MAX_AUTOCOMPLETED_CELLS = 0x10000\n\nfunction getLine (state: StateBlock, line: number) {\n const pos = state.bMarks[line] + state.tShift[line]\n const max = state.eMarks[line]\n\n return state.src.slice(pos, max)\n}\n\nfunction escapedSplit (str: string) {\n const result = []\n const max = str.length\n\n let pos = 0\n let ch = str.charCodeAt(pos)\n let isEscaped = false\n let lastPos = 0\n let current = ''\n\n while (pos < max) {\n if (ch === 0x7c/* | */) {\n if (!isEscaped) {\n // pipe separating cells, '|'\n result.push(current + str.substring(lastPos, pos))\n current = ''\n lastPos = pos + 1\n } else {\n // escaped pipe, '\\|'\n current += str.substring(lastPos, pos - 1)\n lastPos = pos\n }\n }\n\n isEscaped = (ch === 0x5c/* \\ */)\n pos++\n\n ch = str.charCodeAt(pos)\n }\n\n result.push(current + str.substring(lastPos))\n\n return result\n}\n\nexport default function table (state: StateBlock, startLine: number, endLine: number, silent: boolean): boolean {\n // should have at least two lines\n if (startLine + 2 > endLine) { return false }\n\n let nextLine = startLine + 1\n\n if (state.sCount[nextLine] < state.blkIndent) { return false }\n\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[nextLine] - state.blkIndent >= 4) { return false }\n\n // first character of the second line should be '|', '-', ':',\n // and no other characters are allowed but spaces;\n // basically, this is the equivalent of /^[-:|][-:|\\s]*$/ regexp\n\n let pos = state.bMarks[nextLine] + state.tShift[nextLine]\n if (pos >= state.eMarks[nextLine]) { return false }\n\n const firstCh = state.src.charCodeAt(pos++)\n if (firstCh !== 0x7C/* | */ && firstCh !== 0x2D/* - */ && firstCh !== 0x3A/* : */) { return false }\n\n if (pos >= state.eMarks[nextLine]) { return false }\n\n const secondCh = state.src.charCodeAt(pos++)\n if (secondCh !== 0x7C/* | */ && secondCh !== 0x2D/* - */ && secondCh !== 0x3A/* : */ && !isSpace(secondCh)) {\n return false\n }\n\n // if first character is '-', then second character must not be a space\n // (due to parsing ambiguity with list)\n if (firstCh === 0x2D/* - */ && isSpace(secondCh)) { return false }\n\n while (pos < state.eMarks[nextLine]) {\n const ch = state.src.charCodeAt(pos)\n\n if (ch !== 0x7C/* | */ && ch !== 0x2D/* - */ && ch !== 0x3A/* : */ && !isSpace(ch)) { return false }\n\n pos++\n }\n\n let lineText = getLine(state, startLine + 1)\n let columns = lineText.split('|')\n const aligns = []\n for (let i = 0; i < columns.length; i++) {\n const t = columns[i].trim()\n if (!t) {\n // allow empty columns before and after table, but not in between columns;\n // e.g. allow ` |---| `, disallow ` ---||--- `\n if (i === 0 || i === columns.length - 1) {\n continue\n } else {\n return false\n }\n }\n\n if (!/^:?-+:?$/.test(t)) { return false }\n if (t.charCodeAt(t.length - 1) === 0x3A/* : */) {\n aligns.push(t.charCodeAt(0) === 0x3A/* : */ ? 'center' : 'right')\n } else if (t.charCodeAt(0) === 0x3A/* : */) {\n aligns.push('left')\n } else {\n aligns.push('')\n }\n }\n\n lineText = getLine(state, startLine).trim()\n if (lineText.indexOf('|') === -1) { return false }\n if (state.sCount[startLine] - state.blkIndent >= 4) { return false }\n columns = escapedSplit(lineText)\n if (columns.length && columns[0] === '') columns.shift()\n if (columns.length && columns[columns.length - 1] === '') columns.pop()\n\n // header row will define an amount of columns in the entire table,\n // and align row should be exactly the same (the rest of the rows can differ)\n const columnCount = columns.length\n if (columnCount === 0 || columnCount !== aligns.length) { return false }\n\n if (silent) { return true }\n\n const oldParentType = state.parentType\n state.parentType = 'table'\n\n // use 'blockquote' lists for termination because it's\n // the most similar to tables\n const terminatorRules = state.md.block.ruler.getRules('blockquote')\n\n const token_to = state.push('table_open', 'table', 1)\n const tableLines: [number, number] = [startLine, 0]\n token_to.map = tableLines\n\n const token_tho = state.push('thead_open', 'thead', 1)\n token_tho.map = [startLine, startLine + 1]\n\n const token_htro = state.push('tr_open', 'tr', 1)\n token_htro.map = [startLine, startLine + 1]\n\n for (let i = 0; i < columns.length; i++) {\n const token_ho = state.push('th_open', 'th', 1)\n if (aligns[i]) {\n token_ho.attrs = [['style', `text-align:${aligns[i]}`]]\n }\n\n const token_il = state.push('inline', '', 0)\n token_il.content = columns[i].trim()\n token_il.children = []\n\n state.push('th_close', 'th', -1)\n }\n\n state.push('tr_close', 'tr', -1)\n state.push('thead_close', 'thead', -1)\n\n let tbodyLines: [number, number] | undefined\n let autocompletedCells = 0\n\n for (nextLine = startLine + 2; nextLine < endLine; nextLine++) {\n if (state.sCount[nextLine] < state.blkIndent) { break }\n\n let terminate = false\n for (let i = 0, l = terminatorRules.length; i < l; i++) {\n if (terminatorRules[i](state, nextLine, endLine, true)) {\n terminate = true\n break\n }\n }\n\n if (terminate) { break }\n lineText = getLine(state, nextLine).trim()\n if (!lineText) { break }\n if (state.sCount[nextLine] - state.blkIndent >= 4) { break }\n columns = escapedSplit(lineText)\n if (columns.length && columns[0] === '') columns.shift()\n if (columns.length && columns[columns.length - 1] === '') columns.pop()\n\n // note: autocomplete count can be negative if user specifies more columns than header,\n // but that does not affect intended use (which is limiting expansion)\n autocompletedCells += columnCount - columns.length\n if (autocompletedCells > MAX_AUTOCOMPLETED_CELLS) { break }\n\n if (nextLine === startLine + 2) {\n const token_tbo = state.push('tbody_open', 'tbody', 1)\n token_tbo.map = tbodyLines = [startLine + 2, 0]\n }\n\n const token_tro = state.push('tr_open', 'tr', 1)\n token_tro.map = [nextLine, nextLine + 1]\n\n for (let i = 0; i < columnCount; i++) {\n const token_tdo = state.push('td_open', 'td', 1)\n if (aligns[i]) {\n token_tdo.attrs = [['style', `text-align:${aligns[i]}`]]\n }\n\n const token_il = state.push('inline', '', 0)\n token_il.content = columns[i] ? columns[i].trim() : ''\n token_il.children = []\n\n state.push('td_close', 'td', -1)\n }\n state.push('tr_close', 'tr', -1)\n }\n\n if (tbodyLines) {\n state.push('tbody_close', 'tbody', -1)\n tbodyLines[1] = nextLine\n }\n\n state.push('table_close', 'table', -1)\n tableLines[1] = nextLine\n\n state.parentType = oldParentType\n state.line = nextLine\n return true\n}\n","// Code block (4 spaces padded)\n\nimport type StateBlock from './state_block.ts'\n\nexport default function code (state: StateBlock, startLine: number, endLine: number/*, silent */): boolean {\n if (state.sCount[startLine] - state.blkIndent < 4) { return false }\n\n let nextLine = startLine + 1\n let last = nextLine\n\n while (nextLine < endLine) {\n if (state.isEmpty(nextLine)) {\n nextLine++\n continue\n }\n\n if (state.sCount[nextLine] - state.blkIndent >= 4) {\n nextLine++\n last = nextLine\n continue\n }\n break\n }\n\n state.line = last\n\n const token = state.push('code_block', 'code', 0)\n token.content = state.getLines(startLine, last, 4 + state.blkIndent, false) + '\\n'\n token.map = [startLine, state.line]\n\n return true\n}\n","// fences (``` lang, ~~~ lang)\n\nimport type StateBlock from './state_block.ts'\n\nexport default function fence (state: StateBlock, startLine: number, endLine: number, silent: boolean): boolean {\n let pos = state.bMarks[startLine] + state.tShift[startLine]\n let max = state.eMarks[startLine]\n\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[startLine] - state.blkIndent >= 4) { return false }\n\n if (pos + 3 > max) { return false }\n\n const marker = state.src.charCodeAt(pos)\n\n if (marker !== 0x7E/* ~ */ && marker !== 0x60 /* ` */) {\n return false\n }\n\n // scan marker length\n let mem = pos\n pos = state.skipChars(pos, marker)\n\n let len = pos - mem\n\n if (len < 3) { return false }\n\n const markup = state.src.slice(mem, pos)\n const params = state.src.slice(pos, max)\n\n if (marker === 0x60 /* ` */) {\n if (params.indexOf(String.fromCharCode(marker)) >= 0) {\n return false\n }\n }\n\n // Since start is found, we can report success here in validation mode\n if (silent) { return true }\n\n // search end of block\n let nextLine = startLine\n let haveEndMarker = false\n\n for (;;) {\n nextLine++\n if (nextLine >= endLine) {\n // unclosed block should be autoclosed by end of document.\n // also block seems to be autoclosed by end of parent\n break\n }\n\n pos = mem = state.bMarks[nextLine] + state.tShift[nextLine]\n max = state.eMarks[nextLine]\n\n if (pos < max && state.sCount[nextLine] < state.blkIndent) {\n // non-empty line with negative indent should stop the list:\n // - ```\n // test\n break\n }\n\n if (state.src.charCodeAt(pos) !== marker) { continue }\n\n if (state.sCount[nextLine] - state.blkIndent >= 4) {\n // closing fence should be indented less than 4 spaces\n continue\n }\n\n pos = state.skipChars(pos, marker)\n\n // closing code fence must be at least as long as the opening one\n if (pos - mem < len) { continue }\n\n // make sure tail has spaces only\n pos = state.skipSpaces(pos)\n\n if (pos < max) { continue }\n\n haveEndMarker = true\n // found!\n break\n }\n\n // If a fence has heading spaces, they should be removed from its inner block\n len = state.sCount[startLine]\n\n state.line = nextLine + (haveEndMarker ? 1 : 0)\n\n const token = state.push('fence', 'code', 0)\n token.info = params\n token.content = state.getLines(startLine + 1, nextLine, len, true)\n token.markup = markup\n token.map = [startLine, state.line]\n\n return true\n}\n","// Block quotes\n\nimport { isSpace } from '../common/utils.ts'\nimport type StateBlock from './state_block.ts'\n\nexport default function blockquote (state: StateBlock, startLine: number, endLine: number, silent: boolean): boolean {\n let pos = state.bMarks[startLine] + state.tShift[startLine]\n let max = state.eMarks[startLine]\n\n const oldLineMax = state.lineMax\n\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[startLine] - state.blkIndent >= 4) { return false }\n\n // check the block quote marker\n if (state.src.charCodeAt(pos) !== 0x3E/* > */) { return false }\n\n // we know that it's going to be a valid blockquote,\n // so no point trying to find the end of it in silent mode\n if (silent) { return true }\n\n const oldBMarks = []\n const oldBSCount = []\n const oldSCount = []\n const oldTShift = []\n\n const terminatorRules = state.md.block.ruler.getRules('blockquote')\n\n const oldParentType = state.parentType\n state.parentType = 'blockquote'\n let lastLineEmpty = false\n let nextLine\n\n // Search the end of the block\n //\n // Block ends with either:\n // 1. an empty line outside:\n // ```\n // > test\n //\n // ```\n // 2. an empty line inside:\n // ```\n // >\n // test\n // ```\n // 3. another tag:\n // ```\n // > test\n // - - -\n // ```\n for (nextLine = startLine; nextLine < endLine; nextLine++) {\n // check if it's outdented, i.e. it's inside list item and indented\n // less than said list item:\n //\n // ```\n // 1. anything\n // > current blockquote\n // 2. checking this line\n // ```\n const isOutdented = state.sCount[nextLine] < state.blkIndent\n\n pos = state.bMarks[nextLine] + state.tShift[nextLine]\n max = state.eMarks[nextLine]\n\n if (pos >= max) {\n // Case 1: line is not inside the blockquote, and this line is empty.\n break\n }\n\n if (state.src.charCodeAt(pos++) === 0x3E/* > */ && !isOutdented) {\n // This line is inside the blockquote.\n\n // set offset past spaces and \">\"\n let initial = state.sCount[nextLine] + 1\n let spaceAfterMarker\n let adjustTab\n\n // skip one optional space after '>'\n if (state.src.charCodeAt(pos) === 0x20 /* space */) {\n // ' > test '\n // ^ -- position start of line here:\n pos++\n initial++\n adjustTab = false\n spaceAfterMarker = true\n } else if (state.src.charCodeAt(pos) === 0x09 /* tab */) {\n spaceAfterMarker = true\n\n if ((state.bsCount[nextLine] + initial) % 4 === 3) {\n // ' >\\t test '\n // ^ -- position start of line here (tab has width===1)\n pos++\n initial++\n adjustTab = false\n } else {\n // ' >\\t test '\n // ^ -- position start of line here + shift bsCount slightly\n // to make extra space appear\n adjustTab = true\n }\n } else {\n spaceAfterMarker = false\n }\n\n let offset = initial\n oldBMarks.push(state.bMarks[nextLine])\n state.bMarks[nextLine] = pos\n\n while (pos < max) {\n const ch = state.src.charCodeAt(pos)\n\n if (isSpace(ch)) {\n if (ch === 0x09) {\n offset += 4 - (offset + state.bsCount[nextLine] + (adjustTab ? 1 : 0)) % 4\n } else {\n offset++\n }\n } else {\n break\n }\n\n pos++\n }\n\n lastLineEmpty = pos >= max\n\n oldBSCount.push(state.bsCount[nextLine])\n state.bsCount[nextLine] = state.sCount[nextLine] + 1 + (spaceAfterMarker ? 1 : 0)\n\n oldSCount.push(state.sCount[nextLine])\n state.sCount[nextLine] = offset - initial\n\n oldTShift.push(state.tShift[nextLine])\n state.tShift[nextLine] = pos - state.bMarks[nextLine]\n continue\n }\n\n // Case 2: line is not inside the blockquote, and the last line was empty.\n if (lastLineEmpty) { break }\n\n // Case 3: another tag found.\n let terminate = false\n for (let i = 0, l = terminatorRules.length; i < l; i++) {\n if (terminatorRules[i](state, nextLine, endLine, true)) {\n terminate = true\n break\n }\n }\n\n if (terminate) {\n // Quirk to enforce \"hard termination mode\" for paragraphs;\n // normally if you call `tokenize(state, startLine, nextLine)`,\n // paragraphs will look below nextLine for paragraph continuation,\n // but if blockquote is terminated by another tag, they shouldn't\n state.lineMax = nextLine\n\n if (state.blkIndent !== 0) {\n // state.blkIndent was non-zero, we now set it to zero,\n // so we need to re-calculate all offsets to appear as\n // if indent wasn't changed\n oldBMarks.push(state.bMarks[nextLine])\n oldBSCount.push(state.bsCount[nextLine])\n oldTShift.push(state.tShift[nextLine])\n oldSCount.push(state.sCount[nextLine])\n state.sCount[nextLine] -= state.blkIndent\n }\n\n break\n }\n\n oldBMarks.push(state.bMarks[nextLine])\n oldBSCount.push(state.bsCount[nextLine])\n oldTShift.push(state.tShift[nextLine])\n oldSCount.push(state.sCount[nextLine])\n\n // A negative indentation means that this is a paragraph continuation\n //\n state.sCount[nextLine] = -1\n }\n\n const oldIndent = state.blkIndent\n state.blkIndent = 0\n\n const token_o = state.push('blockquote_open', 'blockquote', 1)\n token_o.markup = '>'\n const lines: [number, number] = [startLine, 0]\n token_o.map = lines\n\n state.md.block.tokenize(state, startLine, nextLine)\n\n const token_c = state.push('blockquote_close', 'blockquote', -1)\n token_c.markup = '>'\n\n state.lineMax = oldLineMax\n state.parentType = oldParentType\n lines[1] = state.line\n\n // Restore original tShift; this might not be necessary since the parser\n // has already been here, but just to make sure we can do that.\n for (let i = 0; i < oldTShift.length; i++) {\n state.bMarks[i + startLine] = oldBMarks[i]\n state.tShift[i + startLine] = oldTShift[i]\n state.sCount[i + startLine] = oldSCount[i]\n state.bsCount[i + startLine] = oldBSCount[i]\n }\n state.blkIndent = oldIndent\n\n return true\n}\n","// Horizontal rule\n\nimport { isSpace } from '../common/utils.ts'\nimport type StateBlock from './state_block.ts'\n\nexport default function hr (state: StateBlock, startLine: number, endLine: number, silent: boolean): boolean {\n const max = state.eMarks[startLine]\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[startLine] - state.blkIndent >= 4) { return false }\n\n let pos = state.bMarks[startLine] + state.tShift[startLine]\n const marker = state.src.charCodeAt(pos++)\n\n // Check hr marker\n if (marker !== 0x2A/* * */ &&\n marker !== 0x2D/* - */ &&\n marker !== 0x5F/* _ */) {\n return false\n }\n\n // markers can be mixed with spaces, but there should be at least 3 of them\n\n let cnt = 1\n while (pos < max) {\n const ch = state.src.charCodeAt(pos++)\n if (ch !== marker && !isSpace(ch)) { return false }\n if (ch === marker) { cnt++ }\n }\n\n if (cnt < 3) { return false }\n\n if (silent) { return true }\n\n state.line = startLine + 1\n\n const token = state.push('hr', 'hr', 0)\n token.map = [startLine, state.line]\n token.markup = Array(cnt + 1).join(String.fromCharCode(marker))\n\n return true\n}\n","// Lists\n\nimport { isSpace } from '../common/utils.ts'\nimport type StateBlock from './state_block.ts'\n\n// Search `[-+*][\\n ]`, returns next pos after marker on success\n// or -1 on fail.\nfunction skipBulletListMarker (state: StateBlock, startLine: number) {\n const max = state.eMarks[startLine]\n let pos = state.bMarks[startLine] + state.tShift[startLine]\n\n const marker = state.src.charCodeAt(pos++)\n // Check bullet\n if (marker !== 0x2A/* * */ &&\n marker !== 0x2D/* - */ &&\n marker !== 0x2B/* + */) {\n return -1\n }\n\n if (pos < max) {\n const ch = state.src.charCodeAt(pos)\n\n if (!isSpace(ch)) {\n // \" -test \" - is not a list item\n return -1\n }\n }\n\n return pos\n}\n\n// Search `\\d+[.)][\\n ]`, returns next pos after marker on success\n// or -1 on fail.\nfunction skipOrderedListMarker (state: StateBlock, startLine: number) {\n const start = state.bMarks[startLine] + state.tShift[startLine]\n const max = state.eMarks[startLine]\n let pos = start\n\n // List marker should have at least 2 chars (digit + dot)\n if (pos + 1 >= max) { return -1 }\n\n let ch = state.src.charCodeAt(pos++)\n\n if (ch < 0x30/* 0 */ || ch > 0x39/* 9 */) { return -1 }\n\n for (;;) {\n // EOL -> fail\n if (pos >= max) { return -1 }\n\n ch = state.src.charCodeAt(pos++)\n\n if (ch >= 0x30/* 0 */ && ch <= 0x39/* 9 */) {\n // List marker should have no more than 9 digits\n // (prevents integer overflow in browsers)\n if (pos - start >= 10) { return -1 }\n\n continue\n }\n\n // found valid marker\n if (ch === 0x29/* ) */ || ch === 0x2e/* . */) {\n break\n }\n\n return -1\n }\n\n if (pos < max) {\n ch = state.src.charCodeAt(pos)\n\n if (!isSpace(ch)) {\n // \" 1.test \" - is not a list item\n return -1\n }\n }\n return pos\n}\n\nfunction markTightParagraphs (state: StateBlock, idx: number) {\n const level = state.level + 2\n\n for (let i = idx + 2, l = state.tokens.length - 2; i < l; i++) {\n if (state.tokens[i].level === level && state.tokens[i].type === 'paragraph_open') {\n state.tokens[i + 2].hidden = true\n state.tokens[i].hidden = true\n i += 2\n }\n }\n}\n\nexport default function list (state: StateBlock, startLine: number, endLine: number, silent: boolean): boolean {\n let max, pos, start, token\n let nextLine = startLine\n let tight = true\n\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[nextLine] - state.blkIndent >= 4) { return false }\n\n // Special case:\n // - item 1\n // - item 2\n // - item 3\n // - item 4\n // - this one is a paragraph continuation\n if (state.listIndent >= 0 &&\n state.sCount[nextLine] - state.listIndent >= 4 &&\n state.sCount[nextLine] < state.blkIndent) {\n return false\n }\n\n let isTerminatingParagraph = false\n\n // limit conditions when list can interrupt\n // a paragraph (validation mode only)\n if (silent && state.parentType === 'paragraph') {\n // Next list item should still terminate previous list item;\n //\n // This code can fail if plugins use blkIndent as well as lists,\n // but I hope the spec gets fixed long before that happens.\n //\n if (state.sCount[nextLine] >= state.blkIndent) {\n isTerminatingParagraph = true\n }\n }\n\n // Detect list type and position after marker\n let isOrdered\n let markerValue\n let posAfterMarker\n if ((posAfterMarker = skipOrderedListMarker(state, nextLine)) >= 0) {\n isOrdered = true\n start = state.bMarks[nextLine] + state.tShift[nextLine]\n markerValue = Number(state.src.slice(start, posAfterMarker - 1))\n\n // If we're starting a new ordered list right after\n // a paragraph, it should start with 1.\n if (isTerminatingParagraph && markerValue !== 1) return false\n } else if ((posAfterMarker = skipBulletListMarker(state, nextLine)) >= 0) {\n isOrdered = false\n } else {\n return false\n }\n\n // If we're starting a new unordered list right after\n // a paragraph, first line should not be empty.\n if (isTerminatingParagraph) {\n if (state.skipSpaces(posAfterMarker) >= state.eMarks[nextLine]) return false\n }\n\n // For validation mode we can terminate immediately\n if (silent) { return true }\n\n // We should terminate list on style change. Remember first one to compare.\n const markerCharCode = state.src.charCodeAt(posAfterMarker - 1)\n\n // Start list\n const listTokIdx = state.tokens.length\n\n if (isOrdered) {\n token = state.push('ordered_list_open', 'ol', 1)\n if (markerValue !== 1) {\n token.attrs = [['start', markerValue!]]\n }\n } else {\n token = state.push('bullet_list_open', 'ul', 1)\n }\n\n const listLines: [number, number] = [nextLine, 0]\n token.map = listLines\n token.markup = String.fromCharCode(markerCharCode)\n\n //\n // Iterate list items\n //\n\n let prevEmptyEnd = false\n const terminatorRules = state.md.block.ruler.getRules('list')\n\n const oldParentType = state.parentType\n state.parentType = 'list'\n\n while (nextLine < endLine) {\n pos = posAfterMarker\n max = state.eMarks[nextLine]\n\n const initial = state.sCount[nextLine] + posAfterMarker - (state.bMarks[nextLine] + state.tShift[nextLine])\n let offset = initial\n\n while (pos < max) {\n const ch = state.src.charCodeAt(pos)\n\n if (ch === 0x09) {\n offset += 4 - (offset + state.bsCount[nextLine]) % 4\n } else if (ch === 0x20) {\n offset++\n } else {\n break\n }\n\n pos++\n }\n\n const contentStart = pos\n let indentAfterMarker\n\n if (contentStart >= max) {\n // trimming space in \"- \\n 3\" case, indent is 1 here\n indentAfterMarker = 1\n } else {\n indentAfterMarker = offset - initial\n }\n\n // If we have more than 4 spaces, the indent is 1\n // (the rest is just indented code block)\n if (indentAfterMarker > 4) { indentAfterMarker = 1 }\n\n // \" - test\"\n // ^^^^^ - calculating total length of this thing\n const indent = initial + indentAfterMarker\n\n // Run subparser & write tokens\n token = state.push('list_item_open', 'li', 1)\n token.markup = String.fromCharCode(markerCharCode)\n const itemLines: [number, number] = [nextLine, 0]\n token.map = itemLines\n if (isOrdered) {\n token.info = state.src.slice(start, posAfterMarker - 1)\n }\n\n // change current state, then restore it after parser subcall\n const oldTight = state.tight\n const oldTShift = state.tShift[nextLine]\n const oldSCount = state.sCount[nextLine]\n\n // - example list\n // ^ listIndent position will be here\n // ^ blkIndent position will be here\n //\n const oldListIndent = state.listIndent\n state.listIndent = state.blkIndent\n state.blkIndent = indent\n\n state.tight = true\n state.tShift[nextLine] = contentStart - state.bMarks[nextLine]\n state.sCount[nextLine] = offset\n\n if (contentStart >= max && state.isEmpty(nextLine + 1)) {\n // workaround for this case\n // (list item is empty, list terminates before \"foo\"):\n // ~~~~~~~~\n // -\n //\n // foo\n // ~~~~~~~~\n state.line = Math.min(state.line + 2, endLine)\n } else {\n state.md.block.tokenize(state, nextLine, endLine)\n }\n\n // If any of list item is tight, mark list as tight\n if (!state.tight || prevEmptyEnd) {\n tight = false\n }\n // Item become loose if finish with empty line,\n // but we should filter last element, because it means list finish\n prevEmptyEnd = (state.line - nextLine) > 1 && state.isEmpty(state.line - 1)\n\n state.blkIndent = state.listIndent\n state.listIndent = oldListIndent\n state.tShift[nextLine] = oldTShift\n state.sCount[nextLine] = oldSCount\n state.tight = oldTight\n\n token = state.push('list_item_close', 'li', -1)\n token.markup = String.fromCharCode(markerCharCode)\n\n nextLine = state.line\n itemLines[1] = nextLine\n\n if (nextLine >= endLine) { break }\n\n //\n // Try to check if list is terminated or continued.\n //\n if (state.sCount[nextLine] < state.blkIndent) { break }\n\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[nextLine] - state.blkIndent >= 4) { break }\n\n // fail if terminating block found\n let terminate = false\n for (let i = 0, l = terminatorRules.length; i < l; i++) {\n if (terminatorRules[i](state, nextLine, endLine, true)) {\n terminate = true\n break\n }\n }\n if (terminate) { break }\n\n // fail if list has another type\n if (isOrdered) {\n posAfterMarker = skipOrderedListMarker(state, nextLine)\n if (posAfterMarker < 0) { break }\n start = state.bMarks[nextLine] + state.tShift[nextLine]\n } else {\n posAfterMarker = skipBulletListMarker(state, nextLine)\n if (posAfterMarker < 0) { break }\n }\n\n if (markerCharCode !== state.src.charCodeAt(posAfterMarker - 1)) { break }\n }\n\n // Finalize list\n if (isOrdered) {\n token = state.push('ordered_list_close', 'ol', -1)\n } else {\n token = state.push('bullet_list_close', 'ul', -1)\n }\n token.markup = String.fromCharCode(markerCharCode)\n\n listLines[1] = nextLine\n state.line = nextLine\n\n state.parentType = oldParentType\n\n // mark paragraphs tight if needed\n if (tight) {\n markTightParagraphs(state, listTokIdx)\n }\n\n return true\n}\n","import { isSpace, normalizeReference } from '../common/utils.ts'\nimport type StateBlock from './state_block.ts'\n\nexport default function reference (state: StateBlock, startLine: number, _endLine: number, silent: boolean): boolean {\n let pos = state.bMarks[startLine] + state.tShift[startLine]\n let max = state.eMarks[startLine]\n let nextLine = startLine + 1\n\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[startLine] - state.blkIndent >= 4) { return false }\n\n if (state.src.charCodeAt(pos) !== 0x5B/* [ */) { return false }\n\n function getNextLine (nextLine: number) {\n const endLine = state.lineMax\n\n if (nextLine >= endLine || state.isEmpty(nextLine)) {\n // empty line or end of input\n return null\n }\n\n let isContinuation = false\n\n // this would be a code block normally, but after paragraph\n // it's considered a lazy continuation regardless of what's there\n if (state.sCount[nextLine] - state.blkIndent > 3) { isContinuation = true }\n\n // quirk for blockquotes, this line should already be checked by that rule\n if (state.sCount[nextLine] < 0) { isContinuation = true }\n\n if (!isContinuation) {\n const terminatorRules = state.md.block.ruler.getRules('reference')\n const oldParentType = state.parentType\n state.parentType = 'reference'\n\n // Some tags can terminate paragraph without empty line.\n let terminate = false\n for (let i = 0, l = terminatorRules.length; i < l; i++) {\n if (terminatorRules[i](state, nextLine, endLine, true)) {\n terminate = true\n break\n }\n }\n\n state.parentType = oldParentType\n if (terminate) {\n // terminated by another block\n return null\n }\n }\n\n const pos = state.bMarks[nextLine] + state.tShift[nextLine]\n const max = state.eMarks[nextLine]\n\n // max + 1 explicitly includes the newline\n return state.src.slice(pos, max + 1)\n }\n\n let str = state.src.slice(pos, max + 1)\n\n max = str.length\n let labelEnd = -1\n\n for (pos = 1; pos < max; pos++) {\n const ch = str.charCodeAt(pos)\n if (ch === 0x5B /* [ */) {\n return false\n } else if (ch === 0x5D /* ] */) {\n labelEnd = pos\n break\n } else if (ch === 0x0A /* \\n */) {\n const lineContent = getNextLine(nextLine)\n if (lineContent !== null) {\n str += lineContent\n max = str.length\n nextLine++\n }\n } else if (ch === 0x5C /* \\ */) {\n pos++\n if (pos < max && str.charCodeAt(pos) === 0x0A) {\n const lineContent = getNextLine(nextLine)\n if (lineContent !== null) {\n str += lineContent\n max = str.length\n nextLine++\n }\n }\n }\n }\n\n if (labelEnd < 0 || str.charCodeAt(labelEnd + 1) !== 0x3A/* : */) { return false }\n\n // [label]: destination 'title'\n // ^^^ skip optional whitespace here\n for (pos = labelEnd + 2; pos < max; pos++) {\n const ch = str.charCodeAt(pos)\n if (ch === 0x0A) {\n const lineContent = getNextLine(nextLine)\n if (lineContent !== null) {\n str += lineContent\n max = str.length\n nextLine++\n }\n } else if (isSpace(ch)) {\n /* eslint no-empty:0 */\n } else {\n break\n }\n }\n\n // [label]: destination 'title'\n // ^^^^^^^^^^^ parse this\n const destRes = state.md.helpers.parseLinkDestination(str, pos, max)\n if (!destRes.ok) { return false }\n\n const href = state.md.normalizeLink(destRes.str)\n if (!state.md.validateLink(href)) { return false }\n\n pos = destRes.pos\n\n // save cursor state, we could require to rollback later\n const destEndPos = pos\n const destEndLineNo = nextLine\n\n // [label]: destination 'title'\n // ^^^ skipping those spaces\n const start = pos\n for (; pos < max; pos++) {\n const ch = str.charCodeAt(pos)\n if (ch === 0x0A) {\n const lineContent = getNextLine(nextLine)\n if (lineContent !== null) {\n str += lineContent\n max = str.length\n nextLine++\n }\n } else if (isSpace(ch)) {\n /* Nothing */\n } else {\n break\n }\n }\n\n // [label]: destination 'title'\n // ^^^^^^^ parse this\n let titleRes = state.md.helpers.parseLinkTitle(str, pos, max)\n while (titleRes.can_continue) {\n const lineContent = getNextLine(nextLine)\n if (lineContent === null) break\n str += lineContent\n pos = max\n max = str.length\n nextLine++\n titleRes = state.md.helpers.parseLinkTitle(str, pos, max, titleRes)\n }\n let title\n\n if (pos < max && start !== pos && titleRes.ok) {\n title = titleRes.str\n pos = titleRes.pos\n } else {\n title = ''\n pos = destEndPos\n nextLine = destEndLineNo\n }\n\n // skip trailing spaces until the rest of the line\n while (pos < max) {\n const ch = str.charCodeAt(pos)\n if (!isSpace(ch)) { break }\n pos++\n }\n\n if (pos < max && str.charCodeAt(pos) !== 0x0A) {\n if (title) {\n // garbage at the end of the line after title,\n // but it could still be a valid reference if we roll back\n title = ''\n pos = destEndPos\n nextLine = destEndLineNo\n while (pos < max) {\n const ch = str.charCodeAt(pos)\n if (!isSpace(ch)) { break }\n pos++\n }\n }\n }\n\n if (pos < max && str.charCodeAt(pos) !== 0x0A) {\n // garbage at the end of the line\n return false\n }\n\n const label = normalizeReference(str.slice(1, labelEnd))\n if (!label) {\n // CommonMark 0.20 disallows empty labels\n return false\n }\n\n // Reference can not terminate anything. This check is for safety only.\n /* istanbul ignore if */\n if (silent) { return true }\n\n if (typeof state.env.references === 'undefined') {\n state.env.references = {}\n }\n if (typeof state.env.references[label] === 'undefined') {\n state.env.references[label] = { title, href }\n }\n\n // Marks the place definition took in the source. Renders to nothing,\n // href/title stay in `env.references`.\n const token = state.push('reference_definition', '', 0)\n token.map = [startLine, nextLine]\n token.hidden = true\n\n const meta: Record<string, unknown> = Object.create(null)\n meta.label = label\n token.meta = meta\n\n state.line = nextLine\n return true\n}\n","// List of valid html blocks names, according to commonmark spec\n// https://spec.commonmark.org/0.30/#html-blocks\n\nexport default [\n 'address',\n 'article',\n 'aside',\n 'base',\n 'basefont',\n 'blockquote',\n 'body',\n 'caption',\n 'center',\n 'col',\n 'colgroup',\n 'dd',\n 'details',\n 'dialog',\n 'dir',\n 'div',\n 'dl',\n 'dt',\n 'fieldset',\n 'figcaption',\n 'figure',\n 'footer',\n 'form',\n 'frame',\n 'frameset',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'head',\n 'header',\n 'hr',\n 'html',\n 'iframe',\n 'legend',\n 'li',\n 'link',\n 'main',\n 'menu',\n 'menuitem',\n 'nav',\n 'noframes',\n 'ol',\n 'optgroup',\n 'option',\n 'p',\n 'param',\n 'search',\n 'section',\n 'summary',\n 'table',\n 'tbody',\n 'td',\n 'tfoot',\n 'th',\n 'thead',\n 'title',\n 'tr',\n 'track',\n 'ul'\n]\n","// Regexps to match html elements\n\nconst attr_name = '[a-zA-Z_:][a-zA-Z0-9:._-]*'\n\nconst unquoted = '[^\"\\'=<>`\\\\x00-\\\\x20]+'\nconst single_quoted = \"'[^']*'\"\nconst double_quoted = '\"[^\"]*\"'\n\nconst attr_value = `(?:${unquoted}|${single_quoted}|${double_quoted})`\n\nconst attribute = `(?:\\\\s+${attr_name}(?:\\\\s*=\\\\s*${attr_value})?)`\n\nconst open_tag = `<[A-Za-z][A-Za-z0-9\\\\-]*${attribute}*\\\\s*\\\\/?>`\n\nconst close_tag = '<\\\\/[A-Za-z][A-Za-z0-9\\\\-]*\\\\s*>'\nconst comment = '<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->'\nconst processing = '<[?][\\\\s\\\\S]*?[?]>'\nconst declaration = '<![A-Za-z][^>]*>'\nconst cdata = '<!\\\\[CDATA\\\\[[\\\\s\\\\S]*?\\\\]\\\\]>'\n\nconst HTML_TAG_RE = new RegExp(\n `^(?:${open_tag}|${close_tag}|${comment}|${processing}|${declaration}|${cdata})`\n)\nconst HTML_OPEN_CLOSE_TAG_RE = new RegExp(`^(?:${open_tag}|${close_tag})`)\n\nexport { HTML_TAG_RE, HTML_OPEN_CLOSE_TAG_RE }\n","// HTML block\n\nimport block_names from '../common/html_blocks.ts'\nimport { HTML_OPEN_CLOSE_TAG_RE } from '../common/html_re.ts'\nimport type StateBlock from './state_block.ts'\n\n// An array of opening and corresponding closing sequences for html tags,\n// last argument defines whether it can terminate a paragraph or not\n//\nconst HTML_SEQUENCES: Array<[\n open: RegExp,\n close: RegExp,\n canTerminateParagraph: boolean\n]> = [\n [/^<(script|pre|style|textarea)(?=(\\s|>|$))/i, /<\\/(script|pre|style|textarea)>/i, true],\n [/^<!--/, /-->/, true],\n [/^<\\?/, /\\?>/, true],\n [/^<![A-Za-z]/, />/, true],\n [/^<!\\[CDATA\\[/, /\\]\\]>/, true],\n [new RegExp(`^</?(${block_names.join('|')})(?=(\\\\s|/?>|$))`, 'i'), /^$/, true],\n [new RegExp(`${HTML_OPEN_CLOSE_TAG_RE.source}\\\\s*$`), /^$/, false]\n]\n\nexport default function html_block (state: StateBlock, startLine: number, endLine: number, silent: boolean): boolean {\n let pos = state.bMarks[startLine] + state.tShift[startLine]\n let max = state.eMarks[startLine]\n\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[startLine] - state.blkIndent >= 4) { return false }\n\n if (!state.md.options.html) { return false }\n\n if (state.src.charCodeAt(pos) !== 0x3C/* < */) { return false }\n\n let lineText = state.src.slice(pos, max)\n\n let i = 0\n for (; i < HTML_SEQUENCES.length; i++) {\n if (HTML_SEQUENCES[i][0].test(lineText)) { break }\n }\n if (i === HTML_SEQUENCES.length) { return false }\n\n if (silent) {\n // true if this sequence can be a terminator, false otherwise\n return HTML_SEQUENCES[i][2]\n }\n\n let nextLine = startLine + 1\n\n // Block types 6 and 7 (the only ones whose end condition is a blank line)\n // have `/^$/` as their closing regexp. For all other types (1-5, e.g.\n // `<!--` comments), a blank line is regular content and must not terminate\n // the block - it ends only when its closing sequence is found.\n const endsOnBlankLine = HTML_SEQUENCES[i][1].test('')\n\n // If we are here - we detected HTML block.\n // Let's roll down till block end.\n if (!HTML_SEQUENCES[i][1].test(lineText)) {\n for (; nextLine < endLine; nextLine++) {\n if (state.sCount[nextLine] < state.blkIndent) {\n // An outdented blank line shouldn't end a block that doesn't end on a\n // blank line (e.g. a `<!--` comment inside a list item). Such blocks\n // must continue until their closing sequence regardless of indent.\n if (endsOnBlankLine || !state.isEmpty(nextLine)) { break }\n }\n\n pos = state.bMarks[nextLine] + state.tShift[nextLine]\n max = state.eMarks[nextLine]\n lineText = state.src.slice(pos, max)\n\n if (HTML_SEQUENCES[i][1].test(lineText)) {\n if (lineText.length !== 0) { nextLine++ }\n break\n }\n }\n }\n\n state.line = nextLine\n\n const token = state.push('html_block', '', 0)\n token.map = [startLine, nextLine]\n token.content = state.getLines(startLine, nextLine, state.blkIndent, true)\n\n return true\n}\n","// heading (#, ##, ...)\n\nimport { isSpace, asciiTrim } from '../common/utils.ts'\nimport type StateBlock from './state_block.ts'\n\nexport default function heading (state: StateBlock, startLine: number, endLine: number, silent: boolean): boolean {\n let pos = state.bMarks[startLine] + state.tShift[startLine]\n let max = state.eMarks[startLine]\n\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[startLine] - state.blkIndent >= 4) { return false }\n\n let ch = state.src.charCodeAt(pos)\n\n if (ch !== 0x23/* # */ || pos >= max) { return false }\n\n // count heading level\n let level = 1\n ch = state.src.charCodeAt(++pos)\n while (ch === 0x23/* # */ && pos < max && level <= 6) {\n level++\n ch = state.src.charCodeAt(++pos)\n }\n\n if (level > 6 || (pos < max && !isSpace(ch))) { return false }\n\n if (silent) { return true }\n\n // Let's cut tails like ' ### ' from the end of string\n\n max = state.skipSpacesBack(max, pos)\n const tmp = state.skipCharsBack(max, 0x23, pos) // #\n if (tmp > pos && isSpace(state.src.charCodeAt(tmp - 1))) {\n max = tmp\n }\n\n state.line = startLine + 1\n\n const token_o = state.push('heading_open', `h${level}`, 1)\n token_o.markup = '########'.slice(0, level)\n token_o.map = [startLine, state.line]\n\n const token_i = state.push('inline', '', 0)\n token_i.content = asciiTrim(state.src.slice(pos, max))\n token_i.map = [startLine, state.line]\n token_i.children = []\n\n const token_c = state.push('heading_close', `h${level}`, -1)\n token_c.markup = '########'.slice(0, level)\n\n return true\n}\n","// lheading (---, ===)\n\nimport { asciiTrim } from '../common/utils.ts'\nimport type StateBlock from './state_block.ts'\n\nexport default function lheading (state: StateBlock, startLine: number, endLine: number/*, silent */): boolean {\n const terminatorRules = state.md.block.ruler.getRules('paragraph')\n\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[startLine] - state.blkIndent >= 4) { return false }\n\n const oldParentType = state.parentType\n state.parentType = 'paragraph' // use paragraph to match terminatorRules\n\n // jump line-by-line until empty one or EOF\n let level = 0\n let marker\n let nextLine = startLine + 1\n\n for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {\n // this would be a code block normally, but after paragraph\n // it's considered a lazy continuation regardless of what's there\n if (state.sCount[nextLine] - state.blkIndent > 3) { continue }\n\n //\n // Check for underline in setext header\n //\n if (state.sCount[nextLine] >= state.blkIndent) {\n let pos = state.bMarks[nextLine] + state.tShift[nextLine]\n const max = state.eMarks[nextLine]\n\n if (pos < max) {\n marker = state.src.charCodeAt(pos)\n\n if (marker === 0x2D/* - */ || marker === 0x3D/* = */) {\n pos = state.skipChars(pos, marker)\n pos = state.skipSpaces(pos)\n\n if (pos >= max) {\n level = (marker === 0x3D/* = */ ? 1 : 2)\n break\n }\n }\n }\n }\n\n // quirk for blockquotes, this line should already be checked by that rule\n if (state.sCount[nextLine] < 0) { continue }\n\n // Some tags can terminate paragraph without empty line.\n let terminate = false\n for (let i = 0, l = terminatorRules.length; i < l; i++) {\n if (terminatorRules[i](state, nextLine, endLine, true)) {\n terminate = true\n break\n }\n }\n if (terminate) { break }\n }\n\n if (!level) {\n // Didn't find valid underline\n state.parentType = oldParentType\n return false\n }\n\n const content = asciiTrim(state.getLines(startLine, nextLine, state.blkIndent, false))\n\n state.line = nextLine + 1\n\n const token_o = state.push('heading_open', `h${level}`, 1)\n token_o.markup = String.fromCharCode(marker!)\n token_o.map = [startLine, state.line]\n\n const token_i = state.push('inline', '', 0)\n token_i.content = content\n token_i.map = [startLine, state.line - 1]\n token_i.children = []\n\n const token_c = state.push('heading_close', `h${level}`, -1)\n token_c.markup = String.fromCharCode(marker!)\n\n state.parentType = oldParentType\n\n return true\n}\n","// Paragraph\n\nimport { asciiTrim } from '../common/utils.ts'\nimport type StateBlock from './state_block.ts'\n\nexport default function paragraph (state: StateBlock, startLine: number, endLine: number): boolean {\n const terminatorRules = state.md.block.ruler.getRules('paragraph')\n const oldParentType = state.parentType\n let nextLine = startLine + 1\n state.parentType = 'paragraph'\n\n // jump line-by-line until empty one or EOF\n for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {\n // this would be a code block normally, but after paragraph\n // it's considered a lazy continuation regardless of what's there\n if (state.sCount[nextLine] - state.blkIndent > 3) { continue }\n\n // quirk for blockquotes, this line should already be checked by that rule\n if (state.sCount[nextLine] < 0) { continue }\n\n // Some tags can terminate paragraph without empty line.\n let terminate = false\n for (let i = 0, l = terminatorRules.length; i < l; i++) {\n if (terminatorRules[i](state, nextLine, endLine, true)) {\n terminate = true\n break\n }\n }\n if (terminate) { break }\n }\n\n const content = asciiTrim(state.getLines(startLine, nextLine, state.blkIndent, false))\n\n state.line = nextLine\n\n const token_o = state.push('paragraph_open', 'p', 1)\n token_o.map = [startLine, state.line]\n\n const token_i = state.push('inline', '', 0)\n token_i.content = content\n token_i.map = [startLine, state.line]\n token_i.children = []\n\n state.push('paragraph_close', 'p', -1)\n\n state.parentType = oldParentType\n\n return true\n}\n","import Ruler from './ruler.ts'\nimport StateBlock from './rules_block/state_block.ts'\nimport type Token from './token.ts'\nimport type MarkdownIt from './markdownit.ts'\nimport type { Env } from './types.ts'\n\nimport r_table from './rules_block/table.ts'\nimport r_code from './rules_block/code.ts'\nimport r_fence from './rules_block/fence.ts'\nimport r_blockquote from './rules_block/blockquote.ts'\nimport r_hr from './rules_block/hr.ts'\nimport r_list from './rules_block/list.ts'\nimport r_reference from './rules_block/reference.ts'\nimport r_html_block from './rules_block/html_block.ts'\nimport r_heading from './rules_block/heading.ts'\nimport r_lheading from './rules_block/lheading.ts'\nimport r_paragraph from './rules_block/paragraph.ts'\n\nconst _rules: Array<[\n name: string,\n rule: (state: StateBlock, startLine: number, endLine: number, silent: boolean) => boolean,\n alt?: string[]\n]> = [\n // First 2 params - rule name & source. Secondary array - list of rules,\n // which can be terminated by this one.\n ['table', r_table, ['paragraph', 'reference']],\n ['code', r_code],\n ['fence', r_fence, ['paragraph', 'reference', 'blockquote', 'list']],\n ['blockquote', r_blockquote, ['paragraph', 'reference', 'blockquote', 'list']],\n ['hr', r_hr, ['paragraph', 'reference', 'blockquote', 'list']],\n ['list', r_list, ['paragraph', 'reference', 'blockquote']],\n ['reference', r_reference],\n ['html_block', r_html_block, ['paragraph', 'reference', 'blockquote']],\n ['heading', r_heading, ['paragraph', 'reference', 'blockquote']],\n ['lheading', r_lheading],\n ['paragraph', r_paragraph]\n]\n\n/**\n * Block-level tokenizer.\n */\nclass ParserBlock {\n /**\n * {@link Ruler} instance. Keep configuration of block rules.\n */\n ruler = new Ruler<[StateBlock, number, number, boolean], boolean>()\n\n State = StateBlock\n\n constructor () {\n for (let i = 0; i < _rules.length; i++) {\n this.ruler.push(_rules[i][0], _rules[i][1], { alt: (_rules[i][2] || []).slice() })\n }\n }\n\n // Generate tokens for input range\n //\n tokenize (state: StateBlock, startLine: number, endLine: number): void {\n const rules = this.ruler.getRules('')\n const len = rules.length\n const maxNesting = state.md.options.maxNesting\n let line = startLine\n let hasEmptyLines = false\n\n while (line < endLine) {\n state.line = line = state.skipEmptyLines(line)\n if (line >= endLine) { break }\n\n // Termination condition for nested calls.\n // Nested calls currently used for blockquotes & lists\n if (state.sCount[line] < state.blkIndent) { break }\n\n // If nesting level exceeded - skip tail to the end. That's not ordinary\n // situation and we should not care about content.\n if (state.level >= maxNesting) {\n state.line = endLine\n break\n }\n\n // Try all possible rules.\n // On success, rule should:\n //\n // - update `state.line`\n // - update `state.tokens`\n // - return true\n const prevLine = state.line\n let ok = false\n\n for (let i = 0; i < len; i++) {\n ok = rules[i](state, line, endLine, false)\n if (ok) {\n if (prevLine >= state.line) {\n throw new Error(\"block rule didn't increment state.line\")\n }\n break\n }\n }\n\n // this can only happen if user disables paragraph rule\n if (!ok) throw new Error('none of the block rules matched')\n\n // set state.tight if we had an empty line before current tag\n // i.e. latest empty line should not count\n state.tight = !hasEmptyLines\n\n // paragraph might \"eat\" one newline after it in nested lists\n if (state.isEmpty(state.line - 1)) {\n hasEmptyLines = true\n }\n\n line = state.line\n\n if (line < endLine && state.isEmpty(line)) {\n hasEmptyLines = true\n line++\n state.line = line\n }\n }\n }\n\n /**\n * Process input string and push block tokens into `outTokens`\n */\n parse (src: string, md: MarkdownIt, env: Env, outTokens: Token[]): void {\n if (!src) { return }\n\n const state = new this.State(src, md, env, outTokens)\n\n this.tokenize(state, state.line, state.lineMax)\n }\n}\n\nexport default ParserBlock\n","import Token from '../token.ts'\nimport { isWhiteSpace, isPunctCharCode, isMdAsciiPunct } from '../common/utils.ts'\nimport type MarkdownIt from '../markdownit.ts'\nimport type { Delimiter, Env } from '../types.ts'\n\n/** @inline */\ninterface ScannedDelimiters {\n can_open: boolean\n can_close: boolean\n length: number\n}\n\n/** @inline */\ntype StateTokenMeta = Record<string, unknown> & {\n delimiters?: Delimiter[]\n}\n\n/** Mutable state passed to inline rules while tokenizing inline content. */\nclass StateInline {\n declare src: string\n declare env: Env\n declare md: MarkdownIt\n declare tokens: Token[]\n declare tokens_meta: Array<StateTokenMeta | undefined>\n\n pos = 0\n declare posMax: number\n level = 0\n pending = ''\n pendingLevel = 0\n\n // Stores { start: end } pairs. Useful for backtrack\n // optimization of pairs parse (emphasis, strikes).\n cache: Record<number, number> = {}\n\n // backtick run length => position of its last run, built lazily on first use\n backticks: Record<number, number> = {}\n backticksScanned = false\n\n // Counter used to disable inline linkify-it execution\n // inside <a> and markdown links\n linkLevel = 0\n\n // List of emphasis-like delimiters for current tag\n delimiters: Delimiter[] = []\n\n // Stack of delimiter lists for upper level tags\n _prev_delimiters: Delimiter[][] = []\n\n // re-export Token class to use in block rules\n Token = Token\n\n constructor (src: string, md: MarkdownIt, env: Env, outTokens: Token[]) {\n this.src = src\n this.env = env\n this.md = md\n this.tokens = outTokens\n this.tokens_meta = Array(outTokens.length)\n\n this.posMax = this.src.length\n }\n\n // Flush pending text\n //\n pushPending (): Token {\n const token = new Token('text', '', 0)\n token.content = this.pending\n token.level = this.pendingLevel\n this.tokens.push(token)\n this.pending = ''\n return token\n }\n\n // Push new token to \"stream\".\n // If pending text exists - flush it as text token\n //\n push (type: string, tag: string, nesting: -1 | 0 | 1): Token {\n if (this.pending) {\n this.pushPending()\n }\n\n const token = new Token(type, tag, nesting)\n let token_meta = undefined\n\n if (nesting < 0) {\n // closing tag\n this.level--\n this.delimiters = this._prev_delimiters.pop()!\n }\n\n token.level = this.level\n\n if (nesting > 0) {\n // opening tag\n this.level++\n this._prev_delimiters.push(this.delimiters)\n this.delimiters = []\n token_meta = { delimiters: this.delimiters }\n }\n\n this.pendingLevel = this.level\n this.tokens.push(token)\n this.tokens_meta.push(token_meta)\n return token\n }\n\n // Scan a sequence of emphasis-like markers, and determine whether\n // it can start an emphasis sequence or end an emphasis sequence.\n //\n // - start - position to scan from (it should point at a valid marker);\n // - canSplitWord - determine if these markers can be found inside a word\n //\n scanDelims (start: number, canSplitWord: boolean): ScannedDelimiters {\n const max = this.posMax\n const marker = this.src.charCodeAt(start)\n\n // Astral characters below are combined manually, because .codePointAt()\n // does not guarantee numeric type output. And we don't wish JIT cache issues.\n // The broken surrogate pairs are evaluated as U+FFFD to prevent possible\n // crashes.\n\n let lastChar\n if (start === 0) {\n // treat beginning of the line as a whitespace\n lastChar = 0x20\n } else if (start === 1) {\n lastChar = this.src.charCodeAt(0)\n if ((lastChar & 0xF800) === 0xD800) { lastChar = 0xFFFD }\n } else {\n lastChar = this.src.charCodeAt(start - 1)\n if ((lastChar & 0xFC00) === 0xDC00) {\n // low surrogate => add high one, replace broken pair with U+FFFD\n const highSurr = this.src.charCodeAt(start - 2)\n lastChar = (highSurr & 0xFC00) === 0xD800\n ? 0x10000 + ((highSurr - 0xD800) << 10) + (lastChar - 0xDC00)\n : 0xFFFD\n } else if ((lastChar & 0xFC00) === 0xD800) {\n lastChar = 0xFFFD\n }\n }\n\n let pos = start\n while (pos < max && this.src.charCodeAt(pos) === marker) { pos++ }\n\n const count = pos - start\n\n // treat end of the line as a whitespace\n let nextChar = pos < max ? this.src.charCodeAt(pos) : 0x20\n if ((nextChar & 0xFC00) === 0xD800) {\n // high surrogate => add low one, replace broken pair with U+FFFD\n const lowSurr = this.src.charCodeAt(pos + 1)\n nextChar = (lowSurr & 0xFC00) === 0xDC00\n ? 0x10000 + ((nextChar - 0xD800) << 10) + (lowSurr - 0xDC00)\n : 0xFFFD\n } else if ((nextChar & 0xFC00) === 0xDC00) {\n nextChar = 0xFFFD\n }\n\n const isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctCharCode(lastChar)\n const isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctCharCode(nextChar)\n\n const isLastWhiteSpace = isWhiteSpace(lastChar)\n const isNextWhiteSpace = isWhiteSpace(nextChar)\n\n const left_flanking =\n !isNextWhiteSpace && (!isNextPunctChar || isLastWhiteSpace || isLastPunctChar)\n const right_flanking =\n !isLastWhiteSpace && (!isLastPunctChar || isNextWhiteSpace || isNextPunctChar)\n\n const can_open = left_flanking && (canSplitWord || !right_flanking || isLastPunctChar)\n const can_close = right_flanking && (canSplitWord || !left_flanking || isNextPunctChar)\n\n return { can_open, can_close, length: count }\n }\n}\n\nexport default StateInline\n","// Skip text characters for text token, place those to pending buffer\n// and increment current pos\n\nimport type StateInline from './state_inline.ts'\n\n// Rule to skip pure text\n// '{}$%@~+=:' reserved for extentions\n\n// !, \", #, $, %, &, ', (, ), *, +, ,, -, ., /, :, ;, <, =, >, ?, @, [, \\, ], ^, _, `, {, |, }, or ~\n\n// !!!! Don't confuse with \"Markdown ASCII Punctuation\" chars\n// http://spec.commonmark.org/0.15/#ascii-punctuation-character\nfunction isTerminatorChar (ch: number) {\n switch (ch) {\n case 0x0A/* \\n */:\n case 0x21/* ! */:\n case 0x23/* # */:\n case 0x24/* $ */:\n case 0x25/* % */:\n case 0x26/* & */:\n case 0x2A/* * */:\n case 0x2B/* + */:\n case 0x2D/* - */:\n case 0x3A/* : */:\n case 0x3C/* < */:\n case 0x3D/* = */:\n case 0x3E/* > */:\n case 0x40/* @ */:\n case 0x5B/* [ */:\n case 0x5C/* \\ */:\n case 0x5D/* ] */:\n case 0x5E/* ^ */:\n case 0x5F/* _ */:\n case 0x60/* ` */:\n case 0x7B/* { */:\n case 0x7D/* } */:\n case 0x7E/* ~ */:\n return true\n default:\n return false\n }\n}\n\nexport default function text (state: StateInline, silent: boolean): boolean {\n let pos = state.pos\n\n while (pos < state.posMax && !isTerminatorChar(state.src.charCodeAt(pos))) {\n pos++\n }\n\n if (pos === state.pos) { return false }\n\n if (!silent) { state.pending += state.src.slice(state.pos, pos) }\n\n state.pos = pos\n\n return true\n}\n\n// Alternative implementation, for memory.\n//\n// It costs 10% of performance, but allows extend terminators list, if place it\n// to `ParserInline` property. Probably, will switch to it sometime, such\n// flexibility required.\n\n/*\nvar TERMINATOR_RE = /[\\n!#$%&*+\\-:<=>@[\\\\\\]^_`{}~]/;\n\nmodule.exports = function text(state, silent) {\n var pos = state.pos,\n idx = state.src.slice(pos).search(TERMINATOR_RE);\n\n // first char is terminator -> empty text\n if (idx === 0) { return false; }\n\n // no terminator -> text till end of string\n if (idx < 0) {\n if (!silent) { state.pending += state.src.slice(pos); }\n state.pos = state.src.length;\n return true;\n }\n\n if (!silent) { state.pending += state.src.slice(pos, pos + idx); }\n\n state.pos += idx;\n\n return true;\n}; */\n","// Early process links like https://example.org/ to have priority\n// over emphasis, etc.\n\nimport type StateInline from './state_inline.ts'\n\n// RFC3986: scheme = ALPHA *( ALPHA / DIGIT / \"+\" / \"-\" / \".\" )\nfunction isAsciiAlpha (code: number): boolean {\n return (code >= 0x41 && code <= 0x5A) || (code >= 0x61 && code <= 0x7A)\n}\n\nfunction isSchemeChar (code: number): boolean {\n return (code >= 0x41 && code <= 0x5A) ||\n (code >= 0x61 && code <= 0x7A) ||\n (code >= 0x30 && code <= 0x39) ||\n code === 0x2B || code === 0x2D || code === 0x2E\n}\n\nexport default function linkify (state: StateInline, silent: boolean): boolean {\n if (!state.md.options.linkify) return false\n if (state.linkLevel > 0) return false\n\n const pos = state.pos\n const max = state.posMax\n\n if (pos + 3 > max) return false\n if (state.src.charCodeAt(pos) !== 0x3A/* : */) return false\n if (state.src.charCodeAt(pos + 1) !== 0x2F/* / */) return false\n if (state.src.charCodeAt(pos + 2) !== 0x2F/* / */) return false\n\n // Search backwards for the scheme, but no more than 10 characters, the length\n // of the pending string, or the length of the source prefix.\n // Use state.src instead of state.pending because it is faster to access.\n const protoMin = pos - Math.min(10, state.pending.length, pos)\n let protoStart = pos\n while (protoStart > protoMin && isSchemeChar(state.src.charCodeAt(protoStart - 1))) {\n protoStart--\n }\n\n if (protoStart === pos || !isAsciiAlpha(state.src.charCodeAt(protoStart))) return false\n\n const protoLength = pos - protoStart\n\n const link = state.md.linkify.matchAtStart(state.src.slice(protoStart))\n if (!link) return false\n\n let url = link.url\n\n // invalid link, but still detected by linkify somehow;\n // need to check to prevent infinite loop below\n if (url.length <= protoLength) return false\n\n // disallow '*' at the end of the link (conflicts with emphasis)\n // do manual backsearch to avoid perf issues with regex /\\*+$/ on \"****...****a\".\n let urlEnd = url.length\n while (urlEnd > 0 && url.charCodeAt(urlEnd - 1) === 0x2A/* * */) {\n urlEnd--\n }\n if (urlEnd !== url.length) {\n url = url.slice(0, urlEnd)\n }\n\n const fullUrl = state.md.normalizeLink(url)\n if (!state.md.validateLink(fullUrl)) return false\n\n if (!silent) {\n state.pending = state.pending.slice(0, -protoLength)\n\n const token_o = state.push('link_open', 'a', 1)\n token_o.attrs = [['href', fullUrl]]\n token_o.markup = 'linkify'\n token_o.info = 'auto'\n\n const token_t = state.push('text', '', 0)\n token_t.content = state.md.normalizeLinkText(url)\n\n const token_c = state.push('link_close', 'a', -1)\n token_c.markup = 'linkify'\n token_c.info = 'auto'\n }\n\n state.pos += url.length - protoLength\n return true\n}\n","// Proceess '\\n'\n\nimport { isSpace } from '../common/utils.ts'\nimport type StateInline from './state_inline.ts'\n\nexport default function newline (state: StateInline, silent: boolean): boolean {\n let pos = state.pos\n\n if (state.src.charCodeAt(pos) !== 0x0A/* \\n */) { return false }\n\n const pmax = state.pending.length - 1\n const max = state.posMax\n\n // ' \\n' -> hardbreak\n // Lookup in pending chars is bad practice! Don't copy to other rules!\n // Pending string is stored in concat mode, indexed lookups will cause\n // convertion to flat mode.\n if (!silent) {\n if (pmax >= 0 && state.pending.charCodeAt(pmax) === 0x20) {\n if (pmax >= 1 && state.pending.charCodeAt(pmax - 1) === 0x20) {\n // Find whitespaces tail of pending chars.\n let ws = pmax - 1\n while (ws >= 1 && state.pending.charCodeAt(ws - 1) === 0x20) ws--\n\n state.pending = state.pending.slice(0, ws)\n state.push('hardbreak', 'br', 0)\n } else {\n state.pending = state.pending.slice(0, -1)\n state.push('softbreak', 'br', 0)\n }\n } else {\n state.push('softbreak', 'br', 0)\n }\n }\n\n pos++\n\n // skip heading spaces for next line\n while (pos < max && isSpace(state.src.charCodeAt(pos))) { pos++ }\n\n state.pos = pos\n return true\n}\n","// Process escaped chars and hardbreaks\n\nimport { isSpace } from '../common/utils.ts'\nimport type StateInline from './state_inline.ts'\n\nconst ESCAPED: number[] = []\n\nfor (let i = 0; i < 256; i++) { ESCAPED.push(0) }\n\n'\\\\!\"#$%&\\'()*+,./:;<=>?@[]^_`{|}~-'\n .split('').forEach(function (ch) { ESCAPED[ch.charCodeAt(0)] = 1 })\n\nexport default function escape (state: StateInline, silent: boolean): boolean {\n let pos = state.pos\n const max = state.posMax\n\n if (state.src.charCodeAt(pos) !== 0x5C/* \\ */) return false\n pos++\n\n // '\\' at the end of the inline block\n if (pos >= max) return false\n\n let ch1 = state.src.charCodeAt(pos)\n\n if (ch1 === 0x0A) {\n if (!silent) {\n state.push('hardbreak', 'br', 0)\n }\n\n pos++\n // skip leading whitespaces from next line\n while (pos < max) {\n ch1 = state.src.charCodeAt(pos)\n if (!isSpace(ch1)) break\n pos++\n }\n\n state.pos = pos\n return true\n }\n\n // '\\' before a space is a literal backslash. Don't consume the space, so a\n // trailing two-space hard line break is still detected by the newline rule.\n if (ch1 === 0x20) {\n if (!silent) {\n const token = state.push('text_special', '', 0)\n token.content = '\\\\'\n token.markup = '\\\\'\n token.info = 'escape'\n }\n\n state.pos = pos\n return true\n }\n\n let escapedStr = state.src[pos]\n\n if (ch1 >= 0xD800 && ch1 <= 0xDBFF && pos + 1 < max) {\n const ch2 = state.src.charCodeAt(pos + 1)\n\n if (ch2 >= 0xDC00 && ch2 <= 0xDFFF) {\n escapedStr += state.src[pos + 1]\n pos++\n }\n }\n\n const origStr = '\\\\' + escapedStr\n\n if (!silent) {\n const token = state.push('text_special', '', 0)\n\n if (ch1 < 256 && ESCAPED[ch1] !== 0) {\n token.content = escapedStr\n } else {\n token.content = origStr\n }\n\n token.markup = origStr\n token.info = 'escape'\n }\n\n state.pos = pos + 1\n return true\n}\n","// Parse backticks\n\nimport type StateInline from './state_inline.ts'\n\n// Position of the last backtick run of each length. Derived from the string in\n// one pass, so unlike an incremental cache it never depends on how the parser\n// walks it, and stays valid across lookaheads and narrowed ranges.\nfunction buildLastRuns (src: string): Record<number, number> {\n const lastRuns: Record<number, number> = {}\n let pos = 0\n\n while ((pos = src.indexOf('`', pos)) !== -1) {\n const start = pos\n while (src.charCodeAt(++pos) === 0x60/* ` */) { /* scan run length */ }\n lastRuns[pos - start] = start\n }\n\n return lastRuns\n}\n\nexport default function backtick (state: StateInline, silent: boolean): boolean {\n const start = state.pos\n\n if (state.src.charCodeAt(start) !== 0x60/* ` */) { return false }\n\n const max = state.posMax\n let pos = start + 1\n\n // scan marker length\n while (pos < max && state.src.charCodeAt(pos) === 0x60/* ` */) { pos++ }\n\n const marker = state.src.slice(start, pos)\n const openerLength = marker.length\n\n if (!state.backticksScanned) {\n state.backticks = buildLastRuns(state.src)\n state.backticksScanned = true\n }\n\n // Nothing of the same length left in the string, so no closer can exist\n if ((state.backticks[openerLength] ?? -1) >= pos) {\n let matchEnd = pos\n let matchStart\n\n while ((matchStart = state.src.indexOf('`', matchEnd)) !== -1 && matchStart < max) {\n // Measure the whole run, not just its part inside the current range,\n // otherwise a run straddling `max` would be mistaken for a shorter one\n matchEnd = matchStart + 1\n while (state.src.charCodeAt(matchEnd) === 0x60/* ` */) { matchEnd++ }\n\n if (matchEnd > max) break\n\n if (matchEnd - matchStart === openerLength) {\n if (!silent) {\n const token = state.push('code_inline', 'code', 0)\n token.markup = marker\n let content = state.src.slice(pos, matchStart).replace(/\\n/g, ' ')\n\n // Strip one space from each side, unless the content is all spaces\n if (content.startsWith(' ') && content.endsWith(' ') && /[^ ]/.test(content)) {\n content = content.slice(1, -1)\n }\n\n token.content = content\n }\n state.pos = matchEnd\n return true\n }\n }\n }\n\n if (!silent) state.pending += marker\n state.pos = pos\n return true\n}\n","// ~~strike through~~\n//\n\nimport type { Delimiter } from '../types.ts'\nimport type StateInline from './state_inline.ts'\n\n// Insert each marker as a separate text token, and add it to delimiter list\n//\nfunction strikethrough_tokenize (state: StateInline, silent: boolean): boolean {\n const start = state.pos\n const marker = state.src.charCodeAt(start)\n\n if (silent) { return false }\n\n if (marker !== 0x7E/* ~ */) { return false }\n\n const scanned = state.scanDelims(state.pos, true)\n let len = scanned.length\n const ch = String.fromCharCode(marker)\n\n if (len < 2) { return false }\n\n let token\n\n if (len % 2) {\n token = state.push('text', '', 0)\n token.content = ch\n len--\n }\n\n for (let i = 0; i < len; i += 2) {\n token = state.push('text', '', 0)\n token.content = ch + ch\n\n state.delimiters.push({\n marker,\n length: 0, // disable \"rule of 3\" length checks meant for emphasis\n token: state.tokens.length - 1,\n end: -1,\n open: scanned.can_open,\n close: scanned.can_close\n })\n }\n\n state.pos += scanned.length\n\n return true\n}\n\nfunction postProcess (state: StateInline, delimiters: Delimiter[]) {\n let token\n const loneMarkers = []\n const max = delimiters.length\n\n for (let i = 0; i < max; i++) {\n const startDelim = delimiters[i]\n\n if (startDelim.marker !== 0x7E/* ~ */) {\n continue\n }\n\n if (startDelim.end === -1) {\n continue\n }\n\n const endDelim = delimiters[startDelim.end]\n\n token = state.tokens[startDelim.token]\n token.type = 's_open'\n token.tag = 's'\n token.nesting = 1\n token.markup = '~~'\n token.content = ''\n\n token = state.tokens[endDelim.token]\n token.type = 's_close'\n token.tag = 's'\n token.nesting = -1\n token.markup = '~~'\n token.content = ''\n\n if (state.tokens[endDelim.token - 1].type === 'text' &&\n state.tokens[endDelim.token - 1].content === '~') {\n loneMarkers.push(endDelim.token - 1)\n }\n }\n\n // If a marker sequence has an odd number of characters, it's splitted\n // like this: `~~~~~` -> `~` + `~~` + `~~`, leaving one marker at the\n // start of the sequence.\n //\n // So, we have to move all those markers after subsequent s_close tags.\n //\n while (loneMarkers.length) {\n const i = loneMarkers.pop()!\n let j = i + 1\n\n while (j < state.tokens.length && state.tokens[j].type === 's_close') {\n j++\n }\n\n j--\n\n if (i !== j) {\n token = state.tokens[j]\n state.tokens[j] = state.tokens[i]\n state.tokens[i] = token\n }\n }\n}\n\n// Walk through delimiter list and replace text tokens with tags\n//\nfunction strikethrough_postProcess (state: StateInline): void {\n const tokens_meta = state.tokens_meta\n const max = state.tokens_meta.length\n\n postProcess(state, state.delimiters)\n\n for (let curr = 0; curr < max; curr++) {\n const delimiters = tokens_meta[curr]?.delimiters\n if (delimiters) {\n postProcess(state, delimiters)\n }\n }\n}\n\nexport default {\n tokenize: strikethrough_tokenize,\n postProcess: strikethrough_postProcess\n}\n","// Process *this* and _that_\n//\n\nimport type { Delimiter } from '../types.ts'\nimport type StateInline from './state_inline.ts'\n\n// Insert each marker as a separate text token, and add it to delimiter list\n//\nfunction emphasis_tokenize (state: StateInline, silent: boolean): boolean {\n const start = state.pos\n const marker = state.src.charCodeAt(start)\n\n if (silent) { return false }\n\n if (marker !== 0x5F /* _ */ && marker !== 0x2A /* * */) { return false }\n\n const scanned = state.scanDelims(state.pos, marker === 0x2A)\n\n for (let i = 0; i < scanned.length; i++) {\n const token = state.push('text', '', 0)\n token.content = String.fromCharCode(marker)\n\n state.delimiters.push({\n // Char code of the starting marker (number).\n //\n marker,\n\n // Total length of these series of delimiters.\n //\n length: scanned.length,\n\n // A position of the token this delimiter corresponds to.\n //\n token: state.tokens.length - 1,\n\n // If this delimiter is matched as a valid opener, `end` will be\n // equal to its position, otherwise it's `-1`.\n //\n end: -1,\n\n // Boolean flags that determine if this delimiter could open or close\n // an emphasis.\n //\n open: scanned.can_open,\n close: scanned.can_close\n })\n }\n\n state.pos += scanned.length\n\n return true\n}\n\nfunction postProcess (state: StateInline, delimiters: Delimiter[]) {\n const max = delimiters.length\n\n for (let i = max - 1; i >= 0; i--) {\n const startDelim = delimiters[i]\n\n if (startDelim.marker !== 0x5F/* _ */ && startDelim.marker !== 0x2A/* * */) {\n continue\n }\n\n // Process only opening markers\n if (startDelim.end === -1) {\n continue\n }\n\n const endDelim = delimiters[startDelim.end]\n\n // If the previous delimiter has the same marker and is adjacent to this one,\n // merge those into one strong delimiter.\n //\n // `<em><em>whatever</em></em>` -> `<strong>whatever</strong>`\n //\n const isStrong = i > 0 &&\n delimiters[i - 1].end === startDelim.end + 1 &&\n // check that first two markers match and adjacent\n delimiters[i - 1].marker === startDelim.marker &&\n delimiters[i - 1].token === startDelim.token - 1 &&\n // check that last two markers are adjacent (we can safely assume they match)\n delimiters[startDelim.end + 1].token === endDelim.token + 1\n\n const ch = String.fromCharCode(startDelim.marker)\n\n const token_o = state.tokens[startDelim.token]\n token_o.type = isStrong ? 'strong_open' : 'em_open'\n token_o.tag = isStrong ? 'strong' : 'em'\n token_o.nesting = 1\n token_o.markup = isStrong ? ch + ch : ch\n token_o.content = ''\n\n const token_c = state.tokens[endDelim.token]\n token_c.type = isStrong ? 'strong_close' : 'em_close'\n token_c.tag = isStrong ? 'strong' : 'em'\n token_c.nesting = -1\n token_c.markup = isStrong ? ch + ch : ch\n token_c.content = ''\n\n if (isStrong) {\n state.tokens[delimiters[i - 1].token].content = ''\n state.tokens[delimiters[startDelim.end + 1].token].content = ''\n i--\n }\n }\n}\n\n// Walk through delimiter list and replace text tokens with tags\n//\nfunction emphasis_post_process (state: StateInline): void {\n const tokens_meta = state.tokens_meta\n const max = state.tokens_meta.length\n\n postProcess(state, state.delimiters)\n\n for (let curr = 0; curr < max; curr++) {\n const delimiters = tokens_meta[curr]?.delimiters\n if (delimiters) {\n postProcess(state, delimiters)\n }\n }\n}\n\nexport default {\n tokenize: emphasis_tokenize,\n postProcess: emphasis_post_process\n}\n","// Process [link](<to> \"stuff\")\n\nimport { normalizeReference, isSpace } from '../common/utils.ts'\nimport type StateInline from './state_inline.ts'\n\nexport default function link (state: StateInline, silent: boolean): boolean {\n let code, label, res, ref\n let href = ''\n let title = ''\n let start = state.pos\n let parseReference = true\n\n if (state.src.charCodeAt(state.pos) !== 0x5B/* [ */) { return false }\n\n const oldPos = state.pos\n const max = state.posMax\n const labelStart = state.pos + 1\n const labelEnd = state.md.helpers.parseLinkLabel(state, state.pos, true)\n\n // parser failed to find ']', so it's not a valid link\n if (labelEnd < 0) { return false }\n\n let pos = labelEnd + 1\n if (pos < max && state.src.charCodeAt(pos) === 0x28/* ( */) {\n //\n // Inline link\n //\n\n // might have found a valid shortcut link, disable reference parsing\n parseReference = false\n\n // [link]( <href> \"title\" )\n // ^^ skipping these spaces\n pos++\n for (; pos < max; pos++) {\n code = state.src.charCodeAt(pos)\n if (!isSpace(code) && code !== 0x0A) { break }\n }\n if (pos >= max) { return false }\n\n // [link]( <href> \"title\" )\n // ^^^^^^ parsing link destination\n start = pos\n res = state.md.helpers.parseLinkDestination(state.src, pos, state.posMax)\n if (res.ok) {\n href = state.md.normalizeLink(res.str)\n if (state.md.validateLink(href)) {\n pos = res.pos\n } else {\n href = ''\n }\n\n // [link]( <href> \"title\" )\n // ^^ skipping these spaces\n start = pos\n for (; pos < max; pos++) {\n code = state.src.charCodeAt(pos)\n if (!isSpace(code) && code !== 0x0A) { break }\n }\n\n // [link]( <href> \"title\" )\n // ^^^^^^^ parsing link title\n res = state.md.helpers.parseLinkTitle(state.src, pos, state.posMax)\n if (pos < max && start !== pos && res.ok) {\n title = res.str\n pos = res.pos\n\n // [link]( <href> \"title\" )\n // ^^ skipping these spaces\n for (; pos < max; pos++) {\n code = state.src.charCodeAt(pos)\n if (!isSpace(code) && code !== 0x0A) { break }\n }\n }\n }\n\n if (pos >= max || state.src.charCodeAt(pos) !== 0x29/* ) */) {\n // parsing a valid shortcut link failed, fallback to reference\n parseReference = true\n }\n pos++\n }\n\n if (parseReference) {\n //\n // Link reference\n //\n if (typeof state.env.references === 'undefined') { return false }\n\n if (pos < max && state.src.charCodeAt(pos) === 0x5B/* [ */) {\n start = pos + 1\n pos = state.md.helpers.parseLinkLabel(state, pos)\n if (pos >= 0) {\n label = state.src.slice(start, pos++)\n } else {\n pos = labelEnd + 1\n }\n } else {\n pos = labelEnd + 1\n }\n\n // covers label === '' and label === undefined\n // (collapsed reference link and shortcut reference link respectively)\n if (!label) { label = state.src.slice(labelStart, labelEnd) }\n\n label = normalizeReference(label)\n ref = state.env.references[label]\n if (!ref) {\n state.pos = oldPos\n return false\n }\n href = ref.href\n title = ref.title\n }\n\n //\n // We found the end of the link, and know for a fact it's a valid link;\n // so all that's left to do is to call tokenizer.\n //\n if (!silent) {\n state.pos = labelStart\n state.posMax = labelEnd\n\n const token_o = state.push('link_open', 'a', 1)\n const attrs: Array<[string, string]> = [['href', href]]\n token_o.attrs = attrs\n if (title) {\n attrs.push(['title', title])\n }\n if (label) {\n const meta: Record<string, unknown> = Object.create(null)\n meta.label = label\n token_o.meta = meta\n }\n\n state.linkLevel++\n state.md.inline.tokenize(state)\n state.linkLevel--\n\n state.push('link_close', 'a', -1)\n }\n\n state.pos = pos\n state.posMax = max\n return true\n}\n","// Process ![image](<src> \"title\")\n\nimport { normalizeReference, isSpace } from '../common/utils.ts'\nimport type Token from '../token.ts'\nimport type StateInline from './state_inline.ts'\n\nexport default function image (state: StateInline, silent: boolean): boolean {\n let code, content, label, pos, ref, res, title, start\n let href = ''\n const oldPos = state.pos\n const max = state.posMax\n\n if (state.src.charCodeAt(state.pos) !== 0x21/* ! */) { return false }\n if (state.src.charCodeAt(state.pos + 1) !== 0x5B/* [ */) { return false }\n\n const labelStart = state.pos + 2\n const labelEnd = state.md.helpers.parseLinkLabel(state, state.pos + 1, false)\n\n // parser failed to find ']', so it's not a valid link\n if (labelEnd < 0) { return false }\n\n pos = labelEnd + 1\n if (pos < max && state.src.charCodeAt(pos) === 0x28/* ( */) {\n //\n // Inline link\n //\n\n // [link]( <href> \"title\" )\n // ^^ skipping these spaces\n pos++\n for (; pos < max; pos++) {\n code = state.src.charCodeAt(pos)\n if (!isSpace(code) && code !== 0x0A) { break }\n }\n if (pos >= max) { return false }\n\n // [link]( <href> \"title\" )\n // ^^^^^^ parsing link destination\n start = pos\n res = state.md.helpers.parseLinkDestination(state.src, pos, state.posMax)\n if (res.ok) {\n href = state.md.normalizeLink(res.str)\n if (state.md.validateLink(href)) {\n pos = res.pos\n } else {\n href = ''\n }\n }\n\n // [link]( <href> \"title\" )\n // ^^ skipping these spaces\n start = pos\n for (; pos < max; pos++) {\n code = state.src.charCodeAt(pos)\n if (!isSpace(code) && code !== 0x0A) { break }\n }\n\n // [link]( <href> \"title\" )\n // ^^^^^^^ parsing link title\n res = state.md.helpers.parseLinkTitle(state.src, pos, state.posMax)\n if (pos < max && start !== pos && res.ok) {\n title = res.str\n pos = res.pos\n\n // [link]( <href> \"title\" )\n // ^^ skipping these spaces\n for (; pos < max; pos++) {\n code = state.src.charCodeAt(pos)\n if (!isSpace(code) && code !== 0x0A) { break }\n }\n } else {\n title = ''\n }\n\n if (pos >= max || state.src.charCodeAt(pos) !== 0x29/* ) */) {\n state.pos = oldPos\n return false\n }\n pos++\n } else {\n //\n // Link reference\n //\n if (typeof state.env.references === 'undefined') { return false }\n\n if (pos < max && state.src.charCodeAt(pos) === 0x5B/* [ */) {\n start = pos + 1\n pos = state.md.helpers.parseLinkLabel(state, pos)\n if (pos >= 0) {\n label = state.src.slice(start, pos++)\n } else {\n pos = labelEnd + 1\n }\n } else {\n pos = labelEnd + 1\n }\n\n // covers label === '' and label === undefined\n // (collapsed reference link and shortcut reference link respectively)\n if (!label) { label = state.src.slice(labelStart, labelEnd) }\n\n label = normalizeReference(label)\n ref = state.env.references[label]\n if (!ref) {\n state.pos = oldPos\n return false\n }\n href = ref.href\n title = ref.title\n }\n\n //\n // We found the end of the link, and know for a fact it's a valid link;\n // so all that's left to do is to call tokenizer.\n //\n if (!silent) {\n content = state.src.slice(labelStart, labelEnd)\n\n const tokens: Token[] = []\n state.md.inline.parse(\n content,\n state.md,\n state.env,\n tokens\n )\n\n const token = state.push('image', 'img', 0)\n const attrs: Array<[string, string]> = [['src', href], ['alt', '']]\n token.attrs = attrs\n token.children = tokens\n token.content = content\n\n if (title) {\n attrs.push(['title', title])\n }\n if (label) {\n const meta: Record<string, unknown> = Object.create(null)\n meta.label = label\n token.meta = meta\n }\n }\n\n state.pos = pos\n state.posMax = max\n return true\n}\n","// Process autolinks '<protocol:...>'\n\nimport type StateInline from './state_inline.ts'\n\n/* eslint max-len:0 */\nconst EMAIL_RE = /^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/\n/* eslint-disable-next-line no-control-regex */\nconst AUTOLINK_RE = /^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\\x00-\\x20]*)$/\n\nexport default function autolink (state: StateInline, silent: boolean): boolean {\n let pos = state.pos\n\n if (state.src.charCodeAt(pos) !== 0x3C/* < */) { return false }\n\n const start = state.pos\n const max = state.posMax\n\n for (;;) {\n if (++pos >= max) return false\n\n const ch = state.src.charCodeAt(pos)\n\n if (ch === 0x3C /* < */) return false\n if (ch === 0x3E /* > */) break\n }\n\n const url = state.src.slice(start + 1, pos)\n\n if (AUTOLINK_RE.test(url)) {\n const fullUrl = state.md.normalizeLink(url)\n if (!state.md.validateLink(fullUrl)) { return false }\n\n if (!silent) {\n const token_o = state.push('link_open', 'a', 1)\n token_o.attrs = [['href', fullUrl]]\n token_o.markup = 'autolink'\n token_o.info = 'auto'\n\n const token_t = state.push('text', '', 0)\n token_t.content = state.md.normalizeLinkText(url)\n\n const token_c = state.push('link_close', 'a', -1)\n token_c.markup = 'autolink'\n token_c.info = 'auto'\n }\n\n state.pos += url.length + 2\n return true\n }\n\n if (EMAIL_RE.test(url)) {\n const fullUrl = state.md.normalizeLink(`mailto:${url}`)\n if (!state.md.validateLink(fullUrl)) { return false }\n\n if (!silent) {\n const token_o = state.push('link_open', 'a', 1)\n token_o.attrs = [['href', fullUrl]]\n token_o.markup = 'autolink'\n token_o.info = 'auto'\n\n const token_t = state.push('text', '', 0)\n token_t.content = state.md.normalizeLinkText(url)\n\n const token_c = state.push('link_close', 'a', -1)\n token_c.markup = 'autolink'\n token_c.info = 'auto'\n }\n\n state.pos += url.length + 2\n return true\n }\n\n return false\n}\n","// Process html tags\n\nimport { HTML_TAG_RE } from '../common/html_re.ts'\nimport type StateInline from './state_inline.ts'\n\nfunction isLinkOpen (str: string) {\n return /^<a[>\\s]/i.test(str)\n}\nfunction isLinkClose (str: string) {\n return /^<\\/a\\s*>/i.test(str)\n}\n\nfunction isLetter (ch: number) {\n /* eslint no-bitwise:0 */\n const lc = ch | 0x20 // to lower case\n return (lc >= 0x61/* a */) && (lc <= 0x7a/* z */)\n}\n\nexport default function html_inline (state: StateInline, silent: boolean): boolean {\n if (!state.md.options.html) { return false }\n\n // Check start\n const max = state.posMax\n const pos = state.pos\n if (state.src.charCodeAt(pos) !== 0x3C/* < */ ||\n pos + 2 >= max) {\n return false\n }\n\n // Quick fail on second char\n const ch = state.src.charCodeAt(pos + 1)\n if (ch !== 0x21/* ! */ &&\n ch !== 0x3F/* ? */ &&\n ch !== 0x2F/* / */ &&\n !isLetter(ch)) {\n return false\n }\n\n const match = state.src.slice(pos).match(HTML_TAG_RE)\n if (!match) { return false }\n\n if (!silent) {\n const token = state.push('html_inline', '', 0)\n token.content = match[0]\n\n if (isLinkOpen(token.content)) state.linkLevel++\n if (isLinkClose(token.content)) state.linkLevel--\n }\n state.pos += match[0].length\n return true\n}\n","// Process html entity - &#123;, &#xAF;, &quot;, ...\n\nimport { decodeHTMLStrict } from 'entities'\nimport { isValidEntityCode, fromCodePoint } from '../common/utils.ts'\nimport type StateInline from './state_inline.ts'\n\nconst DIGITAL_RE = /^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i\nconst NAMED_RE = /^&([a-z][a-z0-9]{1,31});/i\n\nexport default function entity (state: StateInline, silent: boolean): boolean {\n const pos = state.pos\n const max = state.posMax\n\n if (state.src.charCodeAt(pos) !== 0x26/* & */) return false\n\n if (pos + 1 >= max) return false\n\n const ch = state.src.charCodeAt(pos + 1)\n\n if (ch === 0x23 /* # */) {\n const match = state.src.slice(pos).match(DIGITAL_RE)\n if (match) {\n if (!silent) {\n const code = match[1][0].toLowerCase() === 'x' ? parseInt(match[1].slice(1), 16) : parseInt(match[1], 10)\n\n const token = state.push('text_special', '', 0)\n token.content = isValidEntityCode(code) ? fromCodePoint(code) : fromCodePoint(0xFFFD)\n token.markup = match[0]\n token.info = 'entity'\n }\n state.pos += match[0].length\n return true\n }\n } else {\n const match = state.src.slice(pos).match(NAMED_RE)\n if (match) {\n const decoded = decodeHTMLStrict(match[0])\n if (decoded !== match[0]) {\n if (!silent) {\n const token = state.push('text_special', '', 0)\n token.content = decoded\n token.markup = match[0]\n token.info = 'entity'\n }\n state.pos += match[0].length\n return true\n }\n }\n }\n\n return false\n}\n","// For each opening emphasis-like marker find a matching closing one\n//\n\nimport type { Delimiter } from '../types.ts'\nimport type StateInline from './state_inline.ts'\n\nfunction processDelimiters (delimiters: Delimiter[]) {\n const openersBottom: Record<number, number[]> = {}\n const max = delimiters.length\n\n if (!max) return\n\n // headerIdx is the first delimiter of the current (where closer is) delimiter run\n let headerIdx = 0\n let lastTokenIdx = -2 // needs any value lower than -1\n const jumps: number[] = []\n\n for (let closerIdx = 0; closerIdx < max; closerIdx++) {\n const closer = delimiters[closerIdx]\n\n jumps.push(0)\n\n // markers belong to same delimiter run if:\n // - they have adjacent tokens\n // - AND markers are the same\n //\n if (delimiters[headerIdx].marker !== closer.marker || lastTokenIdx !== closer.token - 1) {\n headerIdx = closerIdx\n }\n\n lastTokenIdx = closer.token\n\n // Length is only used for emphasis-specific \"rule of 3\",\n // if it's not defined (in strikethrough or 3rd party plugins),\n // we can default it to 0 to disable those checks.\n //\n closer.length = closer.length || 0\n\n if (!closer.close) continue\n\n // Previously calculated lower bounds (previous fails)\n // for each marker, each delimiter length modulo 3,\n // and for whether this closer can be an opener;\n // https://github.com/commonmark/cmark/commit/34250e12ccebdc6372b8b49c44fab57c72443460\n /* eslint-disable-next-line no-prototype-builtins */\n if (!openersBottom.hasOwnProperty(closer.marker)) {\n openersBottom[closer.marker] = [-1, -1, -1, -1, -1, -1]\n }\n\n const minOpenerIdx = openersBottom[closer.marker][(closer.open ? 3 : 0) + (closer.length % 3)]\n\n let openerIdx = headerIdx - jumps[headerIdx] - 1\n\n let newMinOpenerIdx = openerIdx\n\n for (; openerIdx > minOpenerIdx; openerIdx -= jumps[openerIdx] + 1) {\n const opener = delimiters[openerIdx]\n\n if (opener.marker !== closer.marker) continue\n\n if (opener.open && opener.end < 0) {\n let isOddMatch = false\n\n // from spec:\n //\n // If one of the delimiters can both open and close emphasis, then the\n // sum of the lengths of the delimiter runs containing the opening and\n // closing delimiters must not be a multiple of 3 unless both lengths\n // are multiples of 3.\n //\n if (opener.close || closer.open) {\n if ((opener.length! + closer.length) % 3 === 0) {\n if (opener.length! % 3 !== 0 || closer.length % 3 !== 0) {\n isOddMatch = true\n }\n }\n }\n\n if (!isOddMatch) {\n // If previous delimiter cannot be an opener, we can safely skip\n // the entire sequence in future checks. This is required to make\n // sure algorithm has linear complexity (see *_*_*_*_*_... case).\n //\n const lastJump = openerIdx > 0 && !delimiters[openerIdx - 1].open\n ? jumps[openerIdx - 1] + 1\n : 0\n\n jumps[closerIdx] = closerIdx - openerIdx + lastJump\n jumps[openerIdx] = lastJump\n\n closer.open = false\n opener.end = closerIdx\n opener.close = false\n newMinOpenerIdx = -1\n // treat next token as start of run,\n // it optimizes skips in **<...>**a**<...>** pathological case\n lastTokenIdx = -2\n break\n }\n }\n }\n\n if (newMinOpenerIdx !== -1) {\n // If match for this delimiter run failed, we want to set lower bound for\n // future lookups. This is required to make sure algorithm has linear\n // complexity.\n //\n // See details here:\n // https://github.com/commonmark/cmark/issues/178#issuecomment-270417442\n //\n openersBottom[closer.marker][(closer.open ? 3 : 0) + ((closer.length || 0) % 3)] = newMinOpenerIdx\n }\n }\n}\n\nexport default function link_pairs (state: StateInline): void {\n const tokens_meta = state.tokens_meta\n const max = state.tokens_meta.length\n\n processDelimiters(state.delimiters)\n\n for (let curr = 0; curr < max; curr++) {\n const delimiters = tokens_meta[curr]?.delimiters\n if (delimiters) {\n processDelimiters(delimiters)\n }\n }\n}\n","// Clean up tokens after emphasis and strikethrough postprocessing:\n// merge adjacent text nodes into one and re-calculate all token levels\n//\n// This is necessary because initially emphasis delimiter markers (*, _, ~)\n// are treated as their own separate text tokens. Then emphasis rule either\n// leaves them as text (needed to merge with adjacent text) or turns them\n// into opening/closing tags (which messes up levels inside).\n//\n\nimport type StateInline from './state_inline.ts'\n\nexport default function fragments_join (state: StateInline): void {\n let curr, last\n let level = 0\n const tokens = state.tokens\n const max = state.tokens.length\n\n for (curr = last = 0; curr < max; curr++) {\n // re-calculate levels after emphasis/strikethrough turns some text nodes\n // into opening/closing tags\n if (tokens[curr].nesting < 0) level-- // closing tag\n tokens[curr].level = level\n if (tokens[curr].nesting > 0) level++ // opening tag\n\n if (tokens[curr].type === 'text' &&\n curr + 1 < max &&\n tokens[curr + 1].type === 'text') {\n // collapse two adjacent text nodes\n tokens[curr + 1].content = tokens[curr].content + tokens[curr + 1].content\n } else {\n if (curr !== last) { tokens[last] = tokens[curr] }\n\n last++\n }\n }\n\n if (curr !== last) {\n tokens.length = last\n }\n}\n","import Ruler from './ruler.ts'\nimport StateInline from './rules_inline/state_inline.ts'\nimport type Token from './token.ts'\nimport type MarkdownIt from './markdownit.ts'\nimport type { Env } from './types.ts'\n\nimport r_text from './rules_inline/text.ts'\nimport r_linkify from './rules_inline/linkify.ts'\nimport r_newline from './rules_inline/newline.ts'\nimport r_escape from './rules_inline/escape.ts'\nimport r_backticks from './rules_inline/backticks.ts'\nimport r_strikethrough from './rules_inline/strikethrough.ts'\nimport r_emphasis from './rules_inline/emphasis.ts'\nimport r_link from './rules_inline/link.ts'\nimport r_image from './rules_inline/image.ts'\nimport r_autolink from './rules_inline/autolink.ts'\nimport r_html_inline from './rules_inline/html_inline.ts'\nimport r_entity from './rules_inline/entity.ts'\n\nimport r_balance_pairs from './rules_inline/balance_pairs.ts'\nimport r_fragments_join from './rules_inline/fragments_join.ts'\n\n// Parser rules\n\nconst _rules: Array<[\n name: string,\n rule: (state: StateInline, silent: boolean) => boolean\n]> = [\n ['text', r_text],\n ['linkify', r_linkify],\n ['newline', r_newline],\n ['escape', r_escape],\n ['backticks', r_backticks],\n ['strikethrough', r_strikethrough.tokenize],\n ['emphasis', r_emphasis.tokenize],\n ['link', r_link],\n ['image', r_image],\n ['autolink', r_autolink],\n ['html_inline', r_html_inline],\n ['entity', r_entity]\n]\n\n// `rule2` ruleset was created specifically for emphasis/strikethrough\n// post-processing and may be changed in the future.\n//\n// Don't use this for anything except pairs (plugins working with `balance_pairs`).\n//\nconst _rules2: Array<[\n name: string,\n rule: (state: StateInline) => void\n]> = [\n ['balance_pairs', r_balance_pairs],\n ['strikethrough', r_strikethrough.postProcess],\n ['emphasis', r_emphasis.postProcess],\n // rules for pairs separate '**' into its own text tokens, which may be left unused,\n // rule below merges unused segments back with the rest of the text\n ['fragments_join', r_fragments_join]\n]\n\n/**\n * Tokenizes paragraph content.\n */\nclass ParserInline {\n /**\n * {@link Ruler} instance. Keep configuration of inline rules.\n */\n ruler = new Ruler<[StateInline, boolean], boolean>()\n\n /**\n * {@link Ruler} instance. Second ruler used for post-processing\n * (e.g. in emphasis-like rules).\n */\n ruler2 = new Ruler<[StateInline], void>()\n\n State = StateInline\n\n constructor () {\n for (let i = 0; i < _rules.length; i++) {\n this.ruler.push(_rules[i][0], _rules[i][1])\n }\n\n for (let i = 0; i < _rules2.length; i++) {\n this.ruler2.push(_rules2[i][0], _rules2[i][1])\n }\n }\n\n // Skip single token by running all rules in validation mode;\n // returns `true` if any rule reported success\n //\n skipToken (state: StateInline): void {\n const pos = state.pos\n const rules = this.ruler.getRules('')\n const len = rules.length\n const maxNesting = state.md.options.maxNesting\n const cache = state.cache\n\n if (typeof cache[pos] !== 'undefined') {\n state.pos = cache[pos]\n return\n }\n\n let ok = false\n\n if (state.level < maxNesting) {\n for (let i = 0; i < len; i++) {\n // Increment state.level and decrement it later to limit recursion.\n // It's harmless to do here, because no tokens are created. But ideally,\n // we'd need a separate private state variable for this purpose.\n //\n state.level++\n ok = rules[i](state, true)\n state.level--\n\n if (ok) {\n if (pos >= state.pos) { throw new Error(\"inline rule didn't increment state.pos\") }\n break\n }\n }\n } else {\n // Too much nesting, just skip until the end of the paragraph.\n //\n // NOTE: this will cause links to behave incorrectly in the following case,\n // when an amount of `[` is exactly equal to `maxNesting + 1`:\n //\n // [[[[[[[[[[[[[[[[[[[[[foo]()\n //\n // TODO: remove this workaround when CM standard will allow nested links\n // (we can replace it by preventing links from being parsed in\n // validation mode)\n //\n state.pos = state.posMax\n }\n\n if (!ok) { state.pos++ }\n cache[pos] = state.pos\n }\n\n // Generate tokens for input range\n //\n tokenize (state: StateInline): void {\n const rules = this.ruler.getRules('')\n const len = rules.length\n const end = state.posMax\n const maxNesting = state.md.options.maxNesting\n\n while (state.pos < end) {\n // Try all possible rules.\n // On success, rule should:\n //\n // - update `state.pos`\n // - update `state.tokens`\n // - return true\n const prevPos = state.pos\n let ok = false\n\n if (state.level < maxNesting) {\n for (let i = 0; i < len; i++) {\n ok = rules[i](state, false)\n if (ok) {\n if (prevPos >= state.pos) { throw new Error(\"inline rule didn't increment state.pos\") }\n break\n }\n }\n }\n\n if (ok) {\n if (state.pos >= end) { break }\n continue\n }\n\n state.pending += state.src[state.pos++]\n }\n\n if (state.pending) {\n state.pushPending()\n }\n }\n\n /**\n * Process input string and push inline tokens into `outTokens`\n */\n parse (str: string, md: MarkdownIt, env: Env, outTokens: Token[]): void {\n const state = new this.State(str, md, env, outTokens)\n\n this.tokenize(state)\n\n const rules = this.ruler2.getRules('')\n const len = rules.length\n\n for (let i = 0; i < len; i++) {\n rules[i](state)\n }\n }\n}\n\nexport default ParserInline\n","// markdown-it default options\n\nimport type { MarkdownItOptions } from '../types.ts'\n\nconst options: Required<MarkdownItOptions> = {\n // Enable HTML tags in source\n html: false,\n\n // Use '/' to close single tags (<br />)\n xhtmlOut: false,\n\n // Convert '\\n' in paragraphs into <br>\n breaks: false,\n\n // CSS language prefix for fenced blocks\n langPrefix: 'language-',\n\n // autoconvert URL-like texts to links\n linkify: false,\n\n // Enable some language-neutral replacements + quotes beautification\n typographer: false,\n\n // Double + single quotes replacement pairs, when typographer enabled,\n // and smartquotes on. Could be either a String or an Array.\n //\n // For example, you can use '«»„“' for Russian, '„“‚‘' for German,\n // and ['«\\xA0', '\\xA0»', '‹\\xA0', '\\xA0›'] for French (including nbsp).\n quotes: '\\u201c\\u201d\\u2018\\u2019', /* “”‘’ */\n\n // Highlighter function. Should return escaped HTML,\n // or '' if the source string is not changed and should be escaped externaly.\n // If result starts with <pre... internal wrapper is skipped.\n //\n // function (/*str, lang*/) { return ''; }\n //\n highlight: null,\n\n // Internal protection, recursion limit\n maxNesting: 100\n}\n\nexport default {\n options,\n\n components: {\n core: {},\n block: {},\n inline: {}\n }\n}\n","// \"Zero\" preset, with nothing enabled. Useful for manual configuring of simple\n// modes. For example, to parse bold/italic only.\n\nimport type { MarkdownItOptions } from '../types.ts'\n\nconst options: Required<MarkdownItOptions> = {\n // Enable HTML tags in source\n html: false,\n\n // Use '/' to close single tags (<br />)\n xhtmlOut: false,\n\n // Convert '\\n' in paragraphs into <br>\n breaks: false,\n\n // CSS language prefix for fenced blocks\n langPrefix: 'language-',\n\n // autoconvert URL-like texts to links\n linkify: false,\n\n // Enable some language-neutral replacements + quotes beautification\n typographer: false,\n\n // Double + single quotes replacement pairs, when typographer enabled,\n // and smartquotes on. Could be either a String or an Array.\n //\n // For example, you can use '«»„“' for Russian, '„“‚‘' for German,\n // and ['«\\xA0', '\\xA0»', '‹\\xA0', '\\xA0›'] for French (including nbsp).\n quotes: '\\u201c\\u201d\\u2018\\u2019', /* “”‘’ */\n\n // Highlighter function. Should return escaped HTML,\n // or '' if the source string is not changed and should be escaped externaly.\n // If result starts with <pre... internal wrapper is skipped.\n //\n // function (/*str, lang*/) { return ''; }\n //\n highlight: null,\n\n // Internal protection, recursion limit\n maxNesting: 20\n}\n\nexport default {\n options,\n\n components: {\n\n core: {\n rules: [\n 'normalize',\n 'block',\n 'strip_references',\n 'inline',\n 'text_join'\n ]\n },\n\n block: {\n rules: [\n 'paragraph'\n ]\n },\n\n inline: {\n rules: [\n 'text'\n ],\n rules2: [\n 'balance_pairs',\n 'fragments_join'\n ]\n }\n }\n}\n","// Commonmark default options\n\nimport type { MarkdownItOptions } from '../types.ts'\n\nconst options: Required<MarkdownItOptions> = {\n // Enable HTML tags in source\n html: true,\n\n // Use '/' to close single tags (<br />)\n xhtmlOut: true,\n\n // Convert '\\n' in paragraphs into <br>\n breaks: false,\n\n // CSS language prefix for fenced blocks\n langPrefix: 'language-',\n\n // autoconvert URL-like texts to links\n linkify: false,\n\n // Enable some language-neutral replacements + quotes beautification\n typographer: false,\n\n // Double + single quotes replacement pairs, when typographer enabled,\n // and smartquotes on. Could be either a String or an Array.\n //\n // For example, you can use '«»„“' for Russian, '„“‚‘' for German,\n // and ['«\\xA0', '\\xA0»', '‹\\xA0', '\\xA0›'] for French (including nbsp).\n quotes: '\\u201c\\u201d\\u2018\\u2019', /* “”‘’ */\n\n // Highlighter function. Should return escaped HTML,\n // or '' if the source string is not changed and should be escaped externaly.\n // If result starts with <pre... internal wrapper is skipped.\n //\n // function (/*str, lang*/) { return ''; }\n //\n highlight: null,\n\n // Internal protection, recursion limit\n maxNesting: 20\n}\n\nexport default {\n options,\n\n components: {\n\n core: {\n rules: [\n 'normalize',\n 'block',\n 'strip_references',\n 'inline',\n 'text_join'\n ]\n },\n\n block: {\n rules: [\n 'blockquote',\n 'code',\n 'fence',\n 'heading',\n 'hr',\n 'html_block',\n 'lheading',\n 'list',\n 'reference',\n 'paragraph'\n ]\n },\n\n inline: {\n rules: [\n 'autolink',\n 'backticks',\n 'emphasis',\n 'entity',\n 'escape',\n 'html_inline',\n 'image',\n 'link',\n 'newline',\n 'text'\n ],\n rules2: [\n 'balance_pairs',\n 'emphasis',\n 'fragments_join'\n ]\n }\n }\n}\n","// Main parser class\n\nimport * as utils from './common/utils.ts'\nimport * as helpers from './helpers/index.ts'\nimport Token from './token.ts'\nimport Ruler from './ruler.ts'\nimport Renderer from './renderer.ts'\nimport ParserCore from './parser_core.ts'\nimport StateCore from './rules_core/state_core.ts'\nimport ParserBlock from './parser_block.ts'\nimport StateBlock from './rules_block/state_block.ts'\nimport ParserInline from './parser_inline.ts'\nimport StateInline from './rules_inline/state_inline.ts'\nimport { LinkifyIt } from 'linkify-it'\nimport * as mdurl from 'mdurl'\nimport punycode from 'punycode.js'\n\nimport cfg_default from './presets/default.ts'\nimport cfg_zero from './presets/zero.ts'\nimport cfg_commonmark from './presets/commonmark.ts'\nimport type { Env, MarkdownItOptions } from './types.ts'\n\nconst config = {\n default: cfg_default,\n zero: cfg_zero,\n commonmark: cfg_commonmark\n}\n\ntype MarkdownItPresetName = keyof typeof config\n\n/**\n * Parser preset containing options and enabled rules for each parser component.\n */\nexport interface MarkdownItPreset {\n options?: Required<MarkdownItOptions>\n components?: {\n core?: {\n rules?: string[]\n }\n block?: {\n rules?: string[]\n }\n inline?: {\n rules?: string[]\n rules2?: string[]\n }\n }\n}\n\ntype MarkdownItComponentName = keyof NonNullable<MarkdownItPreset['components']>\n\n//\n// This validator can prohibit more than really needed to prevent XSS. It's a\n// tradeoff to keep code simple and to be secure by default.\n//\n// If you need different setup - override validator method as you wish. Or\n// replace it with dummy function and use external sanitizer.\n//\n\nconst BAD_PROTO_RE = /^(vbscript|javascript|file|data):/\nconst GOOD_DATA_RE = /^data:image\\/(gif|png|jpeg|webp);/\n\nconst RECODE_HOSTNAME_FOR = ['http:', 'https:', 'mailto:']\n\n/**\n * Parses Markdown into tokens and renders them to HTML.\n *\n * @category Main\n */\nclass MarkdownIt {\n /**\n * Instance of {@link ParserInline}. You may need it to add new rules when\n * writing plugins. For simple rules control use {@link MarkdownIt.disable}\n * and {@link MarkdownIt.enable}.\n */\n inline = new ParserInline()\n\n /**\n * Instance of {@link ParserBlock}. You may need it to add new rules when\n * writing plugins. For simple rules control use {@link MarkdownIt.disable}\n * and {@link MarkdownIt.enable}.\n */\n block = new ParserBlock()\n\n /**\n * Instance of {@link ParserCore} chain executor. You may need it to add new\n * rules when writing plugins. For simple rules control use\n * {@link MarkdownIt.disable} and {@link MarkdownIt.enable}.\n */\n core = new ParserCore()\n\n /**\n * Instance of {@link Renderer}. Use it to modify output look. Or to add rendering\n * rules for new token types, generated by plugins.\n *\n * See {@link Renderer} docs and\n * [source code](https://github.com/markdown-it/markdown-it/blob/master/src/renderer.ts).\n *\n * @example\n * ```javascript\n * import MarkdownIt from 'markdown-it'\n * const md = new MarkdownIt()\n *\n * function myToken(tokens, idx, options, env, self) {\n * //...\n * return result;\n * };\n *\n * md.renderer.rules['my_token'] = myToken\n * ```\n */\n renderer = new Renderer()\n\n /**\n * [linkify-it](https://github.com/markdown-it/linkify-it) instance.\n * Used by [linkify](https://github.com/markdown-it/markdown-it/blob/master/src/rules_core/linkify.ts)\n * rule.\n */\n linkify = new LinkifyIt()\n\n /**\n * Link validation function. CommonMark allows too much in links. By default\n * we disable `javascript:`, `vbscript:`, `file:` schemas, and almost all `data:...` schemas\n * except some embedded image types.\n *\n * You can change this behaviour:\n *\n * @example\n * ```javascript\n * import MarkdownIt from 'markdown-it'\n * const md = new MarkdownIt()\n *\n * // enable everything\n * md.validateLink = function () { return true; }\n * ```\n */\n validateLink (url: string): boolean {\n // url should be normalized at this point, and existing entities are decoded\n const str = url.trim().toLowerCase()\n\n return BAD_PROTO_RE.test(str) ? GOOD_DATA_RE.test(str) : true\n }\n\n /**\n * Function used to encode link url to a machine-readable format,\n * which includes url-encoding, punycode, etc.\n */\n normalizeLink (url: string): string {\n // Each url part should be encoded separately, with proper encoder\n const parsed = mdurl.parse(url, true)\n\n if (parsed.hostname) {\n // Encode hostnames in urls like:\n // `http://host/`, `https://host/`, `mailto:user@host`, `//host/`\n //\n // We don't encode unknown schemas, because it's likely that we encode\n // something we shouldn't (e.g. `skype:name` treated as `skype:host`)\n //\n if (!parsed.protocol || RECODE_HOSTNAME_FOR.indexOf(parsed.protocol) >= 0) {\n try {\n parsed.hostname = punycode.toASCII(parsed.hostname)\n } catch (er) { /**/ }\n }\n }\n\n if (parsed.auth) parsed.auth = mdurl.encode(parsed.auth)\n if (parsed.hostname) parsed.hostname = mdurl.encode(parsed.hostname)\n if (parsed.pathname) parsed.pathname = mdurl.encode(parsed.pathname)\n if (parsed.search) parsed.search = mdurl.encode(parsed.search)\n if (parsed.hash) parsed.hash = mdurl.encode(parsed.hash)\n\n return mdurl.format(parsed)\n }\n\n /**\n * Function used to decode link url to a human-readable format`\n */\n normalizeLinkText (url: string): string {\n const parsed = mdurl.parse(url, true)\n\n if (parsed.hostname) {\n // Encode hostnames in urls like:\n // `http://host/`, `https://host/`, `mailto:user@host`, `//host/`\n //\n // We don't encode unknown schemas, because it's likely that we encode\n // something we shouldn't (e.g. `skype:name` treated as `skype:host`)\n //\n if (!parsed.protocol || RECODE_HOSTNAME_FOR.indexOf(parsed.protocol) >= 0) {\n try {\n parsed.hostname = punycode.toUnicode(parsed.hostname)\n } catch (er) { /**/ }\n }\n }\n\n // add '%' to exclude list because of https://github.com/markdown-it/markdown-it/issues/720\n return mdurl.decode(mdurl.format(parsed), mdurl.decode.defaultChars + '%')\n }\n\n // Expose utils & helpers for easy acces from plugins\n\n /**\n * Assorted utility functions, useful to write plugins. See details\n * [here](https://github.com/markdown-it/markdown-it/blob/master/src/common/utils.ts).\n */\n utils = utils\n\n /**\n * Link components parser functions, useful to write plugins. See details\n * [here](https://github.com/markdown-it/markdown-it/blob/master/src/helpers).\n */\n helpers = Object.assign({}, helpers)\n\n declare options: Required<MarkdownItOptions>\n\n constructor (\n ...args:\n | []\n | [options: MarkdownItOptions]\n | [presetName: MarkdownItPresetName, options?: MarkdownItOptions]\n ) {\n const [presetNameOrOptions, options] = args\n\n if (typeof presetNameOrOptions === 'string') {\n this.configure(presetNameOrOptions)\n if (options) { this.set(options) }\n } else {\n this.configure('default')\n this.set(presetNameOrOptions || {})\n }\n }\n\n /**\n * Set parser options (in the same format as in constructor). Probably, you\n * will never need it, but you can change options after constructor call.\n *\n * __Note:__ To achieve the best possible performance, don't modify a\n * `markdown-it` instance options on the fly. If you need multiple configurations\n * it's best to create multiple instances and initialize each with separate\n * config.\n *\n * @example\n * ```javascript\n * import MarkdownIt from 'markdown-it'\n *\n * const md = new MarkdownIt()\n * .set({ html: true, breaks: true })\n * .set({ typographer: true })\n * ```\n */\n set (options: MarkdownItOptions): this {\n Object.assign(this.options, options)\n return this\n }\n\n /**\n * Batch load of all options and compenent settings. This is internal method,\n * and you probably will not need it. But if you will - see available presets\n * and data structure [here](https://github.com/markdown-it/markdown-it/tree/master/src/presets)\n *\n * We strongly recommend to use presets instead of direct config loads. That\n * will give better compatibility with next versions.\n */\n configure (presets: MarkdownItPresetName | MarkdownItPreset): this {\n let p: MarkdownItPreset\n\n if (typeof presets === 'string') {\n const presetName = presets\n p = config[presetName]\n if (!p) { throw new Error(`Wrong 'markdown-it' preset \"${presetName}\", check name`) }\n } else {\n p = presets\n }\n\n if (!p) { throw new Error('Wrong `markdown-it` preset, can\\'t be empty') }\n\n if (p.options) { this.options = { ...p.options } }\n\n const components = p.components\n if (components) {\n const componentNames: MarkdownItComponentName[] = ['core', 'block', 'inline']\n componentNames.forEach((name) => {\n const rules = components[name]?.rules\n if (rules) {\n this[name].ruler.enableOnly(rules)\n }\n })\n\n const rules2 = components.inline?.rules2\n if (rules2) {\n this.inline.ruler2.enableOnly(rules2)\n }\n }\n return this\n }\n\n /**\n * Enable list or rules. It will automatically find appropriate components,\n * containing rules with given names. If rule not found, and `ignoreInvalid`\n * not set - throws exception.\n *\n * @example\n * ```javascript\n * import MarkdownIt from 'markdown-it'\n *\n * const md = new MarkdownIt()\n * .enable(['sub', 'sup'])\n * .disable('smartquotes')\n * ```\n */\n enable (list: string | string[], ignoreInvalid = false): this {\n let result: string[] = []\n\n if (!Array.isArray(list)) { list = [list] }\n\n const chains: MarkdownItComponentName[] = ['core', 'block', 'inline']\n chains.forEach((chain) => {\n result = result.concat(this[chain].ruler.enable(list, true))\n })\n\n result = result.concat(this.inline.ruler2.enable(list, true))\n\n const missed = list.filter((name) => result.indexOf(name) < 0)\n\n if (missed.length && !ignoreInvalid) {\n throw new Error(`MarkdownIt. Failed to enable unknown rule(s): ${missed}`)\n }\n\n return this\n }\n\n /**\n * The same as {@link MarkdownIt.enable}, but turn specified rules off.\n */\n disable (list: string | string[], ignoreInvalid = false): this {\n let result: string[] = []\n\n if (!Array.isArray(list)) { list = [list] }\n\n const chains: MarkdownItComponentName[] = ['core', 'block', 'inline']\n chains.forEach((chain) => {\n result = result.concat(this[chain].ruler.disable(list, true))\n })\n\n result = result.concat(this.inline.ruler2.disable(list, true))\n\n const missed = list.filter((name) => result.indexOf(name) < 0)\n\n if (missed.length && !ignoreInvalid) {\n throw new Error(`MarkdownIt. Failed to disable unknown rule(s): ${missed}`)\n }\n return this\n }\n\n /**\n * Load specified plugin with given params into current parser instance.\n * It's just a sugar to call `plugin(md, params)` with curring.\n *\n * @example\n * ```javascript\n * import MarkdownIt from 'markdown-it'\n * import iterator from 'markdown-it-for-inline'\n *\n * const md = new MarkdownIt()\n * .use(iterator, 'foo_replace', 'text', function (tokens, idx) {\n * tokens[idx].content = tokens[idx].content.replace(/foo/g, 'bar')\n * })\n * ```\n */\n use<Params extends unknown[]> (\n plugin: (md: this, ...params: Params) => void,\n ...params: Params\n ): this {\n plugin.apply(plugin, [this, ...params])\n return this\n }\n\n /**\n * Parse input string and return list of block tokens (special token type\n * \"inline\" will contain list of inline tokens). You should not call this\n * method directly, until you write custom renderer (for example, to produce\n * AST).\n *\n * `env` is used to pass data between \"distributed\" rules and return additional\n * metadata like reference info, needed for the renderer. It also can be used to\n * inject data in specific cases. Usually, you will be ok to pass `{}`,\n * and then pass updated object to renderer.\n */\n parse (src: string, env: Env): Token[] {\n if (typeof src !== 'string') {\n throw new Error('Input data should be a String')\n }\n\n const state = new this.core.State(src, this, env)\n\n this.core.process(state)\n\n return state.tokens\n }\n\n /**\n * Render markdown string into html. It does all magic for you :).\n *\n * `env` can be used to inject additional metadata (`{}` by default).\n * But you will not need it with high probability. See also comment\n * in {@link MarkdownIt.parse}.\n */\n render (src: string, env: Env = {}): string {\n return this.renderer.render(this.parse(src, env), this.options, env)\n }\n\n /**\n * The same as {@link MarkdownIt.parse} but skip all block rules. It returns\n * the block tokens list with the single `inline` element, containing parsed\n * inline tokens in `children` property. Also updates `env` object.\n */\n parseInline (src: string, env: Env): Token[] {\n const state = new this.core.State(src, this, env)\n\n state.inlineMode = true\n this.core.process(state)\n\n return state.tokens\n }\n\n /**\n * Similar to {@link MarkdownIt.render} but for single paragraph content.\n * Result will NOT be wrapped into `<p>` tags.\n */\n renderInline (src: string, env: Env = {}): string {\n return this.renderer.render(this.parseInline(src, env), this.options, env)\n }\n\n static Token = Token\n static Ruler = Ruler\n static Renderer = Renderer\n static ParserCore = ParserCore\n static StateCore = StateCore\n static ParserBlock = ParserBlock\n static StateBlock = StateBlock\n static ParserInline = ParserInline\n static StateInline = StateInline\n}\n\nexport default MarkdownIt\n","import { callable } from './common/utils.ts'\nimport MarkdownIt from './markdownit.ts'\n\n/**\n * Default package export.\n *\n * For backward compatibility, the {@link MarkdownIt} class is wrapped so\n * legacy code can call it without `new`. New code should instantiate it as a\n * regular class with `new`. The compatibility wrapper may be removed in a\n * future release.\n *\n * @category Main\n */\nconst MarkdownItCallable = callable(MarkdownIt)\n\nexport default MarkdownItCallable\n\nexport type { default as MarkdownIt, MarkdownItPreset } from './markdownit.ts'\nexport type { Delimiter, Env, MarkdownItOptions } from './types.ts'\nexport type { default as Token } from './token.ts'\nexport type { default as Ruler } from './ruler.ts'\nexport type { default as Renderer, RendererRule } from './renderer.ts'\nexport type { default as ParserCore } from './parser_core.ts'\nexport type { default as StateCore } from './rules_core/state_core.ts'\nexport type { default as ParserBlock } from './parser_block.ts'\nexport type { default as StateBlock } from './rules_block/state_block.ts'\nexport type { default as ParserInline } from './parser_inline.ts'\nexport type { default as StateInline } from './rules_inline/state_inline.ts'\n"],"x_google_ignoreList":[0,1,2,3,4],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAM,4BAAY,IAAI,IAAI;CACtB,CAAC,GAAG,KAAM;CAEV,CAAC,KAAK,IAAI;CACV,CAAC,KAAK,IAAI;CACV,CAAC,KAAK,GAAG;CACT,CAAC,KAAK,IAAI;CACV,CAAC,KAAK,IAAI;CACV,CAAC,KAAK,IAAI;CACV,CAAC,KAAK,IAAI;CACV,CAAC,KAAK,GAAG;CACT,CAAC,KAAK,IAAI;CACV,CAAC,KAAK,GAAG;CACT,CAAC,KAAK,IAAI;CACV,CAAC,KAAK,GAAG;CACT,CAAC,KAAK,GAAG;CACT,CAAC,KAAK,IAAI;CACV,CAAC,KAAK,IAAI;CACV,CAAC,KAAK,IAAI;CACV,CAAC,KAAK,IAAI;CACV,CAAC,KAAK,IAAI;CACV,CAAC,KAAK,IAAI;CACV,CAAC,KAAK,IAAI;CACV,CAAC,KAAK,GAAG;CACT,CAAC,KAAK,IAAI;CACV,CAAC,KAAK,GAAG;CACT,CAAC,KAAK,IAAI;CACV,CAAC,KAAK,GAAG;CACT,CAAC,KAAK,GAAG;CACT,CAAC,KAAK,GAAG;AACb,CAAC;;;;;;;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,MAAM,IAAI,MAAM,+BAA+B;EAGjD,MAAM,QAAQ,IAAI,KAAK,KAAK,MAAM,KAAK,MAAM,GAAG;EAEhD,KAAK,KAAK,QAAQ,KAAK;EAEvB,OAAO,MAAM;CACf;;;;;;;;CASA,OAAQ,KAAa,MAAW,CAAC,GAAW;EAC1C,OAAO,KAAK,SAAS,OAAO,KAAK,MAAM,KAAK,GAAG,GAAG,KAAK,SAAS,GAAG;CACrE;;;;;;CAOA,YAAa,KAAa,KAAmB;EAC3C,MAAM,QAAQ,IAAI,KAAK,KAAK,MAAM,KAAK,MAAM,GAAG;EAEhD,MAAM,aAAa;EACnB,KAAK,KAAK,QAAQ,KAAK;EAEvB,OAAO,MAAM;CACf;;;;;CAMA,aAAc,KAAa,MAAW,CAAC,GAAW;EAChD,OAAO,KAAK,SAAS,OAAO,KAAK,YAAY,KAAK,GAAG,GAAG,KAAK,SAAS,GAAG;CAC3E;AAWF;AATS,gBAAA,YAAA,SAAQ,KAAA;AACR,gBAAA,YAAA,SAAQ,KAAA;AACR,gBAAA,YAAA,YAAW,QAAA;AACX,gBAAA,YAAA,cAAa,UAAA;AACb,gBAAA,YAAA,aAAY,SAAA;AACZ,gBAAA,YAAA,eAAc,WAAA;AACd,gBAAA,YAAA,cAAa,UAAA;AACb,gBAAA,YAAA,gBAAe,YAAA;AACf,gBAAA,YAAA,eAAc,WAAA;;;;;;;;;;;;;AC3avB,IAAM,qBAAqB,SAAS,UAAU"}
1
+ {"version":3,"file":"markdown-it.cjs.js","names":["ucmicro","isLinkOpen","isLinkClose","linkify","_rules","r_normalize","r_block","r_strip_references","r_inline","r_linkify","r_replacements","r_smartquotes","r_text_join","block_names","_rules","r_table","r_code","r_fence","r_blockquote","r_hr","r_list","r_reference","r_html_block","r_heading","r_lheading","r_paragraph","postProcess","r_text","r_linkify","r_newline","r_escape","r_backticks","r_strikethrough","r_emphasis","r_link","r_image","r_autolink","r_html_inline","r_entity","r_balance_pairs","r_fragments_join","options","options","cfg_default","cfg_zero","cfg_commonmark","punycode","LinkifyIt","utils","helpers"],"sources":["../node_modules/entities/dist/decode-codepoint.js","../node_modules/entities/dist/internal/decode-shared.js","../node_modules/entities/dist/generated/decode-data-html.js","../node_modules/entities/dist/internal/bin-trie-flags.js","../node_modules/entities/dist/decode.js","../src/common/utils.ts","../src/helpers/parse_link_label.ts","../src/helpers/parse_link_destination.ts","../src/helpers/parse_link_title.ts","../src/helpers/index.ts","../src/token.ts","../src/ruler.ts","../src/renderer.ts","../src/rules_core/state_core.ts","../src/rules_core/normalize.ts","../src/rules_core/block.ts","../src/rules_core/strip_references.ts","../src/rules_core/inline.ts","../src/rules_core/linkify.ts","../src/rules_core/replacements.ts","../src/rules_core/smartquotes.ts","../src/rules_core/text_join.ts","../src/parser_core.ts","../src/rules_block/state_block.ts","../src/rules_block/table.ts","../src/rules_block/code.ts","../src/rules_block/fence.ts","../src/rules_block/blockquote.ts","../src/rules_block/hr.ts","../src/rules_block/list.ts","../src/rules_block/reference.ts","../src/common/html_blocks.ts","../src/common/html_re.ts","../src/rules_block/html_block.ts","../src/rules_block/heading.ts","../src/rules_block/lheading.ts","../src/rules_block/paragraph.ts","../src/parser_block.ts","../src/rules_inline/state_inline.ts","../src/rules_inline/text.ts","../src/rules_inline/linkify.ts","../src/rules_inline/newline.ts","../src/rules_inline/escape.ts","../src/rules_inline/backticks.ts","../src/rules_inline/strikethrough.ts","../src/rules_inline/emphasis.ts","../src/rules_inline/link.ts","../src/rules_inline/image.ts","../src/rules_inline/autolink.ts","../src/rules_inline/html_inline.ts","../src/rules_inline/entity.ts","../src/rules_inline/balance_pairs.ts","../src/rules_inline/fragments_join.ts","../src/parser_inline.ts","../src/presets/default.ts","../src/presets/zero.ts","../src/presets/commonmark.ts","../src/markdownit.ts","../src/index.ts"],"sourcesContent":["// Adapted from https://github.com/mathiasbynens/he/blob/36afe179392226cf1b6ccdb16ebbb7a5a844d93a/src/he.js#L106-L134\n/**\n * C1 Unicode control character reference replacements (code points 128–159).\n * Index i gives the replacement for code point 128+i; 0 means \"no replacement\".\n */\nconst c1 = [\n 8364, 0, 8218, 402, 8222, 8230, 8224, 8225, 710, 8240, 352, 8249, 338, 0,\n 381, 0, 0, 8216, 8217, 8220, 8221, 8226, 8211, 8212, 732, 8482, 353, 8250,\n 339, 0, 382, 376,\n];\n/**\n * True for NUL, UTF-16 surrogates, and values past U+10FFFF.\n * @param codePoint Unicode code point to check.\n */\nfunction isInvalidCodePoint(codePoint) {\n return (codePoint === 0 ||\n (codePoint >= 0xd8_00 && codePoint <= 0xdf_ff) ||\n codePoint > 0x10_ff_ff);\n}\n/**\n * Replace the given code point with U+FFFD if it is NUL (0), a surrogate, or\n * outside the valid Unicode range. Code points in the C1 controls range\n * (128–159) are remapped to their Windows-1252 equivalents, following the\n * HTML spec. All other code points are returned unchanged.\n * @param codePoint Unicode code point to convert.\n */\nexport function replaceCodePoint(codePoint) {\n if (isInvalidCodePoint(codePoint)) {\n return 0xff_fd;\n }\n if (codePoint >= 128 && codePoint <= 159) {\n return c1[codePoint - 128] || codePoint;\n }\n return codePoint;\n}\n/**\n * XML numeric character references are the referenced Unicode code point.\n * Invalid values still become U+FFFD; the HTML Windows-1252 C1 remap is not\n * applied.\n * @see https://www.w3.org/TR/xml/#NT-CharRef\n * @param codePoint Unicode code point to convert.\n */\nexport function replaceCodePointXML(codePoint) {\n return isInvalidCodePoint(codePoint) ? 0xff_fd : codePoint;\n}\n/**\n * Convert the code point of a decoded numeric entity to a string, replacing\n * invalid values.\n *\n * Fast path for plain BMP code points: [1..0x7F] and [0xA0..0xD7FF] pass\n * `replaceCodePoint` unchanged (no NUL, C1 remap, surrogate, or out-of-range\n * handling) and fit a single charCode. 0xd760 = 0xD800 (the first surrogate)\n * - 0xA0.\n * @param codePoint Unicode code point to convert.\n */\nexport function codePointToString(codePoint) {\n return (codePoint - 1) >>> 0 < 0x7f || (codePoint - 0xa0) >>> 0 < 0xd7_60\n ? String.fromCharCode(codePoint)\n : String.fromCodePoint(replaceCodePoint(codePoint));\n}\n//# sourceMappingURL=decode-codepoint.js.map","/*\n * Inverse of the encoder's SAFE alphabet (0x21..0x7E minus 0x22, 0x24, 0x5C),\n * precomputed once at module load. Entries for excluded chars stay 0 but\n * are never read.\n */\nconst BASE91_INVERSE = /* #__PURE__ */ (() => {\n const table = new Uint8Array(127);\n let code = 0;\n for (let char = 0x21; char <= 0x7e; char++) {\n if (char !== 0x22 && char !== 0x24 && char !== 0x5c) {\n table[char] = code++;\n }\n }\n return table;\n})();\n/**\n * Decode a dictionary-encoded trie string back into its Uint16Array.\n *\n * Stream layout (consumed in this order):\n * 1. dict1 atoms — `dict1AtomCount` uint16 values, delta+RLE encoded.\n * 2. dict2 atoms — `atomCount - dict1AtomCount` values, delta+RLE.\n * 3. dict2 ngrams — `ngramCount - (dictSize - dict1AtomCount)` entries,\n * each a pair of slot codes that resolve to earlier slots.\n * 4. dict1 ngrams — `dictSize - dict1AtomCount` entries, same shape.\n * 5. data — slot codes, each expanding to one or more uint16 values.\n *\n * Codes use a 91-char base (printable ASCII minus `\"`, `$`, `\\`):\n * - char1 < dictSize → 1-char code, slot = char1\n * - char1 ≥ dictSize → 2-char code, slot = dictSize + (char1 - dictSize)*91 + char2\n *\n * Slot index → token kind:\n * [0, A) dict1 atoms (1-char codes)\n * [A, dictSize) dict1 ngrams (1-char codes)\n * [dictSize, dictSize+D) dict2 atoms (2-char codes)\n * [dictSize+D, end) dict2 ngrams (2-char codes)\n *\n * Both atom dicts decode before any ngram, and dict2 ngrams decode before\n * dict1 ngrams. So every ngram entry references slots whose contents are\n * already filled — no forward references to handle.\n *\n * This runs on library import. Flat typed arrays store each slot as either\n * a plain value (`single`, covering every atom) or a range in a shared\n * `pool` (ngrams).\n * @param input Packed trie string.\n * @param resultLength Expected number of uint16 values in the output.\n * @param atomCount Total number of distinct uint16 values in the trie.\n * @param dict1AtomCount Atoms in the 1-char range (`A` above).\n * @param ngramCount Total number of ngram entries (dict1 + dict2).\n * @param dictSize Number of 1-char code slots; the rest of `BASE - dictSize`\n * first-byte values are 2-char codes.\n */\nexport function decodeTrieDict(input, resultLength, atomCount, dict1AtomCount, ngramCount, dictSize) {\n const base = 91;\n const inputLength = input.length;\n // For 2-char codes, slot = char1 * base - twoCharBias + char2.\n const twoCharBias = dictSize * (base - 1);\n let pos = 0;\n /** Read one slot code at `pos` and return its slot index, advancing pos. */\n const readSlotCode = () => {\n const c1 = BASE91_INVERSE[input.charCodeAt(pos++)];\n return c1 < dictSize\n ? c1\n : c1 * base - twoCharBias + BASE91_INVERSE[input.charCodeAt(pos++)];\n };\n const dict2AtomCount = atomCount - dict1AtomCount;\n const slotCount = atomCount + ngramCount;\n /*\n * Per-slot contents: atoms (always a single value) live directly in\n * `single`; ngram slots hold -1 there and expand to\n * `pool[start[slot] .. start[slot] + length[slot])`.\n */\n const single = new Int32Array(slotCount);\n single.fill(-1, dict1AtomCount, dictSize);\n single.fill(-1, dictSize + dict2AtomCount, slotCount);\n const start = new Int32Array(slotCount);\n const length = new Int32Array(slotCount);\n /**\n * Decode `count` ascending uint16 values from a delta+RLE stream into\n * `single[off..off+count)`.\n *\n * code < 89 → delta = code\n * code == 89 → run-length: next char encodes runLength-2; emit `runLength` consecutive +1 values\n * code == 90, next < 90 → escape: delta = 89 + next * BASE + after-next\n * code == 90, next == 90 → double-escape: extra char for very large deltas\n * @param count\n * @param off\n */\n function decodeDelta(count, off) {\n let previous = 0;\n let slot = off;\n const end = off + count;\n while (slot < end) {\n const code = BASE91_INVERSE[input.charCodeAt(pos++)];\n if (code < 89) {\n previous += code;\n single[slot++] = previous;\n }\n else if (code === 89) {\n let runLength = BASE91_INVERSE[input.charCodeAt(pos++)] + 2;\n while (runLength--)\n single[slot++] = ++previous;\n }\n else {\n const next = BASE91_INVERSE[input.charCodeAt(pos++)];\n previous +=\n 89 +\n // eslint-disable-next-line unicorn/prefer-minimal-ternary -- branches read a different number of side-effecting input bytes\n (next < 90\n ? next * base + BASE91_INVERSE[input.charCodeAt(pos++)]\n : BASE91_INVERSE[input.charCodeAt(pos++)] * 8281 +\n BASE91_INVERSE[input.charCodeAt(pos++)] * base +\n BASE91_INVERSE[input.charCodeAt(pos++)]);\n single[slot++] = previous;\n }\n }\n }\n // Streams 1 & 2: atoms decoded into their slot ranges.\n decodeDelta(dict1AtomCount, 0);\n decodeDelta(dict2AtomCount, dictSize);\n /*\n * Streams 3 & 4 are read in two passes: first collect every ngram's two\n * references and derive its expanded length (each ref resolves to an earlier\n * slot, so lengths are already known), which sizes the shared pool.\n * Pool ranges are handed out in decode order, so the second pass fills\n * the pool contiguously with a single write cursor.\n */\n const references = new Int32Array(ngramCount * 2);\n let poolSize = 0;\n let ngramIndex = 0;\n /**\n * Read `count` ngram entries (each = 2 slot-code references) for the slots\n * starting at `startSlot`, recording references and assigning pool ranges.\n * @param count\n * @param startSlot\n */\n function readNgramReferences(count, startSlot) {\n for (let index = 0; index < count; index++) {\n const slot = startSlot + index;\n const a = readSlotCode();\n const b = readSlotCode();\n references[ngramIndex * 2] = a;\n references[ngramIndex * 2 + 1] = b;\n ngramIndex += 1;\n start[slot] = poolSize;\n const entryLength = (single[a] < 0 ? length[a] : 1) +\n (single[b] < 0 ? length[b] : 1);\n length[slot] = entryLength;\n poolSize += entryLength;\n }\n }\n readNgramReferences(ngramCount - dictSize + dict1AtomCount, dictSize + dict2AtomCount);\n readNgramReferences(dictSize - dict1AtomCount, dict1AtomCount);\n // Second pass: concatenate each ngram's two halves into the pool.\n const pool = new Uint16Array(poolSize);\n let write = 0;\n for (let index = 0; index < ngramIndex; index++) {\n for (let half = 0; half < 2; half++) {\n const source = references[index * 2 + half];\n const value = single[source];\n if (value < 0) {\n let read = start[source];\n const readEnd = read + length[source];\n while (read < readEnd)\n pool[write++] = pool[read++];\n }\n else {\n pool[write++] = value;\n }\n }\n }\n // Stream 5: data. Each code expands to its slot's stored values.\n const out = new Uint16Array(resultLength);\n let outIndex = 0;\n while (pos < inputLength) {\n let slot = BASE91_INVERSE[input.charCodeAt(pos++)];\n if (slot >= dictSize) {\n slot =\n slot * base -\n twoCharBias +\n BASE91_INVERSE[input.charCodeAt(pos++)];\n }\n const value = single[slot];\n if (value < 0) {\n let read = start[slot];\n const readEnd = read + length[slot];\n while (read < readEnd)\n out[outIndex++] = pool[read++];\n }\n else {\n out[outIndex++] = value;\n }\n }\n return out;\n}\n//# sourceMappingURL=decode-shared.js.map","// Generated using scripts/write-decode-map.ts\nimport { decodeTrieDict } from \"../internal/decode-shared.js\";\n/** Packed HTML decode trie data. */\nexport const htmlDecodeTree = /* #__PURE__ */ decodeTrieDict(\"!}.&u%}'&}*'~!6*)%&,~!J~!J~%L~y<~!R,~~%Lu~~#GD~~#|)1#%}^%}2%+#.##%##%}&%##%'#%##&%#%#'%#&#%#&#'#%%#&#%##%#)%''%&%#%#'%#%%#%%}%%%#%#&(23#%%#&-%0%('1#(##%#'##+%'*.:1}#%#6-+(%'%%#%%%}#L'2351&('%}&/N'(0(/*-%(%%}#'+&T%7.2}#&%&#%#36/5##%&%%#&#%%#))2%%##%&&'0~!#*+&'%1~!%).'3q?&%'1~!.##%6(~!+%%%(Gw'rT~!E#<nA%#jZ~!H%(~!42##~!*31&~!G%U~#)5~#`3~!J~!Z~%]~%Y~%C~!q~!u~#kz~%#~!6'~!D~!U~!?~#T~!c%~!G#'~%7|~!G~!J~!G&~#pb~(Df}#%}*&}#%##%##%##&#-}&'#'&%#.++}%mI,#,@&(}*%}*'%&##&#%##%}&0}#.},U},%}+%}&%}#%##&}B%(}(%}+%)})%##%#&}&%##%&}<%}>%#%&}*%}(%}9%}/%})%}*%}*%}?&}&%}3%}&*#%})%#%#)}#&#-#+*%E%%'%'#%}#*V##&##I}#&&##%&%#&&Qf%%))w/0+&%#(#.%-''''++++7}>%4'',##1,#%#&%##&#'##&#*#9)%&%}#*}%,#+P(%A&%#'&##wSD',9E00#y#@}(+}&%&>~!#~!X}#*}(&&}(&}(,%}%&#+&}#&}I%#%}%)#(},'%#*}4%%#%}(''}#/##(##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C2F|GOu!5x,g|p{ah!-(?C2F|c9:4E|OjXuvvNr}:Rh&i[w*t|cd+U#jJvsu)vsSn~Mkfrmu9p}u7vwv]So!McW#Xa!ax5@A5aY:5;5<H|>kJv~vYrquJu3x4ib#T)2@SmZM?C2F|Bj:rmu9@xPhI(a*a#U#`a3-5Abb|L~@:RhK9:4E|0@52B5G|#C::aY?C2F|-:2<BaY?C2F|.5Jvk!a)javYrquJu3x4ia#T)2@SmYM?C2F|HAxPhH(!a#U#`a*-5Abb|4~@:RhJ9:4E|R@52B5G|F:2<BaY?C2F|Sc^#Xa2j=Qq5CJvB!-g<v{z;hhM?C2F|Zi[vrv{z;hiM?C2F|XKsA>!a)-g<v{z;h[eb?C2F|]i[vrv{z;h]eb?C2F|^iZu.vix,hZq3ah!.(?C2F|QOu!5ShXM:2<BaY?C2F|P\", 13_494, 2713, 49, 25, 61);\n//# sourceMappingURL=decode-data-html.js.map","/**\n * Bit flags & masks for the binary trie encoding used for entity decoding.\n *\n * The trie is a flat `Uint16Array`. Every node starts with one header word:\n *\n * 15..14 VALUE_LENGTH Number of words the value occupies, +1.\n * 0 = no value; 1 = value inline in bits 12..0;\n * 2/3 = value in the 1/2 words after the header.\n * 13 FLAG13 If VALUE_LENGTH > 0: semicolon required (\"strict\"\n * entity; `;` is never stored as a branch).\n * If VALUE_LENGTH == 0: this node is a compact run.\n * 12..7 BRANCH_LENGTH Number of branches (or run length for runs).\n * 6..0 JUMP_TABLE Jump-table offset / single-branch char / first\n * run char (see below).\n *\n * Branch data follows the header and any value words. Its shape is selected\n * by (JUMP_TABLE, BRANCH_LENGTH) in the header:\n *\n * Single branch JUMP_TABLE = the only child's char, BRANCH_LENGTH = 0.\n * No branch words; the child node follows immediately.\n * Jump table JUMP_TABLE = first covered char (> 0), BRANCH_LENGTH =\n * table length. One word per covered char: 0 = no branch,\n * otherwise the child's offset from the END of the table,\n * +1 (so 0 stays the no-branch sentinel).\n * Dictionary JUMP_TABLE = 0, BRANCH_LENGTH = number of branches.\n * ceil(n/2) words of sorted keys packed two per word\n * (low byte first), then n pointer words storing the\n * child's offset from the END of the branch data.\n * Compact run VALUE_LENGTH = 0, FLAG13 set. BRANCH_LENGTH = run\n * length (3..63), JUMP_TABLE = first char; remaining run\n * chars packed two per word after the header. The target\n * node follows the packed words immediately.\n *\n * Pointers are end-relative (rather than relative to the pointer's own\n * position) because that makes the common \"child encoded right after the\n * branch data\" case a small constant, which compresses far better. Offsets\n * to already-encoded (shared) nodes wrap via uint16 modulo arithmetic; the\n * decoder masks navigation results with `& 0xff_ff` to match.\n */\nexport var BinTrieFlags;\n(function (BinTrieFlags) {\n BinTrieFlags[BinTrieFlags[\"VALUE_LENGTH\"] = 49152] = \"VALUE_LENGTH\";\n BinTrieFlags[BinTrieFlags[\"FLAG13\"] = 8192] = \"FLAG13\";\n BinTrieFlags[BinTrieFlags[\"BRANCH_LENGTH\"] = 8064] = \"BRANCH_LENGTH\";\n BinTrieFlags[BinTrieFlags[\"JUMP_TABLE\"] = 127] = \"JUMP_TABLE\";\n /** Bits 12..0: the inline value of a VALUE_LENGTH = 1 header word. */\n BinTrieFlags[BinTrieFlags[\"VALUE_MASK\"] = 8191] = \"VALUE_MASK\";\n})(BinTrieFlags || (BinTrieFlags = {}));\n//# sourceMappingURL=bin-trie-flags.js.map","import { codePointToString, replaceCodePoint, replaceCodePointXML, } from \"./decode-codepoint.js\";\nimport { htmlDecodeTree } from \"./generated/decode-data-html.js\";\nimport { xmlDecodeTree } from \"./generated/decode-data-xml.js\";\nimport { BinTrieFlags } from \"./internal/bin-trie-flags.js\";\nvar CharCodes;\n(function (CharCodes) {\n CharCodes[CharCodes[\"AMP\"] = 38] = \"AMP\";\n CharCodes[CharCodes[\"NUM\"] = 35] = \"NUM\";\n CharCodes[CharCodes[\"SEMI\"] = 59] = \"SEMI\";\n CharCodes[CharCodes[\"EQUALS\"] = 61] = \"EQUALS\";\n CharCodes[CharCodes[\"ZERO\"] = 48] = \"ZERO\";\n CharCodes[CharCodes[\"NINE\"] = 57] = \"NINE\";\n CharCodes[CharCodes[\"LOWER_A\"] = 97] = \"LOWER_A\";\n CharCodes[CharCodes[\"LOWER_X\"] = 120] = \"LOWER_X\";\n})(CharCodes || (CharCodes = {}));\n/** Bit that needs to be set to convert an upper case ASCII character to lower case */\nconst TO_LOWER_BIT = 0b10_0000;\n/*\n * `parseNumericEntity` packs its two results into one 32-bit integer:\n * `(consumed << CONSUMED_SHIFT) | codePoint`. The 21-bit code point field\n * fits any valid Unicode value (max 0x10FFFF, clamped before packing); the\n * consumed count excludes `&` and gets the remaining 11 bits. Extract it\n * with `>>>` so the topmost bit isn't treated as a sign.\n *\n * Plain consts rather than a `const enum`: with `isolatedModules`, enum\n * member reads compile to runtime property loads.\n */\nconst CONSUMED_SHIFT = 21;\nconst CODE_POINT_MASK = 0x1f_ff_ff;\n/**\n * Reserved consumed field for counts of at least 2047 characters after `&`.\n * The true count is in `longNumericConsumed`.\n */\nconst CONSUMED_OVERFLOW = 0x7_ff;\n/**\n * Side channel for numeric entities of at least 2048 characters including\n * `&`. Set by `parseNumericEntity` when its consumed count reaches the\n * reserved value `CONSUMED_OVERFLOW`; callers read the true count from here.\n * A module-level slot avoids a tuple allocation on the hot path.\n */\nlet longNumericConsumed = 0;\n/**\n * Extract the consumed count from a `parseNumericEntity` packed result,\n * recovering the true length from `longNumericConsumed` when the packed\n * field contains the sentinel. Read it before the next `parseNumericEntity`\n * call, which may overwrite the side channel. This helper owns that protocol.\n * @param packed Packed result of `parseNumericEntity`.\n */\nfunction unpackConsumed(packed) {\n const consumed = packed >>> CONSUMED_SHIFT;\n return consumed === CONSUMED_OVERFLOW ? longNumericConsumed : consumed;\n}\n/**\n * Unsigned subtraction trick: (code - lo) >>> 0 wraps negatives to large\n * values, so a single `<=` covers the entire [lo..hi] range check.\n * @param code Code point to check.\n */\nfunction isNumber(code) {\n return (code - CharCodes.ZERO) >>> 0 <= 9;\n}\nfunction isHexadecimalCharacter(code) {\n return ((code | TO_LOWER_BIT) - CharCodes.LOWER_A) >>> 0 <= 5; // F - a\n}\nfunction isAlpha(code) {\n return ((code | TO_LOWER_BIT) - CharCodes.LOWER_A) >>> 0 <= 25; // Z - a\n}\n/**\n * Checks if the given character is a valid end character for an entity in an attribute.\n *\n * Attribute values that aren't terminated properly aren't parsed, and shouldn't lead to a parser error.\n * See the example in https://html.spec.whatwg.org/multipage/parsing.html#named-character-reference-state\n * @param code Code point to check.\n */\nfunction isEntityInAttributeInvalidEnd(code) {\n return code === CharCodes.EQUALS || isAlpha(code) || isNumber(code);\n}\nvar EntityDecoderState;\n(function (EntityDecoderState) {\n EntityDecoderState[EntityDecoderState[\"EntityStart\"] = 0] = \"EntityStart\";\n EntityDecoderState[EntityDecoderState[\"NumericStart\"] = 1] = \"NumericStart\";\n EntityDecoderState[EntityDecoderState[\"NumericDecimal\"] = 2] = \"NumericDecimal\";\n EntityDecoderState[EntityDecoderState[\"NumericHex\"] = 3] = \"NumericHex\";\n EntityDecoderState[EntityDecoderState[\"NamedEntity\"] = 4] = \"NamedEntity\";\n})(EntityDecoderState || (EntityDecoderState = {}));\n/**\n * Decoding mode for named entities.\n */\nexport var DecodingMode;\n(function (DecodingMode) {\n /** Entities in text nodes that can end with any character. */\n DecodingMode[DecodingMode[\"Legacy\"] = 0] = \"Legacy\";\n /** Only allow entities terminated with a semicolon. */\n DecodingMode[DecodingMode[\"Strict\"] = 1] = \"Strict\";\n /** Entities in attributes have limitations on ending characters. */\n DecodingMode[DecodingMode[\"Attribute\"] = 2] = \"Attribute\";\n})(DecodingMode || (DecodingMode = {}));\n/**\n * Token decoder with support of writing partial entities.\n */\nexport class EntityDecoder {\n decodeTree;\n emitCodePoint;\n errors;\n /** The current state of the decoder. */\n state = EntityDecoderState.EntityStart;\n /** Characters that were consumed while parsing an entity. */\n consumed = 1;\n /**\n * The result of the entity.\n *\n * For named entities: the trie index of the best legacy match so far\n * (0 = none). For numeric entities: the accumulated code point.\n */\n result = 0;\n /** The current index in the decode tree. */\n treeIndex = 0;\n /**\n * Characters consumed since the last recorded legacy match, plus one.\n * Invariant at the top of the `stateNamedEntity` loop: `excess` equals\n * the number of unrecorded consumed characters + 1.\n */\n // biome-ignore lint/correctness/noUnusedPrivateClassMembers: False positive (read via destructuring)\n excess = 1;\n /** The mode in which the decoder is operating. */\n decodeMode = DecodingMode.Strict;\n /** The number of characters that have been consumed in the current run. */\n // biome-ignore lint/correctness/noUnusedPrivateClassMembers: False positive\n runConsumed = 0;\n constructor(\n /** The predefined HTML or XML decode tree. */\n decodeTree, \n /**\n * The function that is called when a codepoint is decoded.\n *\n * For named entities that decode to multiple code points, this will\n * be called multiple times, with the second codepoint, and the same\n * `consumed` value.\n * @param codepoint The decoded codepoint.\n * @param consumed The number of characters consumed by the decoder.\n */\n emitCodePoint, \n /** An object that is used to produce errors. */\n errors) {\n this.decodeTree = decodeTree;\n this.emitCodePoint = emitCodePoint;\n this.errors = errors;\n }\n /**\n * Resets the instance to make it reusable.\n * @param decodeMode Entity decoding mode to use.\n */\n startEntity(decodeMode) {\n this.decodeMode = decodeMode;\n this.state = EntityDecoderState.EntityStart;\n this.result = 0;\n this.treeIndex = 0;\n this.excess = 1;\n this.consumed = 1;\n this.runConsumed = 0;\n }\n /**\n * Write an entity to the decoder. This can be called multiple times with partial entities.\n * If the entity is incomplete, the decoder will return -1.\n *\n * Mirrors the non-streaming `decodeWithTrie`, but with the ability to stop decoding if the\n * entity is incomplete, and resume when the next string is written.\n * @param input The string containing the entity (or a continuation of the entity).\n * @param offset The offset at which the entity begins. Should be 0 if this is not the first call.\n * @returns The number of characters that were consumed, or -1 if the entity is incomplete.\n */\n write(input, offset) {\n switch (this.state) {\n case EntityDecoderState.EntityStart: {\n if (input.charCodeAt(offset) === CharCodes.NUM) {\n this.state = EntityDecoderState.NumericStart;\n this.consumed += 1;\n return this.stateNumericStart(input, offset + 1);\n }\n this.state = EntityDecoderState.NamedEntity;\n return this.stateNamedEntity(input, offset);\n }\n case EntityDecoderState.NumericStart: {\n return this.stateNumericStart(input, offset);\n }\n case EntityDecoderState.NumericDecimal: {\n return this.stateNumericDecimal(input, offset);\n }\n case EntityDecoderState.NumericHex: {\n return this.stateNumericHex(input, offset);\n }\n default: {\n // NamedEntity — the only remaining state.\n return this.stateNamedEntity(input, offset);\n }\n }\n }\n /**\n * Switches between the numeric decimal and hexadecimal states.\n *\n * Equivalent to the `Numeric character reference state` in the HTML spec.\n * @param input The string containing the entity (or a continuation of the entity).\n * @param offset The current offset.\n * @returns The number of characters that were consumed, or -1 if the entity is incomplete.\n */\n // eslint-disable-next-line unicorn/consistent-class-member-order\n stateNumericStart(input, offset) {\n if (offset >= input.length) {\n return -1;\n }\n if ((input.charCodeAt(offset) | TO_LOWER_BIT) === CharCodes.LOWER_X) {\n this.state = EntityDecoderState.NumericHex;\n this.consumed += 1;\n return this.stateNumericHex(input, offset + 1);\n }\n this.state = EntityDecoderState.NumericDecimal;\n return this.stateNumericDecimal(input, offset);\n }\n /**\n * Parses a hexadecimal numeric entity.\n *\n * Equivalent to the `Hexademical character reference state` in the HTML\n * spec. Digit parsing matches the hex loop in `parseNumericEntity`.\n * The accumulated value is preserved for numeric validation callbacks.\n * @param input The string containing the entity (or a continuation of the entity).\n * @param offset The current offset.\n * @returns The number of characters that were consumed, or -1 if the entity is incomplete.\n */\n stateNumericHex(input, offset) {\n const inputLength = input.length;\n // Local accumulators; flushed before any exit (see stateNamedEntity).\n let { result } = this;\n let { consumed } = this;\n while (offset < inputLength) {\n const char = input.charCodeAt(offset);\n if (isNumber(char) || isHexadecimalCharacter(char)) {\n // Convert hex digit to value (0-15); 'a'/'A' -> 10.\n const digit = char <= CharCodes.NINE\n ? char - CharCodes.ZERO\n : (char | TO_LOWER_BIT) - CharCodes.LOWER_A + 10;\n result = result * 16 + digit;\n consumed += 1;\n offset += 1;\n }\n else {\n this.result = result;\n this.consumed = consumed;\n return this.emitNumericEntity(char, 3);\n }\n }\n this.result = result;\n this.consumed = consumed;\n return -1; // Incomplete entity\n }\n /**\n * Parses a decimal numeric entity.\n *\n * Equivalent to the `Decimal character reference state` in the HTML\n * spec. Digit parsing matches the decimal loop in `parseNumericEntity`.\n * The accumulated value is preserved for numeric validation callbacks.\n * @param input The string containing the entity (or a continuation of the entity).\n * @param offset The current offset.\n * @returns The number of characters that were consumed, or -1 if the entity is incomplete.\n */\n stateNumericDecimal(input, offset) {\n const inputLength = input.length;\n // Local accumulators; flushed before any exit (see stateNamedEntity).\n let { result } = this;\n let { consumed } = this;\n while (offset < inputLength) {\n const digit = input.charCodeAt(offset) - CharCodes.ZERO;\n if (digit >>> 0 > 9) {\n this.result = result;\n this.consumed = consumed;\n return this.emitNumericEntity(digit + CharCodes.ZERO, 2);\n }\n result = result * 10 + digit;\n consumed += 1;\n offset += 1;\n }\n this.result = result;\n this.consumed = consumed;\n return -1; // Incomplete entity\n }\n /**\n * Validate and emit a numeric entity.\n *\n * Implements the logic from the `Hexademical character reference start\n * state` and `Numeric character reference end state` in the HTML spec.\n * @param lastCp The last code point of the entity. Used to see if the\n * entity was terminated with a semicolon.\n * @param expectedLength The minimum number of characters that should be\n * consumed. Used to validate that at least one digit\n * was consumed.\n * @returns The number of characters that were consumed.\n */\n emitNumericEntity(lastCp, expectedLength) {\n // Ensure we consumed at least one digit.\n if (this.consumed <= expectedLength) {\n this.errors?.absenceOfDigitsInNumericCharacterReference(this.consumed);\n return 0;\n }\n // Figure out if this is a legit end of the entity\n if (lastCp === CharCodes.SEMI) {\n this.consumed += 1;\n }\n else if (this.decodeMode === DecodingMode.Strict) {\n return 0;\n }\n this.emitCodePoint((this.decodeTree === xmlDecodeTree\n ? replaceCodePointXML\n : replaceCodePoint)(this.result), this.consumed);\n if (this.errors) {\n if (lastCp !== CharCodes.SEMI) {\n this.errors.missingSemicolonAfterCharacterReference();\n }\n this.errors.validateNumericCharacterReference(this.result);\n }\n return this.consumed;\n }\n /**\n * Flush locally-tracked walk state back to the fields, then emit the\n * recorded legacy match or reject (cold path — at most once per\n * entity). Called after failed navigation (leaf node, branch miss, or\n * compact-run mismatch). In attribute mode, reject if no legacy was\n * recorded at the current node, if we descended past it, or if the\n * pending input character is an invalid attribute terminator.\n * @param consumed Locally-tracked consumed count.\n * @param excess Locally-tracked excess count.\n * @param char Pending input character (may be the mismatching char).\n * @param valueLength Value length at the current trie node.\n */\n flushAndEmitLegacyOrReject(consumed, excess, char, valueLength) {\n this.consumed = consumed;\n this.excess = excess;\n return this.result === 0 ||\n (this.decodeMode === DecodingMode.Attribute &&\n (valueLength === 0 ||\n excess > 1 ||\n isEntityInAttributeInvalidEnd(char)))\n ? 0\n : this.emitNotTerminatedNamedEntity();\n }\n /**\n * Parses a named entity.\n *\n * Equivalent to the `Named character reference state` in the HTML spec.\n * @param input The string containing the entity (or a continuation of the entity).\n * @param offset The current offset.\n * @returns The number of characters that were consumed, or -1 if the entity is incomplete.\n */\n stateNamedEntity(input, offset) {\n const { decodeTree } = this;\n const inputLength = input.length;\n const isStrict = this.decodeMode === DecodingMode.Strict;\n /*\n * Local copies of the resumable walk state avoid per-character\n * field writes. They are flushed back to the fields\n * on every exit (chunk end, and before any emit helper that reads\n * them). `this.result` is only written at the (rare) record points,\n * so it stays a direct field write.\n *\n * Legacy-match recording happens in two idempotent places: at the\n * loop top when sitting on a value node, and in the chunk-end\n * epilogue (so `end()` sees matches that land exactly on a chunk\n * boundary). Recording applies `consumed += excess - 1; excess = 1`,\n * which is a no-op when repeated — the loop-top invariant is\n * `excess` = unrecorded consumed characters + 1.\n */\n let { treeIndex } = this;\n let { excess } = this;\n let { consumed } = this;\n let current = decodeTree[treeIndex];\n while (offset < inputLength) {\n /*\n * Descend through value-less jump-table nodes (including the\n * single-branch encoding) inline, mirroring `decodeWithTrie`:\n * this avoids a `determineBranch` call per level for the\n * dominant node shape — including the root on the first write.\n */\n while ((current &\n (BinTrieFlags.VALUE_LENGTH | BinTrieFlags.FLAG13)) ===\n 0 &&\n (current & BinTrieFlags.JUMP_TABLE) !== 0) {\n const char = input.charCodeAt(offset);\n const jumpOffset = current & BinTrieFlags.JUMP_TABLE;\n const branchCount = (current & BinTrieFlags.BRANCH_LENGTH) >> 7;\n if (branchCount === 0) {\n // Single branch encoded inline in the jump offset bits.\n if (char !== jumpOffset) {\n return this.flushAndEmitLegacyOrReject(consumed, excess, char, 0);\n }\n treeIndex += 1;\n }\n else {\n const slot = char - jumpOffset;\n if (slot >>> 0 >= branchCount) {\n return this.flushAndEmitLegacyOrReject(consumed, excess, char, 0);\n }\n const stored = decodeTree[treeIndex + 1 + slot];\n if (stored === 0) {\n return this.flushAndEmitLegacyOrReject(consumed, excess, char, 0);\n }\n // End-relative: branch data ends at treeIndex+1+branchCount.\n treeIndex = (treeIndex + branchCount + stored) & 0xff_ff;\n }\n current = decodeTree[treeIndex];\n offset += 1;\n excess += 1;\n /*\n * `charCodeAt` past the end returns NaN, which would alias\n * to slot 0 after `>>> 0` — bail out explicitly.\n */\n // eslint-disable-next-line unicorn/no-break-in-nested-loop\n if (offset >= inputLength)\n break;\n }\n if (offset >= inputLength)\n break;\n // Handle compact runs (resumable across chunks).\n if ((current &\n (BinTrieFlags.VALUE_LENGTH | BinTrieFlags.FLAG13)) ===\n BinTrieFlags.FLAG13) {\n const runLength = (current & BinTrieFlags.BRANCH_LENGTH) >> 7; /* 3..63 */\n let { runConsumed } = this;\n // If we are starting a run, check the first char.\n if (runConsumed === 0) {\n const char = input.charCodeAt(offset);\n if (char !== (current & BinTrieFlags.JUMP_TABLE)) {\n return this.flushAndEmitLegacyOrReject(consumed, excess, char, 0);\n }\n offset += 1;\n excess += 1;\n runConsumed = 1;\n }\n // Check remaining characters in the run (packed two per uint16 word).\n while (runConsumed < runLength) {\n if (offset >= inputLength) {\n this.treeIndex = treeIndex;\n this.excess = excess;\n this.consumed = consumed;\n this.runConsumed = runConsumed;\n return -1;\n }\n const charIndexInPacked = runConsumed - 1;\n const packedWord = decodeTree[treeIndex + 1 + (charIndexInPacked >> 1)];\n const expectedChar = (packedWord >> ((charIndexInPacked & 1) << 3)) & 0xff;\n const char = input.charCodeAt(offset);\n if (char !== expectedChar) {\n this.runConsumed = 0;\n return this.flushAndEmitLegacyOrReject(consumed, excess, char, 0);\n }\n offset += 1;\n excess += 1;\n runConsumed += 1;\n }\n this.runConsumed = 0;\n treeIndex += 1 + (runLength >> 1);\n current = decodeTree[treeIndex];\n // Loop top handles the landed-on node (record/emit/branch).\n continue;\n }\n // Header plus out-of-line value words; 0 means no value.\n const valueLength = current >>> 14;\n const char = input.charCodeAt(offset);\n if (valueLength !== 0) {\n // Record a legacy match (FLAG13 clear = semicolon optional).\n if (!isStrict && (current & BinTrieFlags.FLAG13) === 0) {\n this.result = treeIndex;\n consumed += excess - 1;\n excess = 1;\n }\n /*\n * Implicit semicolon handling: emit immediately. Covers both\n * strict (FLAG13 set) and legacy entities — neither stores\n * an explicit `;` branch in the trie.\n */\n if (char === CharCodes.SEMI) {\n return this.emitNamedEntityData(treeIndex, valueLength, consumed + excess);\n }\n /*\n * `valueLength === 1` packs the codepoint into the header\n * word's low 13 bits, where branch metadata also lives. Skip\n * the branch lookup on leaves so those value bits aren't\n * reinterpreted as branch offsets.\n */\n if (valueLength === 1) {\n return this.flushAndEmitLegacyOrReject(consumed, excess, char, valueLength);\n }\n }\n // Value-bearing or dictionary node: dispatch through determineBranch.\n const next = determineBranch(decodeTree, current, treeIndex + (valueLength || 1), char);\n if (next < 0) {\n return this.flushAndEmitLegacyOrReject(consumed, excess, char, valueLength);\n }\n treeIndex = next;\n current = decodeTree[treeIndex];\n offset += 1;\n excess += 1;\n }\n /*\n * Chunk exhausted. Record a legacy match we may be sitting on, so a\n * subsequent `end()` emits it, then persist the walk state.\n */\n if (!isStrict &&\n current >>> 14 !== 0 &&\n (current & BinTrieFlags.FLAG13) === 0) {\n this.result = treeIndex;\n consumed += excess - 1;\n excess = 1;\n }\n this.treeIndex = treeIndex;\n this.excess = excess;\n this.consumed = consumed;\n return -1;\n }\n /**\n * Emit a named entity that was not terminated with a semicolon.\n * @returns The number of characters consumed.\n */\n emitNotTerminatedNamedEntity() {\n const { result, decodeTree } = this;\n const valueLength = decodeTree[result] >>> 14;\n this.emitNamedEntityData(result, valueLength, this.consumed);\n this.errors?.missingSemicolonAfterCharacterReference();\n return this.consumed;\n }\n /**\n * Emit a named entity.\n * @param result The index of the entity in the decode tree.\n * @param valueLength Encoded value length (header plus any value words).\n * @param consumed The number of characters consumed.\n * @returns The number of characters consumed.\n */\n emitNamedEntityData(result, valueLength, consumed) {\n const { decodeTree } = this;\n this.emitCodePoint(valueLength === 1\n ? decodeTree[result] & BinTrieFlags.VALUE_MASK\n : decodeTree[result + 1], consumed);\n if (valueLength === 3) {\n // Emit the second UTF-16 code unit.\n this.emitCodePoint(decodeTree[result + 2], consumed);\n }\n return consumed;\n }\n /**\n * Signal to the parser that the end of the input was reached.\n *\n * Remaining data will be emitted and relevant errors will be produced.\n * @returns The number of characters consumed.\n */\n end() {\n switch (this.state) {\n case EntityDecoderState.NamedEntity: {\n // Emit a named entity if we have one.\n return this.result !== 0 &&\n (this.decodeMode !== DecodingMode.Attribute ||\n this.result === this.treeIndex)\n ? this.emitNotTerminatedNamedEntity()\n : 0;\n }\n // Otherwise, emit a numeric entity if we have one.\n case EntityDecoderState.NumericDecimal: {\n return this.emitNumericEntity(0, 2);\n }\n case EntityDecoderState.NumericHex: {\n return this.emitNumericEntity(0, 3);\n }\n case EntityDecoderState.NumericStart: {\n this.errors?.absenceOfDigitsInNumericCharacterReference(this.consumed);\n return 0;\n }\n default: {\n // EntityStart or unknown — return 0.\n return 0;\n }\n }\n }\n}\n/**\n * Determines the branch of the current node that is taken given the current\n * character. This function is used to traverse the trie.\n *\n * See `BinTrieFlags` for the branch-data layouts handled here.\n * @param decodeTree The trie.\n * @param current The current node's header word.\n * @param nodeIndex Index of the node's first branch-data word (the header\n * plus any value words have been skipped by the caller).\n * @param char The current character.\n * @returns The index of the next node, or -1 if no branch is taken.\n */\nexport function determineBranch(decodeTree, current, nodeIndex, char) {\n const branchCount = (current & BinTrieFlags.BRANCH_LENGTH) >> 7;\n const jumpOffset = current & BinTrieFlags.JUMP_TABLE;\n // Case 1: Single branch or jump table (jumpOffset encodes the first/only char code).\n if (jumpOffset) {\n if (branchCount === 0) {\n // Single branch encoded inline in the jump offset bits.\n return char === jumpOffset ? nodeIndex : -1;\n }\n /*\n * Jump table: branchCount consecutive slots starting at jumpOffset.\n * Unsigned comparison handles both < 0 and >= branchCount in one check.\n */\n const slot = char - jumpOffset;\n if (slot >>> 0 >= branchCount)\n return -1;\n const stored = decodeTree[nodeIndex + slot];\n /*\n * 0 = empty slot (no branch); otherwise the child's offset from the\n * end of the branch array, +1 (end-relative pointers compress\n * better). `& 0xff_ff` mirrors the encoder's uint16 wrap for\n * backreferences to already-encoded nodes.\n */\n return stored === 0\n ? -1\n : (nodeIndex + branchCount + stored - 1) & 0xff_ff;\n }\n /*\n * Case 2: Packed dictionary. Linear scan — over 90% of dict nodes have\n * <= 4 branches in the HTML trie, where the constant-factor savings\n * dominate over binary search's asymptotic edge.\n */\n if (branchCount === 0)\n return -1;\n const packedKeySlots = (branchCount + 1) >> 1;\n const branchEnd = nodeIndex + packedKeySlots + branchCount;\n for (let index = 0; index < branchCount; index++) {\n const packed = decodeTree[nodeIndex + (index >> 1)];\n const key = (packed >> ((index & 1) << 3)) & 0xff;\n if (key === char) {\n const pointerIndex = nodeIndex + packedKeySlots + index;\n // Pointers are relative to the end of the branch data.\n return (branchEnd + decodeTree[pointerIndex]) & 0xff_ff;\n }\n // Keys are sorted; if we've passed `char`, no match is possible.\n if (key > char)\n return -1;\n }\n return -1;\n}\n/**\n * Read the decoded value from a trie node.\n * @param decodeTree The trie.\n * @param nodeIndex The index of the node.\n * @param valueLength The length of the value (1, 2, or 3).\n * @returns The decoded string.\n */\nfunction readTrieValue(decodeTree, nodeIndex, valueLength) {\n if (valueLength === 1) {\n return String.fromCharCode(decodeTree[nodeIndex] & BinTrieFlags.VALUE_MASK);\n }\n if (valueLength === 2) {\n return String.fromCharCode(decodeTree[nodeIndex + 1]);\n }\n return String.fromCharCode(decodeTree[nodeIndex + 1], decodeTree[nodeIndex + 2]);\n}\n/**\n * Parse a numeric entity (`&#DDD;` or `&#xHHH;`).\n *\n * Encodes the result as `(consumed << CONSUMED_SHIFT) | codepoint` (see\n * the packing comment at the top of the file; overlong entities spill\n * their length into `longNumericConsumed`). Returns 0 when no digits were\n * found.\n *\n * This is the sync counterpart of the streaming\n * `EntityDecoder#stateNumericDecimal` / `#stateNumericHex`. Digit parsing\n * matches those methods; only this packed result needs a value clamp.\n * @param input The input string.\n * @param numberStart Index of the `#` character.\n * @param inputLength Cached `input.length`.\n */\nfunction parseNumericEntity(input, numberStart, inputLength) {\n let offset = numberStart + 1; // Skip \"#\"\n let cp = 0;\n let digitStart = offset;\n /*\n * Separate decimal and hexadecimal loops: each multiplies by a constant\n * and runs a single digit test, instead of a per-character base check.\n */\n if (offset < inputLength &&\n (input.charCodeAt(offset) | TO_LOWER_BIT) === CharCodes.LOWER_X) {\n offset += 1;\n digitStart = offset;\n while (offset < inputLength) {\n const char = input.charCodeAt(offset);\n if (isNumber(char)) {\n cp = cp * 16 + (char - CharCodes.ZERO);\n }\n else if (isHexadecimalCharacter(char)) {\n cp = cp * 16 + ((char | TO_LOWER_BIT) - CharCodes.LOWER_A + 10);\n }\n else {\n break;\n }\n offset += 1;\n }\n }\n else {\n while (offset < inputLength) {\n const digit = input.charCodeAt(offset) - CharCodes.ZERO;\n if (digit >>> 0 > 9)\n break;\n cp = cp * 10 + digit;\n offset += 1;\n }\n }\n if (offset === digitStart)\n return 0;\n // Include the semicolon in consumed when present.\n if (offset < inputLength && input.charCodeAt(offset) === CharCodes.SEMI) {\n offset += 1;\n }\n /*\n * Clamp out-of-range values to 0x110000 so they fit the 21-bit field\n * and decode to U+FFFD. Lengths at or above CONSUMED_OVERFLOW use the\n * side channel described with the packing constants.\n */\n if (cp > 0x10_ff_ff)\n cp = 0x11_00_00;\n let consumed = offset - numberStart;\n if (consumed >= CONSUMED_OVERFLOW) {\n // eslint-disable-next-line unicorn/no-top-level-assignment-in-function -- deliberate side channel, see `longNumericConsumed`\n longNumericConsumed = consumed;\n consumed = CONSUMED_OVERFLOW;\n }\n return (consumed << CONSUMED_SHIFT) | cp;\n}\n/**\n * Decode all entities in `input` using the HTML trie.\n *\n * Hard-wired to `htmlDecodeTree`: the inline root navigation below assumes\n * the HTML root's jump-table shape, so this must not be generalized to\n * other tries (the XML trie's dictionary root would silently match no\n * entities — `decodeXML` has its own hand-coded fast path instead).\n * @param input The string to decode.\n * @param isStrict Only match semicolon-terminated entities.\n * @param isAttribute Whether to apply attribute-specific parsing rules (disallowing certain non-semicolon terminators).\n * @returns The decoded string.\n */\nfunction decodeWithTrie(input, isStrict, isAttribute) {\n const decodeTree = htmlDecodeTree;\n // Fast path: no entities at all — return input without any allocation.\n let offset = input.indexOf(\"&\");\n if (offset < 0)\n return input;\n const inputLength = input.length;\n /*\n * `chunkStart` marks the start of the next pending slice. Rejected\n * entities don't advance it, so consecutive rejections are stitched\n * into a single `slice` once a real match (or end of input) is hit.\n */\n let chunkStart = 0;\n let result = \"\";\n /*\n * Root navigation fields, hoisted out of the per-entity loop. The HTML\n * root is a multi-branch jump-table covering [A-Za-z]; see the inline\n * first-iteration comment below.\n */\n const root = decodeTree[0];\n const rootJumpOffset = root & BinTrieFlags.JUMP_TABLE;\n const rootBranchCount = (root & BinTrieFlags.BRANCH_LENGTH) >> 7;\n do {\n const entityStart = offset + 1;\n // Quick check: entity names must start with [A-Za-z], numeric with #.\n const firstChar = input.charCodeAt(entityStart);\n let consumed;\n let value;\n if (firstChar === CharCodes.NUM) {\n const packed = parseNumericEntity(input, entityStart, inputLength);\n consumed = unpackConsumed(packed);\n // In strict mode, require semicolon termination.\n if (isStrict &&\n consumed > 0 &&\n input.charCodeAt(entityStart + consumed - 1) !== CharCodes.SEMI) {\n consumed = 0;\n }\n value =\n consumed === 0\n ? \"\"\n : codePointToString(packed & CODE_POINT_MASK);\n }\n else if (isAlpha(firstChar)) {\n consumed = 0;\n value = \"\";\n /*\n * The generator guarantees a jump-table root. Consume the first\n * character directly, then walk from its child.\n */\n const rootSlotIndex = firstChar - rootJumpOffset;\n let nodeIndex;\n if (rootSlotIndex >>> 0 < rootBranchCount) {\n const stored = decodeTree[1 + rootSlotIndex];\n nodeIndex =\n stored === 0 ? -1 : (rootBranchCount + stored) & 0xff_ff;\n }\n else {\n nodeIndex = -1;\n }\n /*\n * Best legacy (no-semicolon) match so far, as trie coordinates.\n * Deferring `readTrieValue` to the end avoids allocating a\n * string for matches that longer matches supersede.\n */\n let bestNodeIndex = 0;\n let bestValueLength = 0;\n let current = nodeIndex < 0 ? 0 : decodeTree[nodeIndex];\n let index = entityStart + 1;\n /*\n * Walk the trie from the root child. The `trie` label lets the\n * inner descent and compact-run loops abandon the entity (and\n * fall through to the legacy/reject handling) directly.\n */\n trie: while (index < inputLength) {\n /*\n * Inline value-less jump tables and single branches. A miss\n * falls through to the recorded legacy match or rejection.\n */\n while (\n // Value-less, non-run node with a nonzero jump offset.\n (current &\n (BinTrieFlags.VALUE_LENGTH | BinTrieFlags.FLAG13)) ===\n 0 &&\n (current & BinTrieFlags.JUMP_TABLE) !== 0) {\n const jumpOffset = current & BinTrieFlags.JUMP_TABLE;\n const branchCount = (current & BinTrieFlags.BRANCH_LENGTH) >> 7;\n if (branchCount === 0) {\n // Single branch encoded inline in the jump offset bits.\n if (input.charCodeAt(index) !== jumpOffset)\n break trie;\n nodeIndex += 1;\n }\n else {\n const slot = input.charCodeAt(index) - jumpOffset;\n if (slot >>> 0 >= branchCount)\n break trie;\n const stored = decodeTree[nodeIndex + 1 + slot];\n if (stored === 0)\n break trie;\n // End-relative: branch data ends at nodeIndex+1+branchCount.\n nodeIndex =\n (nodeIndex + branchCount + stored) & 0xff_ff;\n }\n current = decodeTree[nodeIndex];\n index += 1;\n /*\n * `charCodeAt` past the end returns NaN, which would\n * alias to slot 0 after `>>> 0` — bail out explicitly.\n */\n if (index >= inputLength)\n break trie;\n }\n // FLAG13 without a value marks a compact run.\n if ((current &\n (BinTrieFlags.VALUE_LENGTH | BinTrieFlags.FLAG13)) ===\n BinTrieFlags.FLAG13) {\n const runLength = (current & BinTrieFlags.BRANCH_LENGTH) >> 7;\n // Check first char (stored in JUMP_TABLE bits).\n if (input.charCodeAt(index) !==\n (current & BinTrieFlags.JUMP_TABLE)) {\n // eslint-disable-next-line unicorn/no-break-in-nested-loop\n break;\n }\n index += 1;\n // Check remaining characters (packed two per uint16 word).\n const remaining = runLength - 1;\n let wordIndex = nodeIndex + 1;\n let charIndexInPacked = 0;\n /*\n * Process pairs: read one packed word, compare low byte then high byte.\n * No explicit bounds check needed — charCodeAt returns NaN for OOB,\n * which never equals an integer, so the mismatch break fires naturally.\n */\n for (; charIndexInPacked + 1 < remaining; charIndexInPacked += 2) {\n const packed = decodeTree[wordIndex];\n if (input.charCodeAt(index) !== (packed & 0xff))\n break trie;\n index += 1;\n if (input.charCodeAt(index) !== ((packed >> 8) & 0xff))\n break trie;\n index += 1;\n wordIndex += 1;\n }\n // Handle odd trailing char.\n if (charIndexInPacked < remaining) {\n if (input.charCodeAt(index) !==\n (decodeTree[wordIndex] & 0xff))\n // eslint-disable-next-line unicorn/no-break-in-nested-loop\n break;\n index += 1;\n }\n nodeIndex += 1 + (runLength >> 1);\n current = decodeTree[nodeIndex];\n // eslint-disable-next-line unicorn/no-break-in-nested-loop\n continue;\n }\n // Header plus out-of-line value words; 0 means no value.\n const valueLength = current >>> 14;\n const char = input.charCodeAt(index);\n /*\n * Check current node for a value before navigating.\n * This handles both: (a) values reached via compact runs on the\n * previous iteration, and (b) values at regular branch targets.\n */\n if (valueLength !== 0) {\n // If char is `;`, emit immediately.\n if (char === CharCodes.SEMI) {\n consumed = index - entityStart + 1;\n // Inline leaves carry the value in the low 13 bits.\n value =\n valueLength === 1\n ? String.fromCharCode(current & BinTrieFlags.VALUE_MASK)\n : readTrieValue(decodeTree, nodeIndex, valueLength);\n // eslint-disable-next-line unicorn/no-break-in-nested-loop\n break;\n }\n // Record non-terminated (legacy) match (FLAG13 clear = semicolon optional).\n if (!isStrict && (current & BinTrieFlags.FLAG13) === 0) {\n consumed = index - entityStart;\n bestNodeIndex = nodeIndex;\n bestValueLength = valueLength;\n }\n /*\n * A valueLength of 1 means the value is packed inline in the header\n * word — these are always leaf nodes with no branches, so we can\n * stop walking the trie.\n */\n // eslint-disable-next-line unicorn/no-break-in-nested-loop\n if (valueLength === 1)\n break;\n }\n // Navigate to the next node (valueLength || 1: skip past value words, minimum 1 for header).\n const next = determineBranch(decodeTree, current, nodeIndex + (valueLength || 1), char);\n // eslint-disable-next-line unicorn/no-break-in-nested-loop\n if (next < 0)\n break;\n nodeIndex = next;\n current = decodeTree[nodeIndex];\n index += 1;\n }\n /*\n * Post-loop: if the semicolon path didn't set value,\n * check for a final legacy match. The last navigation may\n * have landed on a legacy node whose value hasn't been\n * recorded yet (loop exited before the top-of-loop check\n * could run).\n */\n if (value === \"\") {\n const finalVL = current >>> 14;\n if (finalVL !== 0 &&\n !isStrict &&\n (current & BinTrieFlags.FLAG13) === 0) {\n consumed = index - entityStart;\n bestNodeIndex = nodeIndex;\n bestValueLength = finalVL;\n }\n if (consumed > 0) {\n value = readTrieValue(decodeTree, bestNodeIndex, bestValueLength);\n }\n }\n }\n else {\n consumed = 0;\n value = \"\";\n }\n /*\n * The attribute end-char rule (HTML spec §13.2.5.73) only applies to\n * unterminated *named* references. Semicolon-terminated entities and\n * numeric entities are always accepted, matching EntityDecoder behavior.\n *\n * When `attribute` is false (the common case), short-circuit skips all\n * the unterminated-named checks entirely.\n */\n if (consumed === 0 ||\n (isAttribute &&\n firstChar !== CharCodes.NUM &&\n input.charCodeAt(entityStart + consumed - 1) !==\n CharCodes.SEMI &&\n entityStart + consumed < inputLength &&\n isEntityInAttributeInvalidEnd(input.charCodeAt(entityStart + consumed)))) {\n // Rejected: leave `&` in the pending chunk, scan past it.\n offset = entityStart;\n }\n else {\n if (chunkStart < offset) {\n result += input.slice(chunkStart, offset);\n }\n result += value;\n offset = chunkStart = entityStart + consumed;\n }\n /*\n * Adjacent entities (`&x;&y;`) are common in entity-dense input;\n * checking the single character at `offset` first skips the\n * `indexOf` call (and its per-call overhead) for that case.\n */\n if (input.charCodeAt(offset) !== CharCodes.AMP) {\n offset = input.indexOf(\"&\", offset);\n }\n } while (offset >= 0);\n return result + input.slice(chunkStart);\n}\n/**\n * Decodes an HTML string.\n * @param htmlString The string to decode.\n * @param mode The decoding mode.\n * @returns The decoded string.\n */\nexport function decodeHTML(htmlString, mode = DecodingMode.Legacy) {\n return decodeWithTrie(htmlString, mode === DecodingMode.Strict, mode === DecodingMode.Attribute);\n}\n/**\n * Decodes an HTML string in an attribute.\n * @param htmlAttribute The string to decode.\n * @returns The decoded string.\n */\nexport function decodeHTMLAttribute(htmlAttribute) {\n return decodeWithTrie(htmlAttribute, false, true);\n}\n/**\n * Decodes an HTML string, requiring all entities to be terminated by a semicolon.\n * @param htmlString The string to decode.\n * @returns The decoded string.\n */\nexport function decodeHTMLStrict(htmlString) {\n return decodeWithTrie(htmlString, true, false);\n}\n/**\n * Decodes an XML string, requiring all entities to be terminated by a semicolon.\n *\n * Uses a hand-coded fast path for the 5 XML named entities (amp, lt, gt,\n * quot, apos) plus numeric entities, bypassing the trie entirely.\n * @param xmlString The string to decode.\n * @returns The decoded string.\n */\nexport function decodeXML(xmlString) {\n let offset = xmlString.indexOf(\"&\");\n if (offset < 0)\n return xmlString;\n let lastIndex = 0;\n let result = \"\";\n do {\n const start = offset + 1;\n let consumed = 0;\n let value = \"\";\n const c1 = xmlString.charCodeAt(start);\n if (c1 === CharCodes.NUM) {\n const packed = parseNumericEntity(xmlString, start, xmlString.length);\n consumed = unpackConsumed(packed);\n // XML is always strict — require semicolon.\n if (consumed === 0 ||\n xmlString.charCodeAt(start + consumed - 1) !== CharCodes.SEMI) {\n consumed = 0;\n }\n else {\n const codePoint = packed & CODE_POINT_MASK;\n // Nonzero BMP values below the surrogate range need no replacement.\n value =\n (codePoint - 1) >>> 0 < 0xd7_ff\n ? String.fromCharCode(codePoint)\n : String.fromCodePoint(replaceCodePointXML(codePoint));\n }\n }\n else {\n /* eslint-disable unicorn/no-break-in-nested-loop -- Keep XML name dispatch inline with the decode loop. */\n switch (c1) {\n // &lt; / &gt;\n case 0x6c:\n case 0x67: {\n if (xmlString.charCodeAt(start + 1) === 0x74 &&\n xmlString.charCodeAt(start + 2) === CharCodes.SEMI) {\n consumed = 3;\n value = c1 === 0x6c ? \"<\" : \">\";\n }\n break;\n }\n // &amp; / &apos;\n case 0x61: {\n const c2 = xmlString.charCodeAt(start + 1);\n if (c2 === 0x6d &&\n xmlString.charCodeAt(start + 2) === 0x70 &&\n xmlString.charCodeAt(start + 3) === CharCodes.SEMI) {\n consumed = 4;\n value = \"&\";\n }\n else if (c2 === 0x70 &&\n xmlString.charCodeAt(start + 2) === 0x6f &&\n xmlString.charCodeAt(start + 3) === 0x73 &&\n xmlString.charCodeAt(start + 4) === CharCodes.SEMI) {\n consumed = 5;\n value = \"'\";\n }\n break;\n }\n // &quot;\n case 0x71: {\n if (xmlString.charCodeAt(start + 1) === 0x75 &&\n xmlString.charCodeAt(start + 2) === 0x6f &&\n xmlString.charCodeAt(start + 3) === 0x74 &&\n xmlString.charCodeAt(start + 4) === CharCodes.SEMI) {\n consumed = 5;\n value = '\"';\n }\n break;\n }\n }\n /* eslint-enable unicorn/no-break-in-nested-loop */\n }\n if (consumed > 0) {\n if (lastIndex < offset)\n result += xmlString.slice(lastIndex, offset);\n result += value;\n offset = lastIndex = start + consumed;\n }\n else {\n offset = start;\n }\n /*\n * Adjacent entities (`&x;&y;`) are common in entity-dense input;\n * checking the single character at `lastIndex` first skips the\n * `indexOf` call (and its per-call overhead) for that case.\n */\n offset =\n xmlString.charCodeAt(offset) === CharCodes.AMP\n ? offset\n : xmlString.indexOf(\"&\", offset);\n } while (offset >= 0);\n return result + xmlString.slice(lastIndex);\n}\nexport { replaceCodePoint, replaceCodePointXML, } from \"./decode-codepoint.js\";\n// Re-export for use by eg. htmlparser2\nexport { htmlDecodeTree } from \"./generated/decode-data-html.js\";\nexport { xmlDecodeTree } from \"./generated/decode-data-xml.js\";\n//# sourceMappingURL=decode.js.map","/**\n * Common utility functions exposed through `md.utils` for use by plugins.\n *\n * @module md.utils\n */\n\nimport * as mdurl from 'mdurl'\nimport * as ucmicro from 'uc.micro'\nimport { decodeHTMLStrict } from 'entities'\n\n/** @hidden */\ntype ClassToWrap = new (...args: any[]) => object\n\n/** Wraps a class so it can be called with or without `new`. */\nfunction callable<T extends ClassToWrap> (\n cls: T\n): T & ((...args: ConstructorParameters<T>) => InstanceType<T>)\nfunction callable<T extends ClassToWrap> (cls: T) {\n const wrapper = function (...args: ConstructorParameters<T>) {\n const newTarget =\n new.target && new.target !== wrapper\n ? new.target\n : cls\n\n return Reflect.construct(cls, args, newTarget)\n }\n\n Object.defineProperty(wrapper, 'name', { value: cls.name })\n Object.setPrototypeOf(wrapper, cls)\n wrapper.prototype = cls.prototype\n\n return wrapper\n}\n\n/**\n * Returns a copy of a token array with the token at `pos` replaced by\n * `newElements`. Used to transform token streams without modifying the\n * original array.\n */\nfunction arrayReplaceAt<T> (src: T[], pos: number, newElements: T[]): T[] {\n return ([] as T[]).concat(src.slice(0, pos), newElements, src.slice(pos + 1))\n}\n\n/** Checks whether a code point can be decoded from a numeric HTML entity. */\nfunction isValidEntityCode (c: number) {\n // broken sequence\n if (c >= 0xD800 && c <= 0xDFFF) { return false }\n // never used\n if (c >= 0xFDD0 && c <= 0xFDEF) { return false }\n if ((c & 0xFFFF) === 0xFFFF || (c & 0xFFFF) === 0xFFFE) { return false }\n // control codes\n if (c >= 0x00 && c <= 0x08) { return false }\n if (c === 0x0B) { return false }\n if (c >= 0x0E && c <= 0x1F) { return false }\n if (c >= 0x7F && c <= 0x9F) { return false }\n // out of range\n if (c > 0x10FFFF) { return false }\n return true\n}\n\n/**\n * Converts a Unicode code point to a string, like `String.fromCodePoint()`,\n * but does not throw for invalid input.\n */\nfunction fromCodePoint (c: number) {\n /* eslint no-bitwise:0 */\n if (c > 0xffff) {\n c -= 0x10000\n const surrogate1 = 0xd800 + (c >> 10)\n const surrogate2 = 0xdc00 + (c & 0x3ff)\n\n return String.fromCharCode(surrogate1, surrogate2)\n }\n return String.fromCharCode(c)\n}\n\nconst UNESCAPE_MD_RE = /\\\\([!\"#$%&'()*+,\\-./:;<=>?@[\\\\\\]^_`{|}~])/g\nconst ENTITY_RE = /&([a-z#][a-z0-9]{1,31});/gi\nconst UNESCAPE_ALL_RE = new RegExp(`${UNESCAPE_MD_RE.source}|${ENTITY_RE.source}`, 'gi')\n\nconst DIGITAL_ENTITY_TEST_RE = /^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i\n\nfunction replaceEntityPattern (match: string, name: string) {\n if (name.charCodeAt(0) === 0x23/* # */ && DIGITAL_ENTITY_TEST_RE.test(name)) {\n const code = name[1].toLowerCase() === 'x'\n ? parseInt(name.slice(2), 16)\n : parseInt(name.slice(1), 10)\n\n if (isValidEntityCode(code)) {\n return fromCodePoint(code)\n }\n\n return match\n }\n\n const decoded = decodeHTMLStrict(match)\n if (decoded !== match) {\n return decoded\n }\n\n return match\n}\n\n/** Decodes Markdown backslash escapes. */\nfunction unescapeMd (str: string) {\n if (str.indexOf('\\\\') < 0) { return str }\n return str.replace(UNESCAPE_MD_RE, '$1')\n}\n\n/**\n * Decodes Markdown backslash escapes and HTML character references in link\n * destinations, link titles, and fenced code info strings.\n */\nfunction unescapeAll (str: string) {\n if (str.indexOf('\\\\') < 0 && str.indexOf('&') < 0) { return str }\n\n return str.replace(UNESCAPE_ALL_RE, function (match, escaped, entity) {\n if (escaped) { return escaped }\n return replaceEntityPattern(match, entity)\n })\n}\n\nconst HTML_ESCAPE_TEST_RE = /[&<>\"]/\nconst HTML_ESCAPE_REPLACE_RE = /[&<>\"]/g\nconst HTML_REPLACEMENTS = {\n '&': '&amp;',\n '<': '&lt;',\n '>': '&gt;',\n '\"': '&quot;'\n}\n\nfunction replaceUnsafeChar (ch: string): string {\n return HTML_REPLACEMENTS[ch as keyof typeof HTML_REPLACEMENTS]\n}\n\n/** Escapes HTML special characters in a string. */\nfunction escapeHtml (str: string) {\n if (HTML_ESCAPE_TEST_RE.test(str)) {\n return str.replace(HTML_ESCAPE_REPLACE_RE, replaceUnsafeChar)\n }\n return str\n}\n\nconst REGEXP_ESCAPE_RE = /[.?*+^$[\\]\\\\(){}|-]/g\n\n/** Escapes regular expression metacharacters in a string. */\nfunction escapeRE (str: string) {\n return str.replace(REGEXP_ESCAPE_RE, '\\\\$&')\n}\n\n/** Checks whether a character code is an ASCII space or tab. */\nfunction isSpace (code: number) {\n switch (code) {\n case 0x09:\n case 0x20:\n return true\n }\n return false\n}\n\n/**\n * Checks whether a character code is whitespace recognized by Markdown.\n *\n * Matches the Unicode `Zs` category or `\\t`, `\\f`, `\\v`, `\\r`, `\\n`.\n */\nfunction isWhiteSpace (code: number) {\n if (code >= 0x2000 && code <= 0x200A) { return true }\n switch (code) {\n case 0x09: // \\t\n case 0x0A: // \\n\n case 0x0B: // \\v\n case 0x0C: // \\f\n case 0x0D: // \\r\n case 0x20:\n case 0xA0:\n case 0x1680:\n case 0x202F:\n case 0x205F:\n case 0x3000:\n return true\n }\n return false\n}\n\n/**\n * Checks whether a character is Unicode punctuation or a symbol.\n *\n * Does not support astral characters.\n */\nfunction isPunctChar (ch: string) {\n return ucmicro.P.test(ch) || ucmicro.S.test(ch)\n}\n\n/** Checks whether a Unicode code point is punctuation or a symbol. */\nfunction isPunctCharCode (code: number) {\n return isPunctChar(fromCodePoint(code))\n}\n\n/**\n * Markdown ASCII punctuation characters.\n *\n * !, \", #, $, %, &, ', (, ), *, +, ,, -, ., /, :, ;, <, =, >, ?, @,\n * [, \\, ], ^, _, `, {, |, }, or ~\n *\n * http://spec.commonmark.org/0.15/#ascii-punctuation-character\n *\n * Don't confuse with Unicode punctuation. It lacks some characters in the\n * ASCII range.\n */\nfunction isMdAsciiPunct (ch: number) {\n switch (ch) {\n case 0x21/* ! */:\n case 0x22/* \" */:\n case 0x23/* # */:\n case 0x24/* $ */:\n case 0x25/* % */:\n case 0x26/* & */:\n case 0x27/* ' */:\n case 0x28/* ( */:\n case 0x29/* ) */:\n case 0x2A/* * */:\n case 0x2B/* + */:\n case 0x2C/* , */:\n case 0x2D/* - */:\n case 0x2E/* . */:\n case 0x2F/* / */:\n case 0x3A/* : */:\n case 0x3B/* ; */:\n case 0x3C/* < */:\n case 0x3D/* = */:\n case 0x3E/* > */:\n case 0x3F/* ? */:\n case 0x40/* @ */:\n case 0x5B/* [ */:\n case 0x5C/* \\ */:\n case 0x5D/* ] */:\n case 0x5E/* ^ */:\n case 0x5F/* _ */:\n case 0x60/* ` */:\n case 0x7B/* { */:\n case 0x7C/* | */:\n case 0x7D/* } */:\n case 0x7E/* ~ */:\n return true\n default:\n return false\n }\n}\n\n/** Normalizes `[reference labels]` for case-insensitive lookup. */\nfunction normalizeReference (str: string) {\n // Trim and collapse whitespace\n //\n str = str.trim().replace(/\\s+/g, ' ')\n\n // .toLowerCase().toUpperCase() should get rid of all differences\n // between letter variants.\n //\n // Simple .toLowerCase() doesn't normalize 125 code points correctly,\n // and .toUpperCase doesn't normalize 6 of them (list of exceptions:\n // İ, ϴ, ẞ, Ω, K, Å - those are already uppercased, but have differently\n // uppercased versions).\n //\n // Here's an example showing how it happens. Lets take greek letter omega:\n // uppercase U+0398 (Θ), U+03f4 (ϴ) and lowercase U+03b8 (θ), U+03d1 (ϑ)\n //\n // Unicode entries:\n // 0398;GREEK CAPITAL LETTER THETA;Lu;0;L;;;;;N;;;;03B8;\n // 03B8;GREEK SMALL LETTER THETA;Ll;0;L;;;;;N;;;0398;;0398\n // 03D1;GREEK THETA SYMBOL;Ll;0;L;<compat> 03B8;;;;N;GREEK SMALL LETTER SCRIPT THETA;;0398;;0398\n // 03F4;GREEK CAPITAL THETA SYMBOL;Lu;0;L;<compat> 0398;;;;N;;;;03B8;\n //\n // Case-insensitive comparison should treat all of them as equivalent.\n //\n // But .toLowerCase() doesn't change ϑ (it's already lowercase),\n // and .toUpperCase() doesn't change ϴ (already uppercase).\n //\n // Applying first lower then upper case normalizes any character:\n // '\\u0398\\u03f4\\u03b8\\u03d1'.toLowerCase().toUpperCase() === '\\u0398\\u0398\\u0398\\u0398'\n //\n // Note: this is equivalent to unicode case folding; unicode normalization\n // is a different step that is not required here.\n //\n // Final result should be uppercased, because it's later stored in an object\n // (this avoid a conflict with Object.prototype members,\n // most notably, `__proto__`)\n //\n return str.toLowerCase().toUpperCase()\n}\n\nfunction isAsciiTrimmable (c: number) {\n return c === 0x20 || c === 0x09 || c === 0x0a || c === 0x0d\n}\n\n/**\n * \"Light\" `.trim()` for blocks (headings, paragraphs), where Unicode spaces\n * should be preserved.\n */\nfunction asciiTrim (str: string) {\n let start = 0\n for (; start < str.length; start++) {\n if (!isAsciiTrimmable(str.charCodeAt(start))) {\n break\n }\n }\n let end = str.length - 1\n for (; end >= start; end--) {\n if (!isAsciiTrimmable(str.charCodeAt(end))) {\n break\n }\n }\n return str.slice(start, end + 1)\n}\n\n/**\n * Libraries commonly used by markdown-it and its plugins, re-exported to\n * reduce duplicate dependencies in browser bundles.\n */\nconst lib = { mdurl, ucmicro }\n\nexport {\n lib,\n callable,\n unescapeMd,\n unescapeAll,\n isValidEntityCode,\n fromCodePoint,\n escapeHtml,\n arrayReplaceAt,\n isSpace,\n isWhiteSpace,\n isMdAsciiPunct,\n isPunctChar,\n isPunctCharCode,\n escapeRE,\n normalizeReference,\n asciiTrim\n}\n","import type StateInline from '../rules_inline/state_inline.ts'\n\n/** Finds the end of a link or image label (`[label]`). */\nexport default function parseLinkLabel (state: StateInline, start: number, disableNested?: boolean): number {\n let level, found, marker, prevPos\n\n const max = state.posMax\n const oldPos = state.pos\n\n state.pos = start + 1\n level = 1\n\n while (state.pos < max) {\n marker = state.src.charCodeAt(state.pos)\n if (marker === 0x5D /* ] */) {\n level--\n if (level === 0) {\n found = true\n break\n }\n }\n\n prevPos = state.pos\n state.md.inline.skipToken(state)\n if (marker === 0x5B /* [ */) {\n if (prevPos === state.pos - 1) {\n // increase level if we find text `[`, which is not a part of any token\n level++\n } else if (disableNested) {\n state.pos = oldPos\n return -1\n }\n }\n }\n\n let labelEnd = -1\n\n if (found) {\n labelEnd = state.pos\n }\n\n // restore old state\n state.pos = oldPos\n\n return labelEnd\n}\n","import { unescapeAll } from '../common/utils.ts'\n\n/** Parses the destination in `[label](destination \"title\")`. */\nexport default function parseLinkDestination (str: string, start: number, max: number) {\n let code\n let pos = start\n\n const result = {\n ok: false,\n pos: 0,\n str: ''\n }\n\n if (str.charCodeAt(pos) === 0x3C /* < */) {\n pos++\n while (pos < max) {\n code = str.charCodeAt(pos)\n if (code === 0x0A /* \\n */) { return result }\n if (code === 0x3C /* < */) { return result }\n if (code === 0x3E /* > */) {\n result.pos = pos + 1\n result.str = unescapeAll(str.slice(start + 1, pos))\n result.ok = true\n return result\n }\n if (code === 0x5C /* \\ */ && pos + 1 < max) {\n pos += 2\n continue\n }\n\n pos++\n }\n\n // no closing '>'\n return result\n }\n\n // this should be ... } else { ... branch\n\n let level = 0\n while (pos < max) {\n code = str.charCodeAt(pos)\n\n if (code === 0x20) { break }\n\n // ascii control characters\n if (code < 0x20 || code === 0x7F) { break }\n\n if (code === 0x5C /* \\ */ && pos + 1 < max) {\n if (str.charCodeAt(pos + 1) === 0x20) { pos++; continue }\n pos += 2\n continue\n }\n\n if (code === 0x28 /* ( */) {\n level++\n if (level > 32) { return result }\n }\n\n if (code === 0x29 /* ) */) {\n if (level === 0) { break }\n level--\n }\n\n pos++\n }\n\n if (start === pos) { return result }\n if (level !== 0) { return result }\n\n result.str = unescapeAll(str.slice(start, pos))\n result.pos = pos\n result.ok = true\n return result\n}\n","import { unescapeAll } from '../common/utils.ts'\n\n/** @inline */\ninterface ParseLinkTitleResult {\n ok: boolean\n can_continue: boolean\n pos: number\n str: string\n marker: number\n}\n\n/**\n * Parses the optional title in `[label](destination \"title\")` or\n * `[label]: destination \"title\"`.\n *\n * `prev_state` continues a reference title on the next source line.\n */\nexport default function parseLinkTitle (\n str: string,\n start: number,\n max: number,\n prev_state?: ParseLinkTitleResult\n): ParseLinkTitleResult {\n let code\n let pos = start\n\n const state = {\n // if `true`, this is a valid link title\n ok: false,\n // if `true`, this link can be continued on the next line\n can_continue: false,\n // if `ok`, it's the position of the first character after the closing marker\n pos: 0,\n // if `ok`, it's the unescaped title\n str: '',\n // expected closing marker character code\n marker: 0\n }\n\n if (prev_state) {\n // this is a continuation of a previous parseLinkTitle call on the next line,\n // used in reference links only\n state.str = prev_state.str\n state.marker = prev_state.marker\n } else {\n if (pos >= max) { return state }\n\n let marker = str.charCodeAt(pos)\n if (marker !== 0x22 /* \" */ && marker !== 0x27 /* ' */ && marker !== 0x28 /* ( */) { return state }\n\n start++\n pos++\n\n // if opening marker is \"(\", switch it to closing marker \")\"\n if (marker === 0x28) { marker = 0x29 }\n\n state.marker = marker\n }\n\n while (pos < max) {\n code = str.charCodeAt(pos)\n if (code === state.marker) {\n state.pos = pos + 1\n state.str += unescapeAll(str.slice(start, pos))\n state.ok = true\n return state\n } else if (code === 0x28 /* ( */ && state.marker === 0x29 /* ) */) {\n return state\n } else if (code === 0x5C /* \\ */ && pos + 1 < max) {\n pos++\n }\n\n pos++\n }\n\n // no closing marker found, but this link title may continue on the next line (for references)\n state.can_continue = true\n state.str += unescapeAll(str.slice(start, pos))\n return state\n}\n","/**\n * Functions used to parse links and images, split out of parser rules because\n * of their size.\n *\n * @module md.helpers\n */\n\n// Just a shortcut for bulk export\n\nimport parseLinkLabel from './parse_link_label.ts'\nimport parseLinkDestination from './parse_link_destination.ts'\nimport parseLinkTitle from './parse_link_title.ts'\n\nexport {\n parseLinkLabel,\n parseLinkDestination,\n parseLinkTitle\n}\n","// Token class\n\n/** @inline */\ntype TokenNesting = -1 | 0 | 1\n\n/** @inline */\ntype TokenAttribute = [name: string, value: string | number]\n\n/**\n * Represents one item in the parsed token stream, storing parsed data and\n * providing helpers for managing HTML attributes.\n */\nclass Token {\n /**\n * Type of the token (string, e.g. \"paragraph_open\")\n */\n declare type: string\n\n /**\n * html tag name, e.g. \"p\"\n */\n declare tag: string\n\n /** Html attributes. Format: `[ [ name1, value1 ], [ name2, value2 ] ]` */\n declare attrs: TokenAttribute[] | null\n\n /**\n * Source map info. Format: `[ line_begin, line_end ]`\n */\n map: [number, number] | null = null\n\n /**\n * Level change (number in {-1, 0, 1} set), where:\n *\n * - `1` means the tag is opening\n * - `0` means the tag is self-closing\n * - `-1` means the tag is closing\n */\n declare nesting: TokenNesting\n\n /**\n * nesting level, the same as `state.level`\n */\n level = 0\n\n /**\n * An array of child nodes (inline and img tokens)\n */\n children: Token[] | null = null\n\n /**\n * In a case of self-closing tag (code, html, fence, etc.),\n * it has contents of this tag.\n */\n content = ''\n\n /**\n * '*' or '_' for emphasis, fence string for fence, etc.\n */\n markup = ''\n\n /**\n * Additional information:\n *\n * - Info string for \"fence\" tokens\n * - The value \"auto\" for autolink \"link_open\" and \"link_close\" tokens\n * - The string value of the item marker for ordered-list \"list_item_open\" tokens\n */\n info = ''\n\n /** A place for plugins to store an arbitrary data */\n declare meta: Record<string, unknown> | null\n\n /**\n * True for block-level tokens, false for inline tokens.\n * Used in renderer to calculate line breaks\n */\n block = false\n\n /**\n * If it's true, ignore this element when rendering. Used for tight lists\n * to hide paragraphs.\n */\n hidden = false\n\n constructor (type: string, tag: string, nesting: TokenNesting) {\n this.type = type\n this.tag = tag\n\n this.attrs = null\n\n this.nesting = nesting\n\n this.meta = null\n }\n\n /**\n * Search attribute index by name.\n */\n attrIndex (name: string): number {\n if (!this.attrs) { return -1 }\n\n const attrs = this.attrs\n\n for (let i = 0, len = attrs.length; i < len; i++) {\n if (attrs[i][0] === name) { return i }\n }\n return -1\n }\n\n /**\n * Add `[ name, value ]` attribute to list. Init attrs if necessary\n */\n attrPush (attrData: TokenAttribute): void {\n if (this.attrs) {\n this.attrs.push(attrData)\n } else {\n this.attrs = [attrData]\n }\n }\n\n /**\n * Set `name` attribute to `value`. Override old value if exists.\n */\n attrSet (name: string, value: string | number): void {\n const idx = this.attrIndex(name)\n const attrData: TokenAttribute = [name, value]\n\n if (idx < 0) {\n this.attrPush(attrData)\n } else {\n this.attrs![idx] = attrData\n }\n }\n\n /**\n * Get the value of attribute `name`, or null if it does not exist.\n */\n attrGet (name: string): string | number | null {\n const idx = this.attrIndex(name)\n let value = null\n if (idx >= 0) {\n value = this.attrs![idx][1]\n }\n return value\n }\n\n /**\n * Join value to existing attribute via space. Or create new attribute if not\n * exists. Useful to operate with token classes.\n */\n attrJoin (name: string, value: string | number): void {\n const idx = this.attrIndex(name)\n\n if (idx < 0) {\n this.attrPush([name, value])\n } else {\n this.attrs![idx][1] = `${this.attrs![idx][1]} ${value}`\n }\n }\n}\n\nexport default Token\n","/** @inline */\ntype RuleOptions = { alt?: string[] }\n\n/**\n * Helper class, used by {@link MarkdownIt.core}, {@link MarkdownIt.block} and\n * {@link MarkdownIt.inline} to manage sequences of functions (rules):\n *\n * - keep rules in defined order\n * - assign the name to each rule\n * - enable/disable rules\n * - add/replace rules\n * - allow assign rules to additional named chains (in the same)\n * - cacheing lists of active rules\n *\n * You will not need use this class directly until write plugins. For simple\n * rules control use {@link MarkdownIt.disable}, {@link MarkdownIt.enable} and\n * {@link MarkdownIt.use}.\n */\nclass Ruler<Args extends unknown[], Result> {\n /** @internal */\n __rules__: Array<{\n name: string\n enabled: boolean\n fn: (...args: Args) => Result\n alt: string[]\n }> = []\n\n // Cached rule chains.\n //\n // First level - chain name, '' for default.\n // Second level - diginal anchor for fast filtering by charcodes.\n //\n /** @internal */\n __cache__: Record<string, Array<(...args: Args) => Result>> | null = null\n\n /** @internal */\n __find__ (name: string): number {\n for (let i = 0; i < this.__rules__.length; i++) {\n if (this.__rules__[i].name === name) {\n return i\n }\n }\n return -1\n }\n\n /** @internal */\n __compile__ (): void {\n const chains = new Set<string>()\n\n // collect unique names\n this.__rules__.forEach(rule => {\n if (!rule.enabled) return\n rule.alt.forEach(altName => {\n if (altName) chains.add(altName)\n })\n })\n\n this.__cache__ = Object.create(null)\n\n // Collect default chain\n this.__cache__![''] = []\n this.__rules__.forEach(rule => {\n if (rule.enabled) this.__cache__![''].push(rule.fn)\n })\n\n // Collect alt chains\n chains.forEach(chain => {\n this.__cache__![chain] = []\n\n this.__rules__.forEach(rule => {\n if (rule.enabled && rule.alt.indexOf(chain) >= 0) {\n this.__cache__![chain].push(rule.fn)\n }\n })\n })\n }\n\n /**\n * Replace rule by name with new function & options. Throws error if name not\n * found.\n *\n * @example Replace existing typographer replacement rule with new one\n * ```javascript\n * import MarkdownIt from 'markdown-it'\n * const md = new MarkdownIt()\n *\n * md.core.ruler.at('replacements', function replace(state) {\n * //...\n * });\n * ```\n */\n at (name: string, fn: (...args: Args) => Result, options: RuleOptions = {}): void {\n const index = this.__find__(name)\n\n if (index === -1) { throw new Error(`Parser rule not found: ${name}`) }\n\n this.__rules__[index].fn = fn\n this.__rules__[index].alt = options.alt || []\n this.__cache__ = null\n }\n\n /**\n * Add new rule to chain before one with given name. See also\n * {@link Ruler.after}, {@link Ruler.push}.\n *\n * @example\n * ```javascript\n * import MarkdownIt from 'markdown-it'\n * const md = new MarkdownIt()\n *\n * md.block.ruler.before('paragraph', 'my_rule', function replace(state) {\n * //...\n * });\n * ```\n */\n before (beforeName: string, ruleName: string, fn: (...args: Args) => Result, options: RuleOptions = {}): void {\n const index = this.__find__(beforeName)\n\n if (index === -1) { throw new Error(`Parser rule not found: ${beforeName}`) }\n\n this.__rules__.splice(index, 0, {\n name: ruleName,\n enabled: true,\n fn,\n alt: options.alt || []\n })\n\n this.__cache__ = null\n }\n\n /**\n * Add new rule to chain after one with given name. See also\n * {@link Ruler.before}, {@link Ruler.push}.\n *\n * @example\n * ```javascript\n * import MarkdownIt from 'markdown-it'\n * const md = new MarkdownIt()\n *\n * md.inline.ruler.after('text', 'my_rule', function replace(state) {\n * //...\n * });\n * ```\n */\n after (afterName: string, ruleName: string, fn: (...args: Args) => Result, options: RuleOptions = {}): void {\n const index = this.__find__(afterName)\n\n if (index === -1) { throw new Error(`Parser rule not found: ${afterName}`) }\n\n this.__rules__.splice(index + 1, 0, {\n name: ruleName,\n enabled: true,\n fn,\n alt: options.alt || []\n })\n\n this.__cache__ = null\n }\n\n /**\n * Push new rule to the end of chain. See also\n * {@link Ruler.before}, {@link Ruler.after}.\n *\n * @example\n * ```javascript\n * import MarkdownIt from 'markdown-it'\n * const md = new MarkdownIt()\n *\n * md.core.ruler.push('my_rule', function replace(state) {\n * //...\n * });\n * ```\n */\n push (ruleName: string, fn: (...args: Args) => Result, options: RuleOptions = {}): void {\n this.__rules__.push({\n name: ruleName,\n enabled: true,\n fn,\n alt: options.alt || []\n })\n\n this.__cache__ = null\n }\n\n /**\n * Enable rules with given names. If any rule name not found - throw Error.\n * Errors can be disabled by second param.\n *\n * See also {@link Ruler.disable}, {@link Ruler.enableOnly}.\n *\n * Returns list of found rule names (if no exception happened).\n */\n enable (list: string | string[], ignoreInvalid = false): string[] {\n if (!Array.isArray(list)) { list = [list] }\n\n const result: string[] = []\n\n // Search by name and enable\n list.forEach(name => {\n const idx = this.__find__(name)\n\n if (idx < 0) {\n if (ignoreInvalid) { return }\n throw new Error(`Rules manager: invalid rule name ${name}`)\n }\n this.__rules__[idx].enabled = true\n result.push(name)\n })\n\n this.__cache__ = null\n return result\n }\n\n /**\n * Enable rules with given names, and disable everything else. If any rule name\n * not found - throw Error. Errors can be disabled by second param.\n *\n * See also {@link Ruler.disable}, {@link Ruler.enable}.\n */\n enableOnly (list: string | string[], ignoreInvalid = false): void {\n if (!Array.isArray(list)) { list = [list] }\n\n this.__rules__.forEach(rule => { rule.enabled = false })\n\n this.enable(list, ignoreInvalid)\n }\n\n /**\n * Disable rules with given names. If any rule name not found - throw Error.\n * Errors can be disabled by second param.\n *\n * See also {@link Ruler.enable}, {@link Ruler.enableOnly}.\n *\n * Returns list of found rule names (if no exception happened).\n */\n disable (list: string | string[], ignoreInvalid = false): string[] {\n if (!Array.isArray(list)) { list = [list] }\n\n const result: string[] = []\n\n // Search by name and disable\n list.forEach(name => {\n const idx = this.__find__(name)\n\n if (idx < 0) {\n if (ignoreInvalid) { return }\n throw new Error(`Rules manager: invalid rule name ${name}`)\n }\n this.__rules__[idx].enabled = false\n result.push(name)\n })\n\n this.__cache__ = null\n return result\n }\n\n /**\n * Return array of active functions (rules) for given chain name. It analyzes\n * rules configuration, compiles caches if not exists and returns result.\n *\n * Default chain name is `''` (empty string). It can't be skipped. That's\n * done intentionally, to keep signature monomorphic for high speed.\n */\n getRules (chainName: string): Array<(...args: Args) => Result> {\n if (!this.__cache__) this.__compile__()\n\n // Chain can be empty, if rules disabled. But we still have to return Array.\n return this.__cache__![chainName] || []\n }\n}\n\nexport default Ruler\n","import { unescapeAll, escapeHtml } from './common/utils.ts'\nimport type Token from './token.ts'\nimport type { Env, MarkdownItOptions } from './types.ts'\n\n/** Function that renders a token at a given position in a token stream. */\nexport type RendererRule = (\n tokens: Token[],\n idx: number,\n options: Required<MarkdownItOptions>,\n env: Env | undefined,\n renderer: Renderer\n) => string\n\nconst default_rules: Record<string, RendererRule> = {}\n\ndefault_rules.code_inline = function (\n tokens: Token[],\n idx: number,\n options: Required<MarkdownItOptions>,\n env: Env | undefined,\n slf: Renderer\n): string {\n const token = tokens[idx]\n\n return `<code${slf.renderAttrs(token)}>${escapeHtml(token.content)}</code>`\n}\n\ndefault_rules.code_block = function (\n tokens: Token[],\n idx: number,\n options: Required<MarkdownItOptions>,\n env: Env | undefined,\n slf: Renderer\n): string {\n const token = tokens[idx]\n\n return `<pre${slf.renderAttrs(token)}><code>${escapeHtml(tokens[idx].content)}</code></pre>\\n`\n}\n\ndefault_rules.fence = function (\n tokens: Token[],\n idx: number,\n options: Required<MarkdownItOptions>,\n env: Env | undefined,\n slf: Renderer\n): string {\n const token = tokens[idx]\n const info = token.info ? unescapeAll(token.info).trim() : ''\n let langName = ''\n let langAttrs = ''\n\n if (info) {\n const arr = info.split(/(\\s+)/g)\n langName = arr[0]\n langAttrs = arr.slice(2).join('')\n }\n\n let highlighted\n if (options.highlight) {\n highlighted = options.highlight(token.content, langName, langAttrs) || escapeHtml(token.content)\n } else {\n highlighted = escapeHtml(token.content)\n }\n\n if (highlighted.indexOf('<pre') === 0) {\n return highlighted + '\\n'\n }\n\n // If language exists, inject class gently, without modifying original token.\n // May be, one day we will add .deepClone() for token and simplify this part, but\n // now we prefer to keep things local.\n if (info) {\n const i = token.attrIndex('class')\n const tmpAttrs = token.attrs ? token.attrs.slice() : []\n\n if (i < 0) {\n tmpAttrs.push(['class', `${options.langPrefix}${langName}`])\n } else {\n tmpAttrs[i] = [tmpAttrs[i][0], tmpAttrs[i][1]] // shallow clone\n tmpAttrs[i][1] += ` ${options.langPrefix}${langName}`\n }\n\n // Fake token just to render attributes\n const tmpToken = {\n attrs: tmpAttrs\n }\n\n return `<pre><code${slf.renderAttrs(tmpToken)}>${highlighted}</code></pre>\\n`\n }\n\n return `<pre><code${slf.renderAttrs(token)}>${highlighted}</code></pre>\\n`\n}\n\ndefault_rules.image = function (\n tokens: Token[],\n idx: number,\n options: Required<MarkdownItOptions>,\n env: Env | undefined,\n slf: Renderer\n): string {\n const token = tokens[idx]\n\n // \"alt\" attr MUST be set, even if empty. Because it's mandatory and\n // should be placed on proper position for tests.\n //\n // Replace content with actual value\n\n token.attrs![token.attrIndex('alt')][1] =\n slf.renderInlineAsText(token.children!, options, env)\n\n return slf.renderToken(tokens, idx, options)\n}\n\ndefault_rules.hardbreak = function (\n tokens: Token[],\n idx: number,\n options: Required<MarkdownItOptions>\n): string {\n return options.xhtmlOut ? '<br />\\n' : '<br>\\n'\n}\ndefault_rules.softbreak = function (\n tokens: Token[],\n idx: number,\n options: Required<MarkdownItOptions>\n): string {\n return options.breaks ? (options.xhtmlOut ? '<br />\\n' : '<br>\\n') : '\\n'\n}\n\ndefault_rules.text = function (tokens: Token[], idx: number): string {\n return escapeHtml(tokens[idx].content)\n}\n\ndefault_rules.html_block = function (tokens: Token[], idx: number): string {\n return tokens[idx].content\n}\ndefault_rules.html_inline = function (tokens: Token[], idx: number): string {\n return tokens[idx].content\n}\n\n/**\n * Generates HTML from parsed token stream. Each instance has independent\n * copy of rules. Those can be rewritten with ease. Also, you can add new\n * rules if you create plugin and adds new token types.\n *\n * Creates new renderer instance and fills {@link Renderer.rules} with defaults.\n */\nclass Renderer {\n /**\n * Contains render rules for tokens. Can be updated and extended.\n *\n * See [source code](https://github.com/markdown-it/markdown-it/blob/master/src/renderer.ts)\n * for more details and examples.\n *\n * @example Custom render rules\n * ```javascript\n * import MarkdownIt from 'markdown-it'\n * const md = new MarkdownIt()\n *\n * md.renderer.rules.strong_open = function () { return '<b>'; };\n * md.renderer.rules.strong_close = function () { return '</b>'; };\n *\n * const result = md.renderInline(...);\n * ```\n *\n * @example Each rule is called as independent static function with fixed signature\n * ```javascript\n * function my_token_render(tokens, idx, options, env, renderer) {\n * // ...\n * return renderedHTML;\n * }\n * ```\n */\n rules: Record<string, RendererRule> = Object.assign({}, default_rules)\n\n /**\n * Render token attributes to string.\n */\n renderAttrs (token: Pick<Token, 'attrs'>): string {\n let i, l, result\n\n if (!token.attrs) { return '' }\n\n result = ''\n\n for (i = 0, l = token.attrs.length; i < l; i++) {\n result += ` ${escapeHtml(token.attrs[i][0])}=\"${escapeHtml(String(token.attrs[i][1]))}\"`\n }\n\n return result\n }\n\n /**\n * Default token renderer. Can be overriden by custom function\n * in {@link Renderer.rules}.\n */\n renderToken (tokens: Token[], idx: number, options: Required<MarkdownItOptions>): string {\n const token = tokens[idx]\n let result = ''\n\n // Tight list paragraphs\n if (token.hidden) {\n return ''\n }\n\n // Insert a newline between hidden paragraph and subsequent opening\n // block-level tag.\n //\n // For example, here we should insert a newline before blockquote:\n // - a\n // >\n //\n // Only closing hidden tokens count, to not break on other hidden ones.\n //\n // Hidden tokens without nesting (`reference_definition`) are skipped here\n // and below, or they would break line feeds around neighbour blocks.\n //\n let prev = idx - 1\n while (prev >= 0 && tokens[prev].hidden && tokens[prev].nesting === 0) { prev-- }\n\n if (token.block && token.nesting !== -1 && prev >= 0 &&\n tokens[prev].hidden && tokens[prev].nesting === -1) {\n result += '\\n'\n }\n\n // Add token name, e.g. `<img`\n result += (token.nesting === -1 ? '</' : '<') + token.tag\n\n // Encode attributes, e.g. `<img src=\"foo\"`\n result += this.renderAttrs(token)\n\n // Add a slash for self-closing tags, e.g. `<img src=\"foo\" /`\n if (token.nesting === 0 && options.xhtmlOut) {\n result += ' /'\n }\n\n // Check if we need to add a newline after this tag\n let needLf = false\n if (token.block) {\n needLf = true\n\n if (token.nesting === 1) {\n let next = idx + 1\n while (next < tokens.length && tokens[next].hidden && tokens[next].nesting === 0) { next++ }\n\n if (next < tokens.length) {\n const nextToken = tokens[next]\n\n if (nextToken.type === 'inline' || nextToken.hidden) {\n // Block-level tag containing an inline tag.\n //\n needLf = false\n } else if (nextToken.nesting === -1 && nextToken.tag === token.tag) {\n // Opening tag + closing tag of the same type. E.g. `<li></li>`.\n //\n needLf = false\n }\n }\n }\n }\n\n result += needLf ? '>\\n' : '>'\n\n return result\n }\n\n /**\n * The same as {@link Renderer.render}, but for single token of `inline` type.\n */\n renderInline (tokens: Token[], options: Required<MarkdownItOptions>, env: Env | undefined): string {\n let result = ''\n const rules = this.rules\n\n for (let i = 0, len = tokens.length; i < len; i++) {\n const type = tokens[i].type\n\n if (typeof rules[type] !== 'undefined') {\n result += rules[type](tokens, i, options, env, this)\n } else {\n result += this.renderToken(tokens, i, options)\n }\n }\n\n return result\n }\n\n /**\n * Special kludge for image `alt` attributes to conform CommonMark spec.\n * Don't try to use it! Spec requires to show `alt` content with stripped markup,\n * instead of simple escaping.\n */\n renderInlineAsText (tokens: Token[], options: Required<MarkdownItOptions>, env: Env | undefined): string {\n let result = ''\n\n for (let i = 0, len = tokens.length; i < len; i++) {\n switch (tokens[i].type) {\n case 'text':\n case 'code_inline':\n // code content is added as plain text, without backticks\n result += tokens[i].content\n break\n case 'image':\n result += this.renderInlineAsText(tokens[i].children!, options, env)\n break\n case 'html_inline':\n case 'html_block':\n result += tokens[i].content\n break\n case 'softbreak':\n case 'hardbreak':\n result += '\\n'\n break\n default:\n // all other tokens are skipped\n }\n }\n\n return result\n }\n\n /**\n * Takes token stream and generates HTML. Probably, you will never need to call\n * this method directly.\n */\n render (tokens: Token[], options: Required<MarkdownItOptions>, env?: Env): string {\n let result = ''\n const rules = this.rules\n\n for (let i = 0, len = tokens.length; i < len; i++) {\n const type = tokens[i].type\n\n if (type === 'inline') {\n result += this.renderInline(tokens[i].children!, options, env)\n } else if (typeof rules[type] !== 'undefined') {\n result += rules[type](tokens, i, options, env, this)\n } else {\n result += this.renderToken(tokens, i, options)\n }\n }\n\n return result\n }\n}\n\nexport default Renderer\n","import Token from '../token.ts'\nimport type MarkdownIt from '../markdownit.ts'\nimport type { Env } from '../types.ts'\n\n/** Mutable state passed through the core rules chain. */\nclass StateCore {\n declare src: string\n declare env: Env\n tokens: Token[] = []\n inlineMode = false\n declare md: MarkdownIt\n\n // re-export Token class to use in core rules\n Token = Token\n\n constructor (src: string, md: MarkdownIt, env: Env) {\n this.src = src\n this.env = env\n this.md = md // link to parser instance\n }\n}\n\nexport default StateCore\n","// Normalize input string\n\nimport type StateCore from './state_core.ts'\n\n// https://spec.commonmark.org/0.29/#line-ending\nconst UNNORMALIZED_NEWLINE_RE = /\\r\\n?/g\nconst NULL_RE = /\\0/g\n\nexport default function normalize (state: StateCore): void {\n let str\n\n // Normalize newlines\n str = state.src.replace(UNNORMALIZED_NEWLINE_RE, '\\n')\n\n // Replace NULL characters\n str = str.replace(NULL_RE, '\\uFFFD')\n\n state.src = str\n}\n","import type StateCore from './state_core.ts'\n\nexport default function block (state: StateCore): void {\n let token\n\n if (state.inlineMode) {\n token = new state.Token('inline', '', 0)\n token.content = state.src\n token.map = [0, 1]\n token.children = []\n state.tokens.push(token)\n } else {\n state.md.block.parse(state.src, state.md, state.env, state.tokens)\n }\n}\n","// Drop `reference_definition` tokens to keep the stream backward compatible\n//\n// Those tokens mark places link definitions took in the source. They are new,\n// and plugins walking block tokens may not expect them, so by default the\n// stream stays as it always was. Disable this rule to opt in.\n//\n\nimport type StateCore from './state_core.ts'\n\nexport default function strip_references (state: StateCore): void {\n const tokens = state.tokens\n let last = 0\n\n for (let curr = 0; curr < tokens.length; curr++) {\n if (tokens[curr].type === 'reference_definition') continue\n\n if (curr !== last) { tokens[last] = tokens[curr] }\n\n last++\n }\n\n if (tokens.length !== last) { tokens.length = last }\n}\n","import type StateCore from './state_core.ts'\n\nexport default function inline (state: StateCore): void {\n const tokens = state.tokens\n\n // Parse inlines\n for (let i = 0, l = tokens.length; i < l; i++) {\n const tok = tokens[i]\n if (tok.type === 'inline') {\n state.md.inline.parse(tok.content, state.md, state.env, tok.children!)\n }\n }\n}\n","// Replace link-like texts with link nodes.\n//\n// Currently restricted by `md.validateLink()` to http/https/ftp\n//\n\nimport type StateCore from './state_core.ts'\n\nfunction isLinkOpen (str: string) {\n return /^<a[>\\s]/i.test(str)\n}\nfunction isLinkClose (str: string) {\n return /^<\\/a\\s*>/i.test(str)\n}\n\nexport default function linkify (state: StateCore): void {\n const blockTokens = state.tokens\n\n if (!state.md.options.linkify) { return }\n\n for (let j = 0, l = blockTokens.length; j < l; j++) {\n if (blockTokens[j].type !== 'inline' ||\n !state.md.linkify.test(blockTokens[j].content)) {\n continue\n }\n\n const tokens = blockTokens[j].children!\n const replacements: Array<{ index: number, nodes: typeof tokens }> = []\n\n let htmlLinkLevel = 0\n\n // We scan from the end, to keep position when new tags added.\n // Use reversed logic in links start/end match\n for (let i = tokens.length - 1; i >= 0; i--) {\n const currentToken = tokens[i]\n\n // Skip content of markdown links\n if (currentToken.type === 'link_close') {\n i--\n while (tokens[i].level !== currentToken.level && tokens[i].type !== 'link_open') {\n i--\n }\n continue\n }\n\n // Skip content of html tag links\n if (currentToken.type === 'html_inline') {\n if (isLinkOpen(currentToken.content) && htmlLinkLevel > 0) {\n htmlLinkLevel--\n }\n if (isLinkClose(currentToken.content)) {\n htmlLinkLevel++\n }\n }\n if (htmlLinkLevel > 0) { continue }\n\n if (currentToken.type === 'text' && state.md.linkify.test(currentToken.content)) {\n const text = currentToken.content\n let links = state.md.linkify.match(text)!\n\n // Now split string to nodes\n const nodes = []\n let level = currentToken.level\n let lastPos = 0\n\n // forbid escape sequence at the start of the string,\n // this avoids http\\://example.com/ from being linkified as\n // http:<a href=\"//example.com/\">//example.com/</a>\n if (links.length > 0 &&\n links[0].index === 0 &&\n i > 0 &&\n tokens[i - 1].type === 'text_special') {\n links = links.slice(1)\n }\n\n for (let ln = 0; ln < links.length; ln++) {\n const url = links[ln].url\n const fullUrl = state.md.normalizeLink(url)\n if (!state.md.validateLink(fullUrl)) { continue }\n\n let urlText = links[ln].text\n\n // Linkifier might send raw hostnames like \"example.com\", where url\n // starts with domain name. So we prepend http:// in those cases,\n // and remove it afterwards.\n //\n if (!links[ln].schema) {\n urlText = state.md.normalizeLinkText(`http://${urlText}`).replace(/^http:\\/\\//, '')\n } else if (links[ln].schema === 'mailto:' && !/^mailto:/i.test(urlText)) {\n urlText = state.md.normalizeLinkText(`mailto:${urlText}`).replace(/^mailto:/, '')\n } else {\n urlText = state.md.normalizeLinkText(urlText)\n }\n\n const pos = links[ln].index\n\n if (pos > lastPos) {\n const token = new state.Token('text', '', 0)\n token.content = text.slice(lastPos, pos)\n token.level = level\n nodes.push(token)\n }\n\n const token_o = new state.Token('link_open', 'a', 1)\n token_o.attrs = [['href', fullUrl]]\n token_o.level = level++\n token_o.markup = 'linkify'\n token_o.info = 'auto'\n nodes.push(token_o)\n\n const token_t = new state.Token('text', '', 0)\n token_t.content = urlText\n token_t.level = level\n nodes.push(token_t)\n\n const token_c = new state.Token('link_close', 'a', -1)\n token_c.level = --level\n token_c.markup = 'linkify'\n token_c.info = 'auto'\n nodes.push(token_c)\n\n lastPos = links[ln].lastIndex\n }\n if (lastPos < text.length) {\n const token = new state.Token('text', '', 0)\n token.content = text.slice(lastPos)\n token.level = level\n nodes.push(token)\n }\n\n replacements.push({ index: i, nodes })\n }\n }\n\n if (replacements.length > 0) {\n let newTokensLength = tokens.length\n for (const replacement of replacements) {\n newTokensLength += replacement.nodes.length - 1\n }\n\n const newTokens = new Array<(typeof tokens)[number]>(newTokensLength)\n let replacementIndex = 0\n let newTokenIndex = 0\n\n replacements.reverse()\n\n for (let i = 0; i < tokens.length; i++) {\n const replacement = replacements[replacementIndex]\n\n if (replacement?.index === i) {\n for (const node of replacement.nodes) {\n newTokens[newTokenIndex++] = node\n }\n replacementIndex++\n } else {\n newTokens[newTokenIndex++] = tokens[i]\n }\n }\n\n blockTokens[j].children = newTokens\n }\n }\n}\n","// Simple typographic replacements\n//\n// (c) (C) → ©\n// (tm) (TM) → ™\n// (r) (R) → ®\n// +- → ±\n// ... → … (also ?.... → ?.., !.... → !..)\n// ???????? → ???, !!!!! → !!!, `,,` → `,`\n// -- → &ndash;, --- → &mdash;\n//\n\n// TODO:\n// - fractionals 1/2, 1/4, 3/4 -> ½, ¼, ¾\n// - multiplications 2 x 4 -> 2 × 4\n\nimport type StateCore from './state_core.ts'\nimport type Token from '../token.ts'\n\nconst RARE_RE = /\\+-|\\.\\.|\\?\\?\\?\\?|!!!!|,,|--/\n\n// Workaround for phantomjs - need regex without /g flag,\n// or root check will fail every second time\nconst SCOPED_ABBR_TEST_RE = /\\((c|tm|r)\\)/i\n\nconst SCOPED_ABBR_RE = /\\((c|tm|r)\\)/ig\nconst SCOPED_ABBR: Record<string, string> = {\n c: '©',\n r: '®',\n tm: '™'\n}\n\nfunction replaceFn (match: string, name: string) {\n return SCOPED_ABBR[name.toLowerCase()]\n}\n\nfunction replace_scoped (inlineTokens: Token[]) {\n let inside_autolink = 0\n\n for (let i = inlineTokens.length - 1; i >= 0; i--) {\n const token = inlineTokens[i]\n\n if (token.type === 'text' && !inside_autolink) {\n token.content = token.content.replace(SCOPED_ABBR_RE, replaceFn)\n }\n\n if (token.type === 'link_open' && token.info === 'auto') {\n inside_autolink--\n }\n\n if (token.type === 'link_close' && token.info === 'auto') {\n inside_autolink++\n }\n }\n}\n\nfunction replace_rare (inlineTokens: Token[]) {\n let inside_autolink = 0\n\n for (let i = inlineTokens.length - 1; i >= 0; i--) {\n const token = inlineTokens[i]\n\n if (token.type === 'text' && !inside_autolink) {\n if (RARE_RE.test(token.content)) {\n token.content = token.content\n .replace(/\\+-/g, '±')\n // .., ..., ....... -> …\n // but ?..... & !..... -> ?.. & !..\n .replace(/\\.{2,}/g, '…').replace(/([?!])…/g, '$1..')\n .replace(/([?!]){4,}/g, '$1$1$1').replace(/,{2,}/g, ',')\n // em-dash\n .replace(/(^|[^-])---(?=[^-]|$)/mg, '$1\\u2014')\n // en-dash\n .replace(/(^|\\s)--(?=\\s|$)/mg, '$1\\u2013')\n .replace(/(^|[^-\\s])--(?=[^-\\s]|$)/mg, '$1\\u2013')\n }\n }\n\n if (token.type === 'link_open' && token.info === 'auto') {\n inside_autolink--\n }\n\n if (token.type === 'link_close' && token.info === 'auto') {\n inside_autolink++\n }\n }\n}\n\nexport default function replace (state: StateCore): void {\n let blkIdx\n\n if (!state.md.options.typographer) { return }\n\n for (blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) {\n if (state.tokens[blkIdx].type !== 'inline') { continue }\n\n if (SCOPED_ABBR_TEST_RE.test(state.tokens[blkIdx].content)) {\n replace_scoped(state.tokens[blkIdx].children!)\n }\n\n if (RARE_RE.test(state.tokens[blkIdx].content)) {\n replace_rare(state.tokens[blkIdx].children!)\n }\n }\n}\n","// Convert straight quotation marks to typographic ones\n//\n\nimport { isWhiteSpace, isPunctCharCode, isMdAsciiPunct } from '../common/utils.ts'\nimport type Token from '../token.ts'\nimport type StateCore from './state_core.ts'\n\nconst QUOTE_TEST_RE = /['\"]/\nconst QUOTE_RE = /['\"]/g\nconst APOSTROPHE = '\\u2019' /* ’ */\n// Caps memory on malicious input\nconst MAX_OPENERS = 1000\n\ninterface Replacement {\n pos: number\n ch: string\n}\n\ntype ReplacementMap = Record<string, Replacement[]>\n\ninterface QuoteOpener {\n tokenIdx: number\n contentPos: number\n isSingleQuote: boolean\n level: number\n // stack index of the previous opener of the same quote type, -1 if none\n prevSameQuoteIdx: number\n}\n\n// stack indexes of topmost openers of each type (-1 if none)\ninterface QuoteHeads {\n single: number\n double: number\n}\n\nfunction truncateStack (stack: QuoteOpener[], heads: QuoteHeads, length: number) {\n while (stack.length > length) {\n const item = stack.pop()!\n if (item.isSingleQuote) {\n heads.single = item.prevSameQuoteIdx\n } else {\n heads.double = item.prevSameQuoteIdx\n }\n }\n}\n\nfunction addReplacement (\n replacements: ReplacementMap,\n tokenIdx: number,\n pos: number,\n ch: string\n) {\n if (!replacements[tokenIdx]) {\n replacements[tokenIdx] = []\n }\n\n replacements[tokenIdx].push({ pos, ch })\n}\n\nfunction applyReplacements (str: string, replacements: Replacement[]) {\n let result = ''\n let lastPos = 0\n\n replacements.sort((a, b) => a.pos - b.pos)\n\n for (let i = 0; i < replacements.length; i++) {\n const replacement = replacements[i]\n\n result += str.slice(lastPos, replacement.pos) + replacement.ch\n lastPos = replacement.pos + 1\n }\n\n return result + str.slice(lastPos)\n}\n\nfunction process_inlines (tokens: Token[], state: StateCore) {\n let j\n\n const stack: QuoteOpener[] = []\n const heads: QuoteHeads = { single: -1, double: -1 }\n // token index -> list of replacements in the original token content\n const replacements: ReplacementMap = {}\n\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i]\n\n const thisLevel = tokens[i].level\n\n for (j = stack.length - 1; j >= 0; j--) {\n if (stack[j].level <= thisLevel) { break }\n }\n truncateStack(stack, heads, j + 1)\n\n if (token.type !== 'text') { continue }\n\n const text = token.content\n let pos = 0\n const max = text.length\n\n /* eslint no-labels:0,block-scoped-var:0 */\n OUTER:\n while (pos < max) {\n QUOTE_RE.lastIndex = pos\n const t = QUOTE_RE.exec(text)\n if (!t) { break }\n\n let canOpen = true\n let canClose = true\n pos = t.index + 1\n const isSingle = (t[0] === \"'\")\n\n // Find previous character,\n // default to space if it's the beginning of the line\n //\n let lastChar = 0x20\n\n if (t.index - 1 >= 0) {\n lastChar = text.charCodeAt(t.index - 1)\n } else {\n for (j = i - 1; j >= 0; j--) {\n if (tokens[j].type === 'softbreak' || tokens[j].type === 'hardbreak') break // lastChar defaults to 0x20\n if (!tokens[j].content) continue // should skip all tokens except 'text', 'html_inline' or 'code_inline'\n\n lastChar = tokens[j].content.charCodeAt(tokens[j].content.length - 1)\n break\n }\n }\n\n // Find next character,\n // default to space if it's the end of the line\n //\n let nextChar = 0x20\n\n if (pos < max) {\n nextChar = text.charCodeAt(pos)\n } else {\n for (j = i + 1; j < tokens.length; j++) {\n if (tokens[j].type === 'softbreak' || tokens[j].type === 'hardbreak') break // nextChar defaults to 0x20\n if (!tokens[j].content) continue // should skip all tokens except 'text', 'html_inline' or 'code_inline'\n\n nextChar = tokens[j].content.charCodeAt(0)\n break\n }\n }\n\n const isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctCharCode(lastChar)\n const isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctCharCode(nextChar)\n\n const isLastWhiteSpace = isWhiteSpace(lastChar)\n const isNextWhiteSpace = isWhiteSpace(nextChar)\n\n if (isNextWhiteSpace) {\n canOpen = false\n } else if (isNextPunctChar) {\n if (!(isLastWhiteSpace || isLastPunctChar)) {\n canOpen = false\n }\n }\n\n if (isLastWhiteSpace) {\n canClose = false\n } else if (isLastPunctChar) {\n if (!(isNextWhiteSpace || isNextPunctChar)) {\n canClose = false\n }\n }\n\n if (nextChar === 0x22 /* \" */ && t[0] === '\"') {\n if (lastChar >= 0x30 /* 0 */ && lastChar <= 0x39 /* 9 */) {\n // special case: 1\"\" - count first quote as an inch\n canClose = canOpen = false\n }\n }\n\n if (canOpen && canClose) {\n // Replace quotes in the middle of punctuation sequence, but not\n // in the middle of the words, i.e.:\n //\n // 1. foo \" bar \" baz - not replaced\n // 2. foo-\"-bar-\"-baz - replaced\n // 3. foo\"bar\"baz - not replaced\n //\n canOpen = isLastPunctChar\n canClose = isNextPunctChar\n }\n\n if (!canOpen && !canClose) {\n // middle of word\n if (isSingle) {\n addReplacement(replacements, i, t.index, APOSTROPHE)\n }\n continue\n }\n\n if (canClose) {\n // Stack levels never decrease, so an opener of this type below\n // the current level means there is no match\n j = isSingle ? heads.single : heads.double\n if (j >= 0 && stack[j].level === thisLevel) {\n const item = stack[j]\n\n let openQuote\n let closeQuote\n if (isSingle) {\n openQuote = state.md.options.quotes[2]\n closeQuote = state.md.options.quotes[3]\n } else {\n openQuote = state.md.options.quotes[0]\n closeQuote = state.md.options.quotes[1]\n }\n\n addReplacement(replacements, i, t.index, closeQuote)\n addReplacement(replacements, item.tokenIdx, item.contentPos, openQuote)\n\n truncateStack(stack, heads, j)\n continue OUTER\n }\n }\n\n if (canOpen) {\n if (stack.length >= MAX_OPENERS) { return }\n stack.push({\n tokenIdx: i,\n contentPos: t.index,\n isSingleQuote: isSingle,\n level: thisLevel,\n prevSameQuoteIdx: isSingle ? heads.single : heads.double\n })\n if (isSingle) {\n heads.single = stack.length - 1\n } else {\n heads.double = stack.length - 1\n }\n } else if (canClose && isSingle) {\n addReplacement(replacements, i, t.index, APOSTROPHE)\n }\n }\n }\n\n Object.keys(replacements).forEach(function (tokenIdx) {\n const idx = Number(tokenIdx)\n tokens[idx].content = applyReplacements(tokens[idx].content, replacements[tokenIdx])\n })\n}\n\nexport default function smartquotes (state: StateCore): void {\n /* eslint max-depth:0 */\n if (!state.md.options.typographer) { return }\n\n for (let blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) {\n if (state.tokens[blkIdx].type !== 'inline' ||\n !QUOTE_TEST_RE.test(state.tokens[blkIdx].content)) {\n continue\n }\n\n process_inlines(state.tokens[blkIdx].children!, state)\n }\n}\n","// Join raw text tokens with the rest of the text\n//\n// This is set as a separate rule to provide an opportunity for plugins\n// to run text replacements after text join, but before escape join.\n//\n// For example, `\\:)` shouldn't be replaced with an emoji.\n//\n\nimport type StateCore from './state_core.ts'\nimport type Token from '../token.ts'\n\nfunction join_alt (tokens: Token[]): void {\n let curr, last\n const max = tokens.length\n\n for (curr = 0; curr < max; curr++) {\n if (tokens[curr].type === 'text_special') tokens[curr].type = 'text'\n }\n\n for (curr = last = 0; curr < max; curr++) {\n if (tokens[curr].type === 'text' &&\n curr + 1 < max &&\n tokens[curr + 1].type === 'text') {\n tokens[curr + 1].content = tokens[curr].content + tokens[curr + 1].content\n } else {\n if (curr !== last) { tokens[last] = tokens[curr] }\n\n last++\n }\n }\n\n if (curr !== last) tokens.length = last\n}\n\nexport default function text_join (state: StateCore): void {\n let curr, last\n const blockTokens = state.tokens\n const l = blockTokens.length\n\n for (let j = 0; j < l; j++) {\n if (blockTokens[j].type !== 'inline') continue\n\n const tokens = blockTokens[j].children!\n const max = tokens.length\n\n for (curr = 0; curr < max; curr++) {\n if (tokens[curr].type === 'text_special') tokens[curr].type = 'text'\n\n // image `alt` is parsed into its own token tree\n if (tokens[curr].children) join_alt(tokens[curr].children!)\n }\n\n for (curr = last = 0; curr < max; curr++) {\n if (tokens[curr].type === 'text' &&\n curr + 1 < max &&\n tokens[curr + 1].type === 'text') {\n // collapse two adjacent text nodes\n tokens[curr + 1].content = tokens[curr].content + tokens[curr + 1].content\n } else {\n if (curr !== last) { tokens[last] = tokens[curr] }\n\n last++\n }\n }\n\n if (curr !== last) tokens.length = last\n }\n}\n","import Ruler from './ruler.ts'\nimport StateCore from './rules_core/state_core.ts'\n\nimport r_normalize from './rules_core/normalize.ts'\nimport r_block from './rules_core/block.ts'\nimport r_strip_references from './rules_core/strip_references.ts'\nimport r_inline from './rules_core/inline.ts'\nimport r_linkify from './rules_core/linkify.ts'\nimport r_replacements from './rules_core/replacements.ts'\nimport r_smartquotes from './rules_core/smartquotes.ts'\nimport r_text_join from './rules_core/text_join.ts'\n\nconst _rules: Array<[\n name: string,\n rule: (state: StateCore) => void\n]> = [\n ['normalize', r_normalize],\n ['block', r_block],\n ['strip_references', r_strip_references],\n ['inline', r_inline],\n ['linkify', r_linkify],\n ['replacements', r_replacements],\n ['smartquotes', r_smartquotes],\n // `text_join` finds `text_special` tokens (for escape sequences)\n // and joins them with the rest of the text\n ['text_join', r_text_join]\n]\n\n/**\n * Top-level rules executor. Glues block/inline parsers and does intermediate\n * transformations.\n */\nclass ParserCore {\n /**\n * {@link Ruler} instance. Keep configuration of core rules.\n */\n ruler = new Ruler<[StateCore], void>()\n\n State = StateCore\n\n constructor () {\n for (let i = 0; i < _rules.length; i++) {\n this.ruler.push(_rules[i][0], _rules[i][1])\n }\n }\n\n /**\n * Executes core chain rules.\n */\n process (state: StateCore): void {\n const rules = this.ruler.getRules('')\n\n for (let i = 0, l = rules.length; i < l; i++) {\n rules[i](state)\n }\n }\n}\n\nexport default ParserCore\n","import Token from '../token.ts'\nimport { isSpace } from '../common/utils.ts'\nimport type MarkdownIt from '../markdownit.ts'\nimport type { Env } from '../types.ts'\n\n/** Mutable state passed to block rules while tokenizing a source document. */\nclass StateBlock {\n declare src: string\n declare md: MarkdownIt\n declare env: Env\n declare tokens: Token[]\n\n bMarks: number[] = [] // line begin offsets for fast jumps\n eMarks: number[] = [] // line end offsets for fast jumps\n tShift: number[] = [] // offsets of the first non-space characters (tabs not expanded)\n sCount: number[] = [] // indents for each line (tabs expanded)\n\n // An amount of virtual spaces (tabs expanded) between beginning\n // of each line (bMarks) and real beginning of that line.\n //\n // It exists only as a hack because blockquotes override bMarks\n // losing information in the process.\n //\n // It's used only when expanding tabs, you can think about it as\n // an initial tab length, e.g. bsCount=21 applied to string `\\t123`\n // means first tab should be expanded to 4-21%4 === 3 spaces.\n //\n bsCount: number[] = []\n\n // block parser variables\n\n // required block content indent (for example, if we are\n // inside a list, it would be positioned after list marker)\n blkIndent = 0\n line = 0 // line index in src\n lineMax = 0 // lines count\n tight = false // loose/tight mode for lists\n listIndent = -1 // indent of the current list block (-1 if there isn't any)\n\n // can be 'blockquote', 'list', 'root', 'paragraph' or 'reference'\n // used in lists to determine if they interrupt a paragraph\n parentType = 'root'\n\n level = 0\n\n // re-export Token class to use in block rules\n Token = Token\n\n constructor (src: string, md: MarkdownIt, env: Env, tokens: Token[]) {\n this.src = src\n\n // link to parser instance\n this.md = md\n\n this.env = env\n\n //\n // Internal state vartiables\n //\n\n this.tokens = tokens\n\n // Create caches\n // Generate markers.\n const s = this.src\n\n for (let start = 0, pos = 0, indent = 0, offset = 0, len = s.length, indent_found = false; pos < len; pos++) {\n const ch = s.charCodeAt(pos)\n\n if (!indent_found) {\n if (isSpace(ch)) {\n indent++\n\n if (ch === 0x09) {\n offset += 4 - offset % 4\n } else {\n offset++\n }\n continue\n } else {\n indent_found = true\n }\n }\n\n if (ch === 0x0A || pos === len - 1) {\n if (ch !== 0x0A) { pos++ }\n this.bMarks.push(start)\n this.eMarks.push(pos)\n this.tShift.push(indent)\n this.sCount.push(offset)\n this.bsCount.push(0)\n\n indent_found = false\n indent = 0\n offset = 0\n start = pos + 1\n }\n }\n\n // Push fake entry to simplify cache bounds checks\n this.bMarks.push(s.length)\n this.eMarks.push(s.length)\n this.tShift.push(0)\n this.sCount.push(0)\n this.bsCount.push(0)\n\n this.lineMax = this.bMarks.length - 1 // don't count last fake line\n }\n\n // Push new token to \"stream\".\n //\n push (type: string, tag: string, nesting: -1 | 0 | 1): Token {\n const token = new Token(type, tag, nesting)\n token.block = true\n\n if (nesting < 0) this.level-- // closing tag\n token.level = this.level\n if (nesting > 0) this.level++ // opening tag\n\n this.tokens.push(token)\n return token\n }\n\n isEmpty (line: number): boolean {\n return this.bMarks[line] + this.tShift[line] >= this.eMarks[line]\n }\n\n skipEmptyLines (from: number): number {\n for (let max = this.lineMax; from < max; from++) {\n if (this.bMarks[from] + this.tShift[from] < this.eMarks[from]) {\n break\n }\n }\n return from\n }\n\n // Skip spaces from given position.\n skipSpaces (pos: number): number {\n for (let max = this.src.length; pos < max; pos++) {\n const ch = this.src.charCodeAt(pos)\n if (!isSpace(ch)) { break }\n }\n return pos\n }\n\n // Skip spaces from given position in reverse.\n skipSpacesBack (pos: number, min: number): number {\n if (pos <= min) { return pos }\n\n while (pos > min) {\n if (!isSpace(this.src.charCodeAt(--pos))) { return pos + 1 }\n }\n return pos\n }\n\n // Skip char codes from given position\n skipChars (pos: number, code: number): number {\n for (let max = this.src.length; pos < max; pos++) {\n if (this.src.charCodeAt(pos) !== code) { break }\n }\n return pos\n }\n\n // Skip char codes reverse from given position - 1\n skipCharsBack (pos: number, code: number, min: number): number {\n if (pos <= min) { return pos }\n\n while (pos > min) {\n if (code !== this.src.charCodeAt(--pos)) { return pos + 1 }\n }\n return pos\n }\n\n // cut lines range from source.\n getLines (begin: number, end: number, indent: number, keepLastLF: boolean): string {\n if (begin >= end) {\n return ''\n }\n\n const queue = new Array(end - begin)\n\n for (let i = 0, line = begin; line < end; line++, i++) {\n let lineIndent = 0\n const lineStart = this.bMarks[line]\n let first = lineStart\n let last\n\n if (line + 1 < end || keepLastLF) {\n // No need for bounds check because we have fake entry on tail.\n last = this.eMarks[line] + 1\n } else {\n last = this.eMarks[line]\n }\n\n while (first < last && lineIndent < indent) {\n const ch = this.src.charCodeAt(first)\n\n if (isSpace(ch)) {\n if (ch === 0x09) {\n lineIndent += 4 - (lineIndent + this.bsCount[line]) % 4\n } else {\n lineIndent++\n }\n } else if (first - lineStart < this.tShift[line]) {\n // patched tShift masked characters to look like spaces (blockquotes, list markers)\n lineIndent++\n } else {\n break\n }\n\n first++\n }\n\n if (lineIndent > indent) {\n // partially expanding tabs in code blocks, e.g '\\t\\tfoobar'\n // with indent=2 becomes ' \\tfoobar'\n queue[i] = new Array(lineIndent - indent + 1).join(' ') + this.src.slice(first, last)\n } else {\n queue[i] = this.src.slice(first, last)\n }\n }\n\n return queue.join('')\n }\n}\n\nexport default StateBlock\n","// GFM table, https://github.github.com/gfm/#tables-extension-\n\nimport { isSpace } from '../common/utils.ts'\nimport type StateBlock from './state_block.ts'\n\n// Limit the amount of empty autocompleted cells in a table,\n// see https://github.com/markdown-it/markdown-it/issues/1000,\n//\n// Both pulldown-cmark and commonmark-hs limit the number of cells this way to ~200k.\n// We set it to 65k, which can expand user input by a factor of x370\n// (256x256 square is 1.8kB expanded into 650kB).\nconst MAX_AUTOCOMPLETED_CELLS = 0x10000\n\nfunction getLine (state: StateBlock, line: number) {\n const pos = state.bMarks[line] + state.tShift[line]\n const max = state.eMarks[line]\n\n return state.src.slice(pos, max)\n}\n\nfunction escapedSplit (str: string) {\n const result = []\n const max = str.length\n\n let pos = 0\n let ch = str.charCodeAt(pos)\n let isEscaped = false\n let lastPos = 0\n let current = ''\n\n while (pos < max) {\n if (ch === 0x7c/* | */) {\n if (!isEscaped) {\n // pipe separating cells, '|'\n result.push(current + str.substring(lastPos, pos))\n current = ''\n lastPos = pos + 1\n } else {\n // escaped pipe, '\\|'\n current += str.substring(lastPos, pos - 1)\n lastPos = pos\n }\n }\n\n isEscaped = (ch === 0x5c/* \\ */)\n pos++\n\n ch = str.charCodeAt(pos)\n }\n\n result.push(current + str.substring(lastPos))\n\n return result\n}\n\nexport default function table (state: StateBlock, startLine: number, endLine: number, silent: boolean): boolean {\n // should have at least two lines\n if (startLine + 2 > endLine) { return false }\n\n let nextLine = startLine + 1\n\n if (state.sCount[nextLine] < state.blkIndent) { return false }\n\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[nextLine] - state.blkIndent >= 4) { return false }\n\n // first character of the second line should be '|', '-', ':',\n // and no other characters are allowed but spaces;\n // basically, this is the equivalent of /^[-:|][-:|\\s]*$/ regexp\n\n let pos = state.bMarks[nextLine] + state.tShift[nextLine]\n if (pos >= state.eMarks[nextLine]) { return false }\n\n const firstCh = state.src.charCodeAt(pos++)\n if (firstCh !== 0x7C/* | */ && firstCh !== 0x2D/* - */ && firstCh !== 0x3A/* : */) { return false }\n\n if (pos >= state.eMarks[nextLine]) { return false }\n\n const secondCh = state.src.charCodeAt(pos++)\n if (secondCh !== 0x7C/* | */ && secondCh !== 0x2D/* - */ && secondCh !== 0x3A/* : */ && !isSpace(secondCh)) {\n return false\n }\n\n // if first character is '-', then second character must not be a space\n // (due to parsing ambiguity with list)\n if (firstCh === 0x2D/* - */ && isSpace(secondCh)) { return false }\n\n while (pos < state.eMarks[nextLine]) {\n const ch = state.src.charCodeAt(pos)\n\n if (ch !== 0x7C/* | */ && ch !== 0x2D/* - */ && ch !== 0x3A/* : */ && !isSpace(ch)) { return false }\n\n pos++\n }\n\n let lineText = getLine(state, startLine + 1)\n let columns = lineText.split('|')\n const aligns = []\n for (let i = 0; i < columns.length; i++) {\n const t = columns[i].trim()\n if (!t) {\n // allow empty columns before and after table, but not in between columns;\n // e.g. allow ` |---| `, disallow ` ---||--- `\n if (i === 0 || i === columns.length - 1) {\n continue\n } else {\n return false\n }\n }\n\n if (!/^:?-+:?$/.test(t)) { return false }\n if (t.charCodeAt(t.length - 1) === 0x3A/* : */) {\n aligns.push(t.charCodeAt(0) === 0x3A/* : */ ? 'center' : 'right')\n } else if (t.charCodeAt(0) === 0x3A/* : */) {\n aligns.push('left')\n } else {\n aligns.push('')\n }\n }\n\n lineText = getLine(state, startLine).trim()\n if (lineText.indexOf('|') === -1) { return false }\n if (state.sCount[startLine] - state.blkIndent >= 4) { return false }\n columns = escapedSplit(lineText)\n if (columns.length && columns[0] === '') columns.shift()\n if (columns.length && columns[columns.length - 1] === '') columns.pop()\n\n // header row will define an amount of columns in the entire table,\n // and align row should be exactly the same (the rest of the rows can differ)\n const columnCount = columns.length\n if (columnCount === 0 || columnCount !== aligns.length) { return false }\n\n if (silent) { return true }\n\n const oldParentType = state.parentType\n state.parentType = 'table'\n\n // use 'blockquote' lists for termination because it's\n // the most similar to tables\n const terminatorRules = state.md.block.ruler.getRules('blockquote')\n\n const token_to = state.push('table_open', 'table', 1)\n const tableLines: [number, number] = [startLine, 0]\n token_to.map = tableLines\n\n const token_tho = state.push('thead_open', 'thead', 1)\n token_tho.map = [startLine, startLine + 1]\n\n const token_htro = state.push('tr_open', 'tr', 1)\n token_htro.map = [startLine, startLine + 1]\n\n for (let i = 0; i < columns.length; i++) {\n const token_ho = state.push('th_open', 'th', 1)\n if (aligns[i]) {\n token_ho.attrs = [['style', `text-align:${aligns[i]}`]]\n }\n\n const token_il = state.push('inline', '', 0)\n token_il.content = columns[i].trim()\n token_il.children = []\n\n state.push('th_close', 'th', -1)\n }\n\n state.push('tr_close', 'tr', -1)\n state.push('thead_close', 'thead', -1)\n\n let tbodyLines: [number, number] | undefined\n let autocompletedCells = 0\n\n for (nextLine = startLine + 2; nextLine < endLine; nextLine++) {\n if (state.sCount[nextLine] < state.blkIndent) { break }\n\n let terminate = false\n for (let i = 0, l = terminatorRules.length; i < l; i++) {\n if (terminatorRules[i](state, nextLine, endLine, true)) {\n terminate = true\n break\n }\n }\n\n if (terminate) { break }\n lineText = getLine(state, nextLine).trim()\n if (!lineText) { break }\n if (state.sCount[nextLine] - state.blkIndent >= 4) { break }\n columns = escapedSplit(lineText)\n if (columns.length && columns[0] === '') columns.shift()\n if (columns.length && columns[columns.length - 1] === '') columns.pop()\n\n // note: autocomplete count can be negative if user specifies more columns than header,\n // but that does not affect intended use (which is limiting expansion)\n autocompletedCells += columnCount - columns.length\n if (autocompletedCells > MAX_AUTOCOMPLETED_CELLS) { break }\n\n if (nextLine === startLine + 2) {\n const token_tbo = state.push('tbody_open', 'tbody', 1)\n token_tbo.map = tbodyLines = [startLine + 2, 0]\n }\n\n const token_tro = state.push('tr_open', 'tr', 1)\n token_tro.map = [nextLine, nextLine + 1]\n\n for (let i = 0; i < columnCount; i++) {\n const token_tdo = state.push('td_open', 'td', 1)\n if (aligns[i]) {\n token_tdo.attrs = [['style', `text-align:${aligns[i]}`]]\n }\n\n const token_il = state.push('inline', '', 0)\n token_il.content = columns[i] ? columns[i].trim() : ''\n token_il.children = []\n\n state.push('td_close', 'td', -1)\n }\n state.push('tr_close', 'tr', -1)\n }\n\n if (tbodyLines) {\n state.push('tbody_close', 'tbody', -1)\n tbodyLines[1] = nextLine\n }\n\n state.push('table_close', 'table', -1)\n tableLines[1] = nextLine\n\n state.parentType = oldParentType\n state.line = nextLine\n return true\n}\n","// Code block (4 spaces padded)\n\nimport type StateBlock from './state_block.ts'\n\nexport default function code (state: StateBlock, startLine: number, endLine: number/*, silent */): boolean {\n if (state.sCount[startLine] - state.blkIndent < 4) { return false }\n\n let nextLine = startLine + 1\n let last = nextLine\n\n while (nextLine < endLine) {\n if (state.isEmpty(nextLine)) {\n nextLine++\n continue\n }\n\n if (state.sCount[nextLine] - state.blkIndent >= 4) {\n nextLine++\n last = nextLine\n continue\n }\n break\n }\n\n state.line = last\n\n const token = state.push('code_block', 'code', 0)\n token.content = state.getLines(startLine, last, 4 + state.blkIndent, false) + '\\n'\n token.map = [startLine, state.line]\n\n return true\n}\n","// fences (``` lang, ~~~ lang)\n\nimport type StateBlock from './state_block.ts'\n\nexport default function fence (state: StateBlock, startLine: number, endLine: number, silent: boolean): boolean {\n let pos = state.bMarks[startLine] + state.tShift[startLine]\n let max = state.eMarks[startLine]\n\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[startLine] - state.blkIndent >= 4) { return false }\n\n if (pos + 3 > max) { return false }\n\n const marker = state.src.charCodeAt(pos)\n\n if (marker !== 0x7E/* ~ */ && marker !== 0x60 /* ` */) {\n return false\n }\n\n // scan marker length\n let mem = pos\n pos = state.skipChars(pos, marker)\n\n let len = pos - mem\n\n if (len < 3) { return false }\n\n const markup = state.src.slice(mem, pos)\n const params = state.src.slice(pos, max)\n\n if (marker === 0x60 /* ` */) {\n if (params.indexOf(String.fromCharCode(marker)) >= 0) {\n return false\n }\n }\n\n // Since start is found, we can report success here in validation mode\n if (silent) { return true }\n\n // search end of block\n let nextLine = startLine\n let haveEndMarker = false\n\n for (;;) {\n nextLine++\n if (nextLine >= endLine) {\n // unclosed block should be autoclosed by end of document.\n // also block seems to be autoclosed by end of parent\n break\n }\n\n pos = mem = state.bMarks[nextLine] + state.tShift[nextLine]\n max = state.eMarks[nextLine]\n\n if (pos < max && state.sCount[nextLine] < state.blkIndent) {\n // non-empty line with negative indent should stop the list:\n // - ```\n // test\n break\n }\n\n if (state.src.charCodeAt(pos) !== marker) { continue }\n\n if (state.sCount[nextLine] - state.blkIndent >= 4) {\n // closing fence should be indented less than 4 spaces\n continue\n }\n\n pos = state.skipChars(pos, marker)\n\n // closing code fence must be at least as long as the opening one\n if (pos - mem < len) { continue }\n\n // make sure tail has spaces only\n pos = state.skipSpaces(pos)\n\n if (pos < max) { continue }\n\n haveEndMarker = true\n // found!\n break\n }\n\n // If a fence has heading spaces, they should be removed from its inner block\n len = state.sCount[startLine]\n\n state.line = nextLine + (haveEndMarker ? 1 : 0)\n\n const token = state.push('fence', 'code', 0)\n token.info = params\n token.content = state.getLines(startLine + 1, nextLine, len, true)\n token.markup = markup\n token.map = [startLine, state.line]\n\n return true\n}\n","// Block quotes\n\nimport { isSpace } from '../common/utils.ts'\nimport type StateBlock from './state_block.ts'\n\nexport default function blockquote (state: StateBlock, startLine: number, endLine: number, silent: boolean): boolean {\n let pos = state.bMarks[startLine] + state.tShift[startLine]\n let max = state.eMarks[startLine]\n\n const oldLineMax = state.lineMax\n\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[startLine] - state.blkIndent >= 4) { return false }\n\n // check the block quote marker\n if (state.src.charCodeAt(pos) !== 0x3E/* > */) { return false }\n\n // we know that it's going to be a valid blockquote,\n // so no point trying to find the end of it in silent mode\n if (silent) { return true }\n\n const oldBMarks = []\n const oldBSCount = []\n const oldSCount = []\n const oldTShift = []\n\n const terminatorRules = state.md.block.ruler.getRules('blockquote')\n\n const oldParentType = state.parentType\n state.parentType = 'blockquote'\n let lastLineEmpty = false\n let nextLine\n\n // Search the end of the block\n //\n // Block ends with either:\n // 1. an empty line outside:\n // ```\n // > test\n //\n // ```\n // 2. an empty line inside:\n // ```\n // >\n // test\n // ```\n // 3. another tag:\n // ```\n // > test\n // - - -\n // ```\n for (nextLine = startLine; nextLine < endLine; nextLine++) {\n // check if it's outdented, i.e. it's inside list item and indented\n // less than said list item:\n //\n // ```\n // 1. anything\n // > current blockquote\n // 2. checking this line\n // ```\n const isOutdented = state.sCount[nextLine] < state.blkIndent\n\n pos = state.bMarks[nextLine] + state.tShift[nextLine]\n max = state.eMarks[nextLine]\n\n if (pos >= max) {\n // Case 1: line is not inside the blockquote, and this line is empty.\n break\n }\n\n if (state.src.charCodeAt(pos++) === 0x3E/* > */ && !isOutdented) {\n // This line is inside the blockquote.\n\n // set offset past spaces and \">\"\n let initial = state.sCount[nextLine] + 1\n let spaceAfterMarker\n let adjustTab\n\n // skip one optional space after '>'\n if (state.src.charCodeAt(pos) === 0x20 /* space */) {\n // ' > test '\n // ^ -- position start of line here:\n pos++\n initial++\n adjustTab = false\n spaceAfterMarker = true\n } else if (state.src.charCodeAt(pos) === 0x09 /* tab */) {\n spaceAfterMarker = true\n\n if ((state.bsCount[nextLine] + initial) % 4 === 3) {\n // ' >\\t test '\n // ^ -- position start of line here (tab has width===1)\n pos++\n initial++\n adjustTab = false\n } else {\n // ' >\\t test '\n // ^ -- position start of line here + shift bsCount slightly\n // to make extra space appear\n adjustTab = true\n }\n } else {\n spaceAfterMarker = false\n }\n\n let offset = initial\n oldBMarks.push(state.bMarks[nextLine])\n state.bMarks[nextLine] = pos\n\n while (pos < max) {\n const ch = state.src.charCodeAt(pos)\n\n if (isSpace(ch)) {\n if (ch === 0x09) {\n offset += 4 - (offset + state.bsCount[nextLine] + (adjustTab ? 1 : 0)) % 4\n } else {\n offset++\n }\n } else {\n break\n }\n\n pos++\n }\n\n lastLineEmpty = pos >= max\n\n oldBSCount.push(state.bsCount[nextLine])\n state.bsCount[nextLine] = state.sCount[nextLine] + 1 + (spaceAfterMarker ? 1 : 0)\n\n oldSCount.push(state.sCount[nextLine])\n state.sCount[nextLine] = offset - initial\n\n oldTShift.push(state.tShift[nextLine])\n state.tShift[nextLine] = pos - state.bMarks[nextLine]\n continue\n }\n\n // Case 2: line is not inside the blockquote, and the last line was empty.\n if (lastLineEmpty) { break }\n\n // Case 3: another tag found.\n let terminate = false\n for (let i = 0, l = terminatorRules.length; i < l; i++) {\n if (terminatorRules[i](state, nextLine, endLine, true)) {\n terminate = true\n break\n }\n }\n\n if (terminate) {\n // Quirk to enforce \"hard termination mode\" for paragraphs;\n // normally if you call `tokenize(state, startLine, nextLine)`,\n // paragraphs will look below nextLine for paragraph continuation,\n // but if blockquote is terminated by another tag, they shouldn't\n state.lineMax = nextLine\n\n if (state.blkIndent !== 0) {\n // state.blkIndent was non-zero, we now set it to zero,\n // so we need to re-calculate all offsets to appear as\n // if indent wasn't changed\n oldBMarks.push(state.bMarks[nextLine])\n oldBSCount.push(state.bsCount[nextLine])\n oldTShift.push(state.tShift[nextLine])\n oldSCount.push(state.sCount[nextLine])\n state.sCount[nextLine] -= state.blkIndent\n }\n\n break\n }\n\n oldBMarks.push(state.bMarks[nextLine])\n oldBSCount.push(state.bsCount[nextLine])\n oldTShift.push(state.tShift[nextLine])\n oldSCount.push(state.sCount[nextLine])\n\n // A negative indentation means that this is a paragraph continuation\n //\n state.sCount[nextLine] = -1\n }\n\n const oldIndent = state.blkIndent\n state.blkIndent = 0\n\n const token_o = state.push('blockquote_open', 'blockquote', 1)\n token_o.markup = '>'\n const lines: [number, number] = [startLine, 0]\n token_o.map = lines\n\n state.md.block.tokenize(state, startLine, nextLine)\n\n const token_c = state.push('blockquote_close', 'blockquote', -1)\n token_c.markup = '>'\n\n state.lineMax = oldLineMax\n state.parentType = oldParentType\n lines[1] = state.line\n\n // Restore original tShift; this might not be necessary since the parser\n // has already been here, but just to make sure we can do that.\n for (let i = 0; i < oldTShift.length; i++) {\n state.bMarks[i + startLine] = oldBMarks[i]\n state.tShift[i + startLine] = oldTShift[i]\n state.sCount[i + startLine] = oldSCount[i]\n state.bsCount[i + startLine] = oldBSCount[i]\n }\n state.blkIndent = oldIndent\n\n return true\n}\n","// Horizontal rule\n\nimport { isSpace } from '../common/utils.ts'\nimport type StateBlock from './state_block.ts'\n\nexport default function hr (state: StateBlock, startLine: number, endLine: number, silent: boolean): boolean {\n const max = state.eMarks[startLine]\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[startLine] - state.blkIndent >= 4) { return false }\n\n let pos = state.bMarks[startLine] + state.tShift[startLine]\n const marker = state.src.charCodeAt(pos++)\n\n // Check hr marker\n if (marker !== 0x2A/* * */ &&\n marker !== 0x2D/* - */ &&\n marker !== 0x5F/* _ */) {\n return false\n }\n\n // markers can be mixed with spaces, but there should be at least 3 of them\n\n let cnt = 1\n while (pos < max) {\n const ch = state.src.charCodeAt(pos++)\n if (ch !== marker && !isSpace(ch)) { return false }\n if (ch === marker) { cnt++ }\n }\n\n if (cnt < 3) { return false }\n\n if (silent) { return true }\n\n state.line = startLine + 1\n\n const token = state.push('hr', 'hr', 0)\n token.map = [startLine, state.line]\n token.markup = Array(cnt + 1).join(String.fromCharCode(marker))\n\n return true\n}\n","// Lists\n\nimport { isSpace } from '../common/utils.ts'\nimport type StateBlock from './state_block.ts'\n\n// Search `[-+*][\\n ]`, returns next pos after marker on success\n// or -1 on fail.\nfunction skipBulletListMarker (state: StateBlock, startLine: number) {\n const max = state.eMarks[startLine]\n let pos = state.bMarks[startLine] + state.tShift[startLine]\n\n const marker = state.src.charCodeAt(pos++)\n // Check bullet\n if (marker !== 0x2A/* * */ &&\n marker !== 0x2D/* - */ &&\n marker !== 0x2B/* + */) {\n return -1\n }\n\n if (pos < max) {\n const ch = state.src.charCodeAt(pos)\n\n if (!isSpace(ch)) {\n // \" -test \" - is not a list item\n return -1\n }\n }\n\n return pos\n}\n\n// Search `\\d+[.)][\\n ]`, returns next pos after marker on success\n// or -1 on fail.\nfunction skipOrderedListMarker (state: StateBlock, startLine: number) {\n const start = state.bMarks[startLine] + state.tShift[startLine]\n const max = state.eMarks[startLine]\n let pos = start\n\n // List marker should have at least 2 chars (digit + dot)\n if (pos + 1 >= max) { return -1 }\n\n let ch = state.src.charCodeAt(pos++)\n\n if (ch < 0x30/* 0 */ || ch > 0x39/* 9 */) { return -1 }\n\n for (;;) {\n // EOL -> fail\n if (pos >= max) { return -1 }\n\n ch = state.src.charCodeAt(pos++)\n\n if (ch >= 0x30/* 0 */ && ch <= 0x39/* 9 */) {\n // List marker should have no more than 9 digits\n // (prevents integer overflow in browsers)\n if (pos - start >= 10) { return -1 }\n\n continue\n }\n\n // found valid marker\n if (ch === 0x29/* ) */ || ch === 0x2e/* . */) {\n break\n }\n\n return -1\n }\n\n if (pos < max) {\n ch = state.src.charCodeAt(pos)\n\n if (!isSpace(ch)) {\n // \" 1.test \" - is not a list item\n return -1\n }\n }\n return pos\n}\n\nfunction markTightParagraphs (state: StateBlock, idx: number) {\n const level = state.level + 2\n\n for (let i = idx + 2, l = state.tokens.length - 2; i < l; i++) {\n if (state.tokens[i].level === level && state.tokens[i].type === 'paragraph_open') {\n state.tokens[i + 2].hidden = true\n state.tokens[i].hidden = true\n i += 2\n }\n }\n}\n\nexport default function list (state: StateBlock, startLine: number, endLine: number, silent: boolean): boolean {\n let max, pos, start, token\n let nextLine = startLine\n let tight = true\n\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[nextLine] - state.blkIndent >= 4) { return false }\n\n // Special case:\n // - item 1\n // - item 2\n // - item 3\n // - item 4\n // - this one is a paragraph continuation\n if (state.listIndent >= 0 &&\n state.sCount[nextLine] - state.listIndent >= 4 &&\n state.sCount[nextLine] < state.blkIndent) {\n return false\n }\n\n let isTerminatingParagraph = false\n\n // limit conditions when list can interrupt\n // a paragraph (validation mode only)\n if (silent && state.parentType === 'paragraph') {\n // Next list item should still terminate previous list item;\n //\n // This code can fail if plugins use blkIndent as well as lists,\n // but I hope the spec gets fixed long before that happens.\n //\n if (state.sCount[nextLine] >= state.blkIndent) {\n isTerminatingParagraph = true\n }\n }\n\n // Detect list type and position after marker\n let isOrdered\n let markerValue\n let posAfterMarker\n if ((posAfterMarker = skipOrderedListMarker(state, nextLine)) >= 0) {\n isOrdered = true\n start = state.bMarks[nextLine] + state.tShift[nextLine]\n markerValue = Number(state.src.slice(start, posAfterMarker - 1))\n\n // If we're starting a new ordered list right after\n // a paragraph, it should start with 1.\n if (isTerminatingParagraph && markerValue !== 1) return false\n } else if ((posAfterMarker = skipBulletListMarker(state, nextLine)) >= 0) {\n isOrdered = false\n } else {\n return false\n }\n\n // If we're starting a new unordered list right after\n // a paragraph, first line should not be empty.\n if (isTerminatingParagraph) {\n if (state.skipSpaces(posAfterMarker) >= state.eMarks[nextLine]) return false\n }\n\n // For validation mode we can terminate immediately\n if (silent) { return true }\n\n // We should terminate list on style change. Remember first one to compare.\n const markerCharCode = state.src.charCodeAt(posAfterMarker - 1)\n\n // Start list\n const listTokIdx = state.tokens.length\n\n if (isOrdered) {\n token = state.push('ordered_list_open', 'ol', 1)\n if (markerValue !== 1) {\n token.attrs = [['start', markerValue!]]\n }\n } else {\n token = state.push('bullet_list_open', 'ul', 1)\n }\n\n const listLines: [number, number] = [nextLine, 0]\n token.map = listLines\n token.markup = String.fromCharCode(markerCharCode)\n\n //\n // Iterate list items\n //\n\n let prevEmptyEnd = false\n const terminatorRules = state.md.block.ruler.getRules('list')\n\n const oldParentType = state.parentType\n state.parentType = 'list'\n\n while (nextLine < endLine) {\n pos = posAfterMarker\n max = state.eMarks[nextLine]\n\n const initial = state.sCount[nextLine] + posAfterMarker - (state.bMarks[nextLine] + state.tShift[nextLine])\n let offset = initial\n\n while (pos < max) {\n const ch = state.src.charCodeAt(pos)\n\n if (ch === 0x09) {\n offset += 4 - (offset + state.bsCount[nextLine]) % 4\n } else if (ch === 0x20) {\n offset++\n } else {\n break\n }\n\n pos++\n }\n\n const contentStart = pos\n let indentAfterMarker\n\n if (contentStart >= max) {\n // trimming space in \"- \\n 3\" case, indent is 1 here\n indentAfterMarker = 1\n } else {\n indentAfterMarker = offset - initial\n }\n\n // If we have more than 4 spaces, the indent is 1\n // (the rest is just indented code block)\n if (indentAfterMarker > 4) { indentAfterMarker = 1 }\n\n // \" - test\"\n // ^^^^^ - calculating total length of this thing\n const indent = initial + indentAfterMarker\n\n // Run subparser & write tokens\n token = state.push('list_item_open', 'li', 1)\n token.markup = String.fromCharCode(markerCharCode)\n const itemLines: [number, number] = [nextLine, 0]\n token.map = itemLines\n if (isOrdered) {\n token.info = state.src.slice(start, posAfterMarker - 1)\n }\n\n // change current state, then restore it after parser subcall\n const oldTight = state.tight\n const oldTShift = state.tShift[nextLine]\n const oldSCount = state.sCount[nextLine]\n\n // - example list\n // ^ listIndent position will be here\n // ^ blkIndent position will be here\n //\n const oldListIndent = state.listIndent\n state.listIndent = state.blkIndent\n state.blkIndent = indent\n\n state.tight = true\n state.tShift[nextLine] = contentStart - state.bMarks[nextLine]\n state.sCount[nextLine] = offset\n\n if (contentStart >= max && state.isEmpty(nextLine + 1)) {\n // workaround for this case\n // (list item is empty, list terminates before \"foo\"):\n // ~~~~~~~~\n // -\n //\n // foo\n // ~~~~~~~~\n state.line = Math.min(state.line + 2, endLine)\n } else {\n state.md.block.tokenize(state, nextLine, endLine)\n }\n\n // If any of list item is tight, mark list as tight\n if (!state.tight || prevEmptyEnd) {\n tight = false\n }\n // Item become loose if finish with empty line,\n // but we should filter last element, because it means list finish\n prevEmptyEnd = (state.line - nextLine) > 1 && state.isEmpty(state.line - 1)\n\n state.blkIndent = state.listIndent\n state.listIndent = oldListIndent\n state.tShift[nextLine] = oldTShift\n state.sCount[nextLine] = oldSCount\n state.tight = oldTight\n\n token = state.push('list_item_close', 'li', -1)\n token.markup = String.fromCharCode(markerCharCode)\n\n nextLine = state.line\n itemLines[1] = nextLine\n\n if (nextLine >= endLine) { break }\n\n //\n // Try to check if list is terminated or continued.\n //\n if (state.sCount[nextLine] < state.blkIndent) { break }\n\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[nextLine] - state.blkIndent >= 4) { break }\n\n // fail if terminating block found\n let terminate = false\n for (let i = 0, l = terminatorRules.length; i < l; i++) {\n if (terminatorRules[i](state, nextLine, endLine, true)) {\n terminate = true\n break\n }\n }\n if (terminate) { break }\n\n // fail if list has another type\n if (isOrdered) {\n posAfterMarker = skipOrderedListMarker(state, nextLine)\n if (posAfterMarker < 0) { break }\n start = state.bMarks[nextLine] + state.tShift[nextLine]\n } else {\n posAfterMarker = skipBulletListMarker(state, nextLine)\n if (posAfterMarker < 0) { break }\n }\n\n if (markerCharCode !== state.src.charCodeAt(posAfterMarker - 1)) { break }\n }\n\n // Finalize list\n if (isOrdered) {\n token = state.push('ordered_list_close', 'ol', -1)\n } else {\n token = state.push('bullet_list_close', 'ul', -1)\n }\n token.markup = String.fromCharCode(markerCharCode)\n\n listLines[1] = nextLine\n state.line = nextLine\n\n state.parentType = oldParentType\n\n // mark paragraphs tight if needed\n if (tight) {\n markTightParagraphs(state, listTokIdx)\n }\n\n return true\n}\n","import { isSpace, normalizeReference } from '../common/utils.ts'\nimport type StateBlock from './state_block.ts'\n\n// CommonMark limits reference labels to 999 Unicode code points.\nconst MAX_LABEL_LENGTH = 999\n\nfunction countCodePoints (str: string) {\n let length = str.length\n\n for (let i = 0; i < str.length - 1; i++) {\n const high = str.charCodeAt(i)\n if (high < 0xD800 || high > 0xDBFF) { continue }\n\n const low = str.charCodeAt(i + 1)\n if (low >= 0xDC00 && low <= 0xDFFF) {\n length--\n i++\n }\n }\n\n return length\n}\n\n// Exclusive end offset of the line, after its newline if present\nfunction lineEnd (state: StateBlock, line: number) {\n return Math.min(state.eMarks[line] + 1, state.src.length)\n}\n\n// Returns -1 if the reference can't continue on this line\nfunction getNextLinePos (state: StateBlock, nextLine: number) {\n const endLine = state.lineMax\n\n if (nextLine >= endLine || state.isEmpty(nextLine)) {\n // empty line or end of input\n return -1\n }\n\n let isContinuation = false\n\n // this would be a code block normally, but after paragraph\n // it's considered a lazy continuation regardless of what's there\n if (state.sCount[nextLine] - state.blkIndent > 3) { isContinuation = true }\n\n // quirk for blockquotes, this line should already be checked by that rule\n if (state.sCount[nextLine] < 0) { isContinuation = true }\n\n if (!isContinuation) {\n const terminatorRules = state.md.block.ruler.getRules('reference')\n const oldParentType = state.parentType\n state.parentType = 'reference'\n\n // Some tags can terminate paragraph without empty line.\n let terminate = false\n for (let i = 0, l = terminatorRules.length; i < l; i++) {\n if (terminatorRules[i](state, nextLine, endLine, true)) {\n terminate = true\n break\n }\n }\n\n state.parentType = oldParentType\n if (terminate) {\n // terminated by another block\n return -1\n }\n }\n\n return state.bMarks[nextLine] + state.tShift[nextLine]\n}\n\nexport default function reference (state: StateBlock, startLine: number, _endLine: number, silent: boolean): boolean {\n const src = state.src\n let pos = state.bMarks[startLine] + state.tShift[startLine]\n let nextLine = startLine + 1\n\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[startLine] - state.blkIndent >= 4) { return false }\n\n if (src.charCodeAt(pos) !== 0x5B/* [ */) { return false }\n\n // Scan the source directly: indexing a string after each appended line\n // can make V8 copy the accumulated prefix on every continuation.\n let max = lineEnd(state, startLine)\n\n let rawLabel = ''\n let labelEnd = -1\n let segmentStart = ++pos\n\n while (pos < max) {\n if (rawLabel.length + pos - segmentStart > MAX_LABEL_LENGTH * 2) { return false }\n\n let ch = src.charCodeAt(pos)\n if (ch === 0x5B /* [ */) { return false }\n if (ch === 0x5D /* ] */) {\n labelEnd = pos\n break\n }\n if (ch === 0x5C /* \\ */) { ch = src.charCodeAt(++pos) }\n\n if (ch === 0x0A /* \\n */ && pos < max) {\n const nextPos = getNextLinePos(state, nextLine)\n if (nextPos < 0) { return false }\n rawLabel += src.slice(segmentStart, max)\n pos = segmentStart = nextPos\n max = lineEnd(state, nextLine++)\n continue\n }\n pos++\n }\n\n if (labelEnd < 0 || src.charCodeAt(labelEnd + 1) !== 0x3A/* : */) { return false }\n\n rawLabel += src.slice(segmentStart, labelEnd)\n\n if (rawLabel.length > MAX_LABEL_LENGTH && countCodePoints(rawLabel) > MAX_LABEL_LENGTH) {\n return false\n }\n\n // [label]: destination 'title'\n // ^^^ skip optional whitespace here\n pos = labelEnd + 2\n while (pos < max) {\n const ch = src.charCodeAt(pos)\n if (ch === 0x0A) {\n const nextPos = getNextLinePos(state, nextLine)\n if (nextPos < 0) { break }\n pos = nextPos\n max = lineEnd(state, nextLine++)\n } else if (isSpace(ch)) {\n pos++\n } else {\n break\n }\n }\n\n // [label]: destination 'title'\n // ^^^^^^^^^^^ parse this\n const destRes = state.md.helpers.parseLinkDestination(src, pos, max)\n if (!destRes.ok) { return false }\n\n const href = state.md.normalizeLink(destRes.str)\n if (!state.md.validateLink(href)) { return false }\n\n pos = destRes.pos\n\n // save cursor state, we could require to rollback later\n const destEndPos = pos\n const destEndMax = max\n const destEndLineNo = nextLine\n\n // [label]: destination 'title'\n // ^^^ skipping those spaces\n while (pos < max) {\n const ch = src.charCodeAt(pos)\n if (ch === 0x0A) {\n const nextPos = getNextLinePos(state, nextLine)\n if (nextPos < 0) { break }\n pos = nextPos\n max = lineEnd(state, nextLine++)\n } else if (isSpace(ch)) {\n pos++\n } else {\n break\n }\n }\n\n // [label]: destination 'title'\n // ^^^^^^^ parse this\n const titleStart = pos\n let titleRes = state.md.helpers.parseLinkTitle(src, pos, max)\n while (titleRes.can_continue) {\n const nextPos = getNextLinePos(state, nextLine)\n if (nextPos < 0) break\n pos = nextPos\n max = lineEnd(state, nextLine++)\n titleRes = state.md.helpers.parseLinkTitle(src, pos, max, titleRes)\n }\n let title\n\n if (titleStart !== destEndPos && titleRes.ok) {\n title = titleRes.str\n pos = titleRes.pos\n } else {\n title = ''\n pos = destEndPos\n max = destEndMax\n nextLine = destEndLineNo\n }\n\n // skip trailing spaces until the rest of the line\n while (pos < max) {\n const ch = src.charCodeAt(pos)\n if (!isSpace(ch)) { break }\n pos++\n }\n\n if (pos < max && src.charCodeAt(pos) !== 0x0A) {\n if (title) {\n // garbage at the end of the line after title,\n // but it could still be a valid reference if we roll back\n title = ''\n pos = destEndPos\n max = destEndMax\n nextLine = destEndLineNo\n while (pos < max) {\n const ch = src.charCodeAt(pos)\n if (!isSpace(ch)) { break }\n pos++\n }\n }\n }\n\n if (pos < max && src.charCodeAt(pos) !== 0x0A) {\n // garbage at the end of the line\n return false\n }\n\n const label = normalizeReference(rawLabel)\n if (!label) {\n // CommonMark 0.20 disallows empty labels\n return false\n }\n\n // Reference can not terminate anything. This check is for safety only.\n /* istanbul ignore if */\n if (silent) { return true }\n\n if (typeof state.env.references === 'undefined') {\n state.env.references = {}\n }\n if (typeof state.env.references[label] === 'undefined') {\n state.env.references[label] = { title, href }\n }\n\n // Marks the place definition took in the source. Renders to nothing,\n // href/title stay in `env.references`.\n const token = state.push('reference_definition', '', 0)\n token.map = [startLine, nextLine]\n token.hidden = true\n\n const meta: Record<string, unknown> = Object.create(null)\n meta.label = label\n token.meta = meta\n\n state.line = nextLine\n return true\n}\n","// List of valid html blocks names, according to commonmark spec\n// https://spec.commonmark.org/0.30/#html-blocks\n\nexport default [\n 'address',\n 'article',\n 'aside',\n 'base',\n 'basefont',\n 'blockquote',\n 'body',\n 'caption',\n 'center',\n 'col',\n 'colgroup',\n 'dd',\n 'details',\n 'dialog',\n 'dir',\n 'div',\n 'dl',\n 'dt',\n 'fieldset',\n 'figcaption',\n 'figure',\n 'footer',\n 'form',\n 'frame',\n 'frameset',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'head',\n 'header',\n 'hr',\n 'html',\n 'iframe',\n 'legend',\n 'li',\n 'link',\n 'main',\n 'menu',\n 'menuitem',\n 'nav',\n 'noframes',\n 'ol',\n 'optgroup',\n 'option',\n 'p',\n 'param',\n 'search',\n 'section',\n 'summary',\n 'table',\n 'tbody',\n 'td',\n 'tfoot',\n 'th',\n 'thead',\n 'title',\n 'tr',\n 'track',\n 'ul'\n]\n","// Regexps to match html elements\n\nconst attr_name = '[a-zA-Z_:][a-zA-Z0-9:._-]*'\n\nconst unquoted = '[^\"\\'=<>`\\\\x00-\\\\x20]+'\nconst single_quoted = \"'[^']*'\"\nconst double_quoted = '\"[^\"]*\"'\n\nconst attr_value = `(?:${unquoted}|${single_quoted}|${double_quoted})`\n\nconst attribute = `(?:\\\\s+${attr_name}(?:\\\\s*=\\\\s*${attr_value})?)`\n\nconst open_tag = `<[A-Za-z][A-Za-z0-9\\\\-]*${attribute}*\\\\s*\\\\/?>`\n\nconst close_tag = '<\\\\/[A-Za-z][A-Za-z0-9\\\\-]*\\\\s*>'\nconst comment = '<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->'\nconst processing = '<[?][\\\\s\\\\S]*?[?]>'\nconst declaration = '<![A-Za-z][^>]*>'\nconst cdata = '<!\\\\[CDATA\\\\[[\\\\s\\\\S]*?\\\\]\\\\]>'\n\n/** @deprecated Will be removed in future versions. */\nconst HTML_TAG_RE = new RegExp(\n `^(?:${open_tag}|${close_tag}|${comment}|${processing}|${declaration}|${cdata})`\n)\nconst HTML_OPEN_CLOSE_TAG_RE = new RegExp(`^(?:${open_tag}|${close_tag})`)\n\nexport { HTML_TAG_RE, HTML_OPEN_CLOSE_TAG_RE }\n","// HTML block\n\nimport block_names from '../common/html_blocks.ts'\nimport { HTML_OPEN_CLOSE_TAG_RE } from '../common/html_re.ts'\nimport type StateBlock from './state_block.ts'\n\n// An array of opening and corresponding closing sequences for html tags,\n// last argument defines whether it can terminate a paragraph or not\n//\nconst HTML_SEQUENCES: Array<[\n open: RegExp,\n close: RegExp,\n canTerminateParagraph: boolean\n]> = [\n [/^<(script|pre|style|textarea)(?=(\\s|>|$))/i, /<\\/(script|pre|style|textarea)>/i, true],\n [/^<!--/, /-->/, true],\n [/^<\\?/, /\\?>/, true],\n [/^<![A-Za-z]/, />/, true],\n [/^<!\\[CDATA\\[/, /\\]\\]>/, true],\n [new RegExp(`^</?(${block_names.join('|')})(?=(\\\\s|/?>|$))`, 'i'), /^$/, true],\n [new RegExp(`${HTML_OPEN_CLOSE_TAG_RE.source}\\\\s*$`), /^$/, false]\n]\n\nexport default function html_block (state: StateBlock, startLine: number, endLine: number, silent: boolean): boolean {\n let pos = state.bMarks[startLine] + state.tShift[startLine]\n let max = state.eMarks[startLine]\n\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[startLine] - state.blkIndent >= 4) { return false }\n\n if (!state.md.options.html) { return false }\n\n if (state.src.charCodeAt(pos) !== 0x3C/* < */) { return false }\n\n let lineText = state.src.slice(pos, max)\n\n let i = 0\n for (; i < HTML_SEQUENCES.length; i++) {\n if (HTML_SEQUENCES[i][0].test(lineText)) { break }\n }\n if (i === HTML_SEQUENCES.length) { return false }\n\n if (silent) {\n // true if this sequence can be a terminator, false otherwise\n return HTML_SEQUENCES[i][2]\n }\n\n let nextLine = startLine + 1\n\n // Block types 6 and 7 (the only ones whose end condition is a blank line)\n // have `/^$/` as their closing regexp. For all other types (1-5, e.g.\n // `<!--` comments), a blank line is regular content and must not terminate\n // the block - it ends only when its closing sequence is found.\n const endsOnBlankLine = HTML_SEQUENCES[i][1].test('')\n\n // If we are here - we detected HTML block.\n // Let's roll down till block end.\n if (!HTML_SEQUENCES[i][1].test(lineText)) {\n for (; nextLine < endLine; nextLine++) {\n if (state.sCount[nextLine] < state.blkIndent) {\n // An outdented blank line shouldn't end a block that doesn't end on a\n // blank line (e.g. a `<!--` comment inside a list item). Such blocks\n // must continue until their closing sequence regardless of indent.\n if (endsOnBlankLine || !state.isEmpty(nextLine)) { break }\n }\n\n pos = state.bMarks[nextLine] + state.tShift[nextLine]\n max = state.eMarks[nextLine]\n lineText = state.src.slice(pos, max)\n\n if (HTML_SEQUENCES[i][1].test(lineText)) {\n if (lineText.length !== 0) { nextLine++ }\n break\n }\n }\n }\n\n state.line = nextLine\n\n const token = state.push('html_block', '', 0)\n token.map = [startLine, nextLine]\n token.content = state.getLines(startLine, nextLine, state.blkIndent, true)\n\n return true\n}\n","// heading (#, ##, ...)\n\nimport { isSpace, asciiTrim } from '../common/utils.ts'\nimport type StateBlock from './state_block.ts'\n\nexport default function heading (state: StateBlock, startLine: number, endLine: number, silent: boolean): boolean {\n let pos = state.bMarks[startLine] + state.tShift[startLine]\n let max = state.eMarks[startLine]\n\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[startLine] - state.blkIndent >= 4) { return false }\n\n let ch = state.src.charCodeAt(pos)\n\n if (ch !== 0x23/* # */ || pos >= max) { return false }\n\n // count heading level\n let level = 1\n ch = state.src.charCodeAt(++pos)\n while (ch === 0x23/* # */ && pos < max && level <= 6) {\n level++\n ch = state.src.charCodeAt(++pos)\n }\n\n if (level > 6 || (pos < max && !isSpace(ch))) { return false }\n\n if (silent) { return true }\n\n // Let's cut tails like ' ### ' from the end of string\n\n max = state.skipSpacesBack(max, pos)\n const tmp = state.skipCharsBack(max, 0x23, pos) // #\n if (tmp > pos && isSpace(state.src.charCodeAt(tmp - 1))) {\n max = tmp\n }\n\n state.line = startLine + 1\n\n const token_o = state.push('heading_open', `h${level}`, 1)\n token_o.markup = '########'.slice(0, level)\n token_o.map = [startLine, state.line]\n\n const token_i = state.push('inline', '', 0)\n token_i.content = asciiTrim(state.src.slice(pos, max))\n token_i.map = [startLine, state.line]\n token_i.children = []\n\n const token_c = state.push('heading_close', `h${level}`, -1)\n token_c.markup = '########'.slice(0, level)\n\n return true\n}\n","// lheading (---, ===)\n\nimport { asciiTrim } from '../common/utils.ts'\nimport type StateBlock from './state_block.ts'\n\nexport default function lheading (state: StateBlock, startLine: number, endLine: number/*, silent */): boolean {\n const terminatorRules = state.md.block.ruler.getRules('paragraph')\n\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[startLine] - state.blkIndent >= 4) { return false }\n\n const oldParentType = state.parentType\n state.parentType = 'paragraph' // use paragraph to match terminatorRules\n\n // jump line-by-line until empty one or EOF\n let level = 0\n let marker\n let nextLine = startLine + 1\n\n for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {\n // this would be a code block normally, but after paragraph\n // it's considered a lazy continuation regardless of what's there\n if (state.sCount[nextLine] - state.blkIndent > 3) { continue }\n\n //\n // Check for underline in setext header\n //\n if (state.sCount[nextLine] >= state.blkIndent) {\n let pos = state.bMarks[nextLine] + state.tShift[nextLine]\n const max = state.eMarks[nextLine]\n\n if (pos < max) {\n marker = state.src.charCodeAt(pos)\n\n if (marker === 0x2D/* - */ || marker === 0x3D/* = */) {\n pos = state.skipChars(pos, marker)\n pos = state.skipSpaces(pos)\n\n if (pos >= max) {\n level = (marker === 0x3D/* = */ ? 1 : 2)\n break\n }\n }\n }\n }\n\n // quirk for blockquotes, this line should already be checked by that rule\n if (state.sCount[nextLine] < 0) { continue }\n\n // Some tags can terminate paragraph without empty line.\n let terminate = false\n for (let i = 0, l = terminatorRules.length; i < l; i++) {\n if (terminatorRules[i](state, nextLine, endLine, true)) {\n terminate = true\n break\n }\n }\n if (terminate) { break }\n }\n\n if (!level) {\n // Didn't find valid underline\n state.parentType = oldParentType\n return false\n }\n\n const content = asciiTrim(state.getLines(startLine, nextLine, state.blkIndent, false))\n\n state.line = nextLine + 1\n\n const token_o = state.push('heading_open', `h${level}`, 1)\n token_o.markup = String.fromCharCode(marker!)\n token_o.map = [startLine, state.line]\n\n const token_i = state.push('inline', '', 0)\n token_i.content = content\n token_i.map = [startLine, state.line - 1]\n token_i.children = []\n\n const token_c = state.push('heading_close', `h${level}`, -1)\n token_c.markup = String.fromCharCode(marker!)\n\n state.parentType = oldParentType\n\n return true\n}\n","// Paragraph\n\nimport { asciiTrim } from '../common/utils.ts'\nimport type StateBlock from './state_block.ts'\n\nexport default function paragraph (state: StateBlock, startLine: number, endLine: number): boolean {\n const terminatorRules = state.md.block.ruler.getRules('paragraph')\n const oldParentType = state.parentType\n let nextLine = startLine + 1\n state.parentType = 'paragraph'\n\n // jump line-by-line until empty one or EOF\n for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {\n // this would be a code block normally, but after paragraph\n // it's considered a lazy continuation regardless of what's there\n if (state.sCount[nextLine] - state.blkIndent > 3) { continue }\n\n // quirk for blockquotes, this line should already be checked by that rule\n if (state.sCount[nextLine] < 0) { continue }\n\n // Some tags can terminate paragraph without empty line.\n let terminate = false\n for (let i = 0, l = terminatorRules.length; i < l; i++) {\n if (terminatorRules[i](state, nextLine, endLine, true)) {\n terminate = true\n break\n }\n }\n if (terminate) { break }\n }\n\n const content = asciiTrim(state.getLines(startLine, nextLine, state.blkIndent, false))\n\n state.line = nextLine\n\n const token_o = state.push('paragraph_open', 'p', 1)\n token_o.map = [startLine, state.line]\n\n const token_i = state.push('inline', '', 0)\n token_i.content = content\n token_i.map = [startLine, state.line]\n token_i.children = []\n\n state.push('paragraph_close', 'p', -1)\n\n state.parentType = oldParentType\n\n return true\n}\n","import Ruler from './ruler.ts'\nimport StateBlock from './rules_block/state_block.ts'\nimport type Token from './token.ts'\nimport type MarkdownIt from './markdownit.ts'\nimport type { Env } from './types.ts'\n\nimport r_table from './rules_block/table.ts'\nimport r_code from './rules_block/code.ts'\nimport r_fence from './rules_block/fence.ts'\nimport r_blockquote from './rules_block/blockquote.ts'\nimport r_hr from './rules_block/hr.ts'\nimport r_list from './rules_block/list.ts'\nimport r_reference from './rules_block/reference.ts'\nimport r_html_block from './rules_block/html_block.ts'\nimport r_heading from './rules_block/heading.ts'\nimport r_lheading from './rules_block/lheading.ts'\nimport r_paragraph from './rules_block/paragraph.ts'\n\nconst _rules: Array<[\n name: string,\n rule: (state: StateBlock, startLine: number, endLine: number, silent: boolean) => boolean,\n alt?: string[]\n]> = [\n // First 2 params - rule name & source. Secondary array - list of rules,\n // which can be terminated by this one.\n ['table', r_table, ['paragraph', 'reference']],\n ['code', r_code],\n ['fence', r_fence, ['paragraph', 'reference', 'blockquote', 'list']],\n ['blockquote', r_blockquote, ['paragraph', 'reference', 'blockquote', 'list']],\n ['hr', r_hr, ['paragraph', 'reference', 'blockquote', 'list']],\n ['list', r_list, ['paragraph', 'reference', 'blockquote']],\n ['reference', r_reference],\n ['html_block', r_html_block, ['paragraph', 'reference', 'blockquote']],\n ['heading', r_heading, ['paragraph', 'reference', 'blockquote']],\n ['lheading', r_lheading],\n ['paragraph', r_paragraph]\n]\n\n/**\n * Block-level tokenizer.\n */\nclass ParserBlock {\n /**\n * {@link Ruler} instance. Keep configuration of block rules.\n */\n ruler = new Ruler<[StateBlock, number, number, boolean], boolean>()\n\n State = StateBlock\n\n constructor () {\n for (let i = 0; i < _rules.length; i++) {\n this.ruler.push(_rules[i][0], _rules[i][1], { alt: (_rules[i][2] || []).slice() })\n }\n }\n\n // Generate tokens for input range\n //\n tokenize (state: StateBlock, startLine: number, endLine: number): void {\n const rules = this.ruler.getRules('')\n const len = rules.length\n const maxNesting = state.md.options.maxNesting\n let line = startLine\n let hasEmptyLines = false\n\n while (line < endLine) {\n state.line = line = state.skipEmptyLines(line)\n if (line >= endLine) { break }\n\n // Termination condition for nested calls.\n // Nested calls currently used for blockquotes & lists\n if (state.sCount[line] < state.blkIndent) { break }\n\n // If nesting level exceeded - skip tail to the end. That's not ordinary\n // situation and we should not care about content.\n if (state.level >= maxNesting) {\n state.line = endLine\n break\n }\n\n // Try all possible rules.\n // On success, rule should:\n //\n // - update `state.line`\n // - update `state.tokens`\n // - return true\n const prevLine = state.line\n let ok = false\n\n for (let i = 0; i < len; i++) {\n ok = rules[i](state, line, endLine, false)\n if (ok) {\n if (prevLine >= state.line) {\n throw new Error(\"block rule didn't increment state.line\")\n }\n break\n }\n }\n\n // this can only happen if user disables paragraph rule\n if (!ok) throw new Error('none of the block rules matched')\n\n // set state.tight if we had an empty line before current tag\n // i.e. latest empty line should not count\n state.tight = !hasEmptyLines\n\n // paragraph might \"eat\" one newline after it in nested lists\n if (state.isEmpty(state.line - 1)) {\n hasEmptyLines = true\n }\n\n line = state.line\n\n if (line < endLine && state.isEmpty(line)) {\n hasEmptyLines = true\n line++\n state.line = line\n }\n }\n }\n\n /**\n * Process input string and push block tokens into `outTokens`\n */\n parse (src: string, md: MarkdownIt, env: Env, outTokens: Token[]): void {\n if (!src) { return }\n\n const state = new this.State(src, md, env, outTokens)\n\n this.tokenize(state, state.line, state.lineMax)\n }\n}\n\nexport default ParserBlock\n","import Token from '../token.ts'\nimport { isWhiteSpace, isPunctCharCode, isMdAsciiPunct } from '../common/utils.ts'\nimport type MarkdownIt from '../markdownit.ts'\nimport type { Delimiter, Env } from '../types.ts'\n\n/** @inline */\ninterface ScannedDelimiters {\n can_open: boolean\n can_close: boolean\n length: number\n}\n\n/** @inline */\ntype StateTokenMeta = Record<string, unknown> & {\n delimiters?: Delimiter[]\n}\n\n/** Mutable state passed to inline rules while tokenizing inline content. */\nclass StateInline {\n declare src: string\n declare env: Env\n declare md: MarkdownIt\n declare tokens: Token[]\n declare tokens_meta: Array<StateTokenMeta | undefined>\n\n pos = 0\n declare posMax: number\n level = 0\n pending = ''\n pendingLevel = 0\n\n // Stores { start: end } pairs. Useful for backtrack\n // optimization of pairs parse (emphasis, strikes).\n cache: Record<number, number> = {}\n\n // backtick run length => position of its last run, built lazily on first use\n backticks: Record<number, number> = {}\n backticksScanned = false\n\n // Set when html comment / PI / declaration / CDATA has no terminator,\n // to skip further scans of these constructs\n skipHtmlSpecial = false\n\n // Counter used to disable inline linkify-it execution\n // inside <a> and markdown links\n linkLevel = 0\n\n // List of emphasis-like delimiters for current tag\n delimiters: Delimiter[] = []\n\n // Stack of delimiter lists for upper level tags\n _prev_delimiters: Delimiter[][] = []\n\n // re-export Token class to use in block rules\n Token = Token\n\n constructor (src: string, md: MarkdownIt, env: Env, outTokens: Token[]) {\n this.src = src\n this.env = env\n this.md = md\n this.tokens = outTokens\n this.tokens_meta = Array(outTokens.length)\n\n this.posMax = this.src.length\n }\n\n // Flush pending text\n //\n pushPending (): Token {\n const token = new Token('text', '', 0)\n token.content = this.pending\n token.level = this.pendingLevel\n this.tokens.push(token)\n this.pending = ''\n return token\n }\n\n // Push new token to \"stream\".\n // If pending text exists - flush it as text token\n //\n push (type: string, tag: string, nesting: -1 | 0 | 1): Token {\n if (this.pending) {\n this.pushPending()\n }\n\n const token = new Token(type, tag, nesting)\n let token_meta = undefined\n\n if (nesting < 0) {\n // closing tag\n this.level--\n this.delimiters = this._prev_delimiters.pop()!\n }\n\n token.level = this.level\n\n if (nesting > 0) {\n // opening tag\n this.level++\n this._prev_delimiters.push(this.delimiters)\n this.delimiters = []\n token_meta = { delimiters: this.delimiters }\n }\n\n this.pendingLevel = this.level\n this.tokens.push(token)\n this.tokens_meta.push(token_meta)\n return token\n }\n\n // Scan a sequence of emphasis-like markers, and determine whether\n // it can start an emphasis sequence or end an emphasis sequence.\n //\n // - start - position to scan from (it should point at a valid marker);\n // - canSplitWord - determine if these markers can be found inside a word\n //\n scanDelims (start: number, canSplitWord: boolean): ScannedDelimiters {\n const max = this.posMax\n const marker = this.src.charCodeAt(start)\n\n // Astral characters below are combined manually, because .codePointAt()\n // does not guarantee numeric type output. And we don't wish JIT cache issues.\n // The broken surrogate pairs are evaluated as U+FFFD to prevent possible\n // crashes.\n\n let lastChar\n if (start === 0) {\n // treat beginning of the line as a whitespace\n lastChar = 0x20\n } else if (start === 1) {\n lastChar = this.src.charCodeAt(0)\n if ((lastChar & 0xF800) === 0xD800) { lastChar = 0xFFFD }\n } else {\n lastChar = this.src.charCodeAt(start - 1)\n if ((lastChar & 0xFC00) === 0xDC00) {\n // low surrogate => add high one, replace broken pair with U+FFFD\n const highSurr = this.src.charCodeAt(start - 2)\n lastChar = (highSurr & 0xFC00) === 0xD800\n ? 0x10000 + ((highSurr - 0xD800) << 10) + (lastChar - 0xDC00)\n : 0xFFFD\n } else if ((lastChar & 0xFC00) === 0xD800) {\n lastChar = 0xFFFD\n }\n }\n\n let pos = start\n while (pos < max && this.src.charCodeAt(pos) === marker) { pos++ }\n\n const count = pos - start\n\n // treat end of the line as a whitespace\n let nextChar = pos < max ? this.src.charCodeAt(pos) : 0x20\n if ((nextChar & 0xFC00) === 0xD800) {\n // high surrogate => add low one, replace broken pair with U+FFFD\n const lowSurr = this.src.charCodeAt(pos + 1)\n nextChar = (lowSurr & 0xFC00) === 0xDC00\n ? 0x10000 + ((nextChar - 0xD800) << 10) + (lowSurr - 0xDC00)\n : 0xFFFD\n } else if ((nextChar & 0xFC00) === 0xDC00) {\n nextChar = 0xFFFD\n }\n\n const isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctCharCode(lastChar)\n const isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctCharCode(nextChar)\n\n const isLastWhiteSpace = isWhiteSpace(lastChar)\n const isNextWhiteSpace = isWhiteSpace(nextChar)\n\n const left_flanking =\n !isNextWhiteSpace && (!isNextPunctChar || isLastWhiteSpace || isLastPunctChar)\n const right_flanking =\n !isLastWhiteSpace && (!isLastPunctChar || isNextWhiteSpace || isNextPunctChar)\n\n const can_open = left_flanking && (canSplitWord || !right_flanking || isLastPunctChar)\n const can_close = right_flanking && (canSplitWord || !left_flanking || isNextPunctChar)\n\n return { can_open, can_close, length: count }\n }\n}\n\nexport default StateInline\n","// Skip text characters for text token, place those to pending buffer\n// and increment current pos\n\nimport type StateInline from './state_inline.ts'\n\n// Rule to skip pure text\n// '{}$%@~+=:' reserved for extentions\n\n// !, \", #, $, %, &, ', (, ), *, +, ,, -, ., /, :, ;, <, =, >, ?, @, [, \\, ], ^, _, `, {, |, }, or ~\n\n// !!!! Don't confuse with \"Markdown ASCII Punctuation\" chars\n// http://spec.commonmark.org/0.15/#ascii-punctuation-character\nfunction isTerminatorChar (ch: number) {\n switch (ch) {\n case 0x0A/* \\n */:\n case 0x21/* ! */:\n case 0x23/* # */:\n case 0x24/* $ */:\n case 0x25/* % */:\n case 0x26/* & */:\n case 0x2A/* * */:\n case 0x2B/* + */:\n case 0x2D/* - */:\n case 0x3A/* : */:\n case 0x3C/* < */:\n case 0x3D/* = */:\n case 0x3E/* > */:\n case 0x40/* @ */:\n case 0x5B/* [ */:\n case 0x5C/* \\ */:\n case 0x5D/* ] */:\n case 0x5E/* ^ */:\n case 0x5F/* _ */:\n case 0x60/* ` */:\n case 0x7B/* { */:\n case 0x7D/* } */:\n case 0x7E/* ~ */:\n return true\n default:\n return false\n }\n}\n\nexport default function text (state: StateInline, silent: boolean): boolean {\n let pos = state.pos\n\n while (pos < state.posMax && !isTerminatorChar(state.src.charCodeAt(pos))) {\n pos++\n }\n\n if (pos === state.pos) { return false }\n\n if (!silent) { state.pending += state.src.slice(state.pos, pos) }\n\n state.pos = pos\n\n return true\n}\n\n// Alternative implementation, for memory.\n//\n// It costs 10% of performance, but allows extend terminators list, if place it\n// to `ParserInline` property. Probably, will switch to it sometime, such\n// flexibility required.\n\n/*\nvar TERMINATOR_RE = /[\\n!#$%&*+\\-:<=>@[\\\\\\]^_`{}~]/;\n\nmodule.exports = function text(state, silent) {\n var pos = state.pos,\n idx = state.src.slice(pos).search(TERMINATOR_RE);\n\n // first char is terminator -> empty text\n if (idx === 0) { return false; }\n\n // no terminator -> text till end of string\n if (idx < 0) {\n if (!silent) { state.pending += state.src.slice(pos); }\n state.pos = state.src.length;\n return true;\n }\n\n if (!silent) { state.pending += state.src.slice(pos, pos + idx); }\n\n state.pos += idx;\n\n return true;\n}; */\n","// Early process links like https://example.org/ to have priority\n// over emphasis, etc.\n\nimport type StateInline from './state_inline.ts'\n\n// RFC3986: scheme = ALPHA *( ALPHA / DIGIT / \"+\" / \"-\" / \".\" )\nfunction isAsciiAlpha (code: number): boolean {\n return (code >= 0x41 && code <= 0x5A) || (code >= 0x61 && code <= 0x7A)\n}\n\nfunction isSchemeChar (code: number): boolean {\n return (code >= 0x41 && code <= 0x5A) ||\n (code >= 0x61 && code <= 0x7A) ||\n (code >= 0x30 && code <= 0x39) ||\n code === 0x2B || code === 0x2D || code === 0x2E\n}\n\nexport default function linkify (state: StateInline, silent: boolean): boolean {\n if (!state.md.options.linkify) return false\n if (state.linkLevel > 0) return false\n\n const pos = state.pos\n const max = state.posMax\n\n if (pos + 3 > max) return false\n if (state.src.charCodeAt(pos) !== 0x3A/* : */) return false\n if (state.src.charCodeAt(pos + 1) !== 0x2F/* / */) return false\n if (state.src.charCodeAt(pos + 2) !== 0x2F/* / */) return false\n\n // Search backwards for the scheme, but no more than 10 characters, the length\n // of the pending string, or the length of the source prefix.\n // Use state.src instead of state.pending because it is faster to access.\n const protoMin = pos - Math.min(10, state.pending.length, pos)\n let protoStart = pos\n while (protoStart > protoMin && isSchemeChar(state.src.charCodeAt(protoStart - 1))) {\n protoStart--\n }\n\n if (protoStart === pos || !isAsciiAlpha(state.src.charCodeAt(protoStart))) return false\n\n const protoLength = pos - protoStart\n\n const link = state.md.linkify.matchAtStart(state.src.slice(protoStart))\n if (!link) return false\n\n let url = link.url\n\n // invalid link, but still detected by linkify somehow;\n // need to check to prevent infinite loop below\n if (url.length <= protoLength) return false\n\n // disallow '*' at the end of the link (conflicts with emphasis)\n // do manual backsearch to avoid perf issues with regex /\\*+$/ on \"****...****a\".\n let urlEnd = url.length\n while (urlEnd > 0 && url.charCodeAt(urlEnd - 1) === 0x2A/* * */) {\n urlEnd--\n }\n if (urlEnd !== url.length) {\n url = url.slice(0, urlEnd)\n }\n\n const fullUrl = state.md.normalizeLink(url)\n if (!state.md.validateLink(fullUrl)) return false\n\n if (!silent) {\n state.pending = state.pending.slice(0, -protoLength)\n\n const token_o = state.push('link_open', 'a', 1)\n token_o.attrs = [['href', fullUrl]]\n token_o.markup = 'linkify'\n token_o.info = 'auto'\n\n const token_t = state.push('text', '', 0)\n token_t.content = state.md.normalizeLinkText(url)\n\n const token_c = state.push('link_close', 'a', -1)\n token_c.markup = 'linkify'\n token_c.info = 'auto'\n }\n\n state.pos += url.length - protoLength\n return true\n}\n","// Proceess '\\n'\n\nimport { isSpace } from '../common/utils.ts'\nimport type StateInline from './state_inline.ts'\n\nexport default function newline (state: StateInline, silent: boolean): boolean {\n let pos = state.pos\n\n if (state.src.charCodeAt(pos) !== 0x0A/* \\n */) { return false }\n\n const pmax = state.pending.length - 1\n const max = state.posMax\n\n // ' \\n' -> hardbreak\n // Lookup in pending chars is bad practice! Don't copy to other rules!\n // Pending string is stored in concat mode, indexed lookups will cause\n // convertion to flat mode.\n if (!silent) {\n if (pmax >= 0 && state.pending.charCodeAt(pmax) === 0x20) {\n if (pmax >= 1 && state.pending.charCodeAt(pmax - 1) === 0x20) {\n // Find whitespaces tail of pending chars.\n let ws = pmax - 1\n while (ws >= 1 && state.pending.charCodeAt(ws - 1) === 0x20) ws--\n\n state.pending = state.pending.slice(0, ws)\n state.push('hardbreak', 'br', 0)\n } else {\n state.pending = state.pending.slice(0, -1)\n state.push('softbreak', 'br', 0)\n }\n } else {\n state.push('softbreak', 'br', 0)\n }\n }\n\n pos++\n\n // skip heading spaces for next line\n while (pos < max && isSpace(state.src.charCodeAt(pos))) { pos++ }\n\n state.pos = pos\n return true\n}\n","// Process escaped chars and hardbreaks\n\nimport { isSpace } from '../common/utils.ts'\nimport type StateInline from './state_inline.ts'\n\nconst ESCAPED: number[] = []\n\nfor (let i = 0; i < 256; i++) { ESCAPED.push(0) }\n\n'\\\\!\"#$%&\\'()*+,./:;<=>?@[]^_`{|}~-'\n .split('').forEach(function (ch) { ESCAPED[ch.charCodeAt(0)] = 1 })\n\nexport default function escape (state: StateInline, silent: boolean): boolean {\n let pos = state.pos\n const max = state.posMax\n\n if (state.src.charCodeAt(pos) !== 0x5C/* \\ */) return false\n pos++\n\n // '\\' at the end of the inline block\n if (pos >= max) return false\n\n let ch1 = state.src.charCodeAt(pos)\n\n if (ch1 === 0x0A) {\n if (!silent) {\n state.push('hardbreak', 'br', 0)\n }\n\n pos++\n // skip leading whitespaces from next line\n while (pos < max) {\n ch1 = state.src.charCodeAt(pos)\n if (!isSpace(ch1)) break\n pos++\n }\n\n state.pos = pos\n return true\n }\n\n // '\\' before a space is a literal backslash. Don't consume the space, so a\n // trailing two-space hard line break is still detected by the newline rule.\n if (ch1 === 0x20) {\n if (!silent) {\n const token = state.push('text_special', '', 0)\n token.content = '\\\\'\n token.markup = '\\\\'\n token.info = 'escape'\n }\n\n state.pos = pos\n return true\n }\n\n let escapedStr = state.src[pos]\n\n if (ch1 >= 0xD800 && ch1 <= 0xDBFF && pos + 1 < max) {\n const ch2 = state.src.charCodeAt(pos + 1)\n\n if (ch2 >= 0xDC00 && ch2 <= 0xDFFF) {\n escapedStr += state.src[pos + 1]\n pos++\n }\n }\n\n const origStr = '\\\\' + escapedStr\n\n if (!silent) {\n const token = state.push('text_special', '', 0)\n\n if (ch1 < 256 && ESCAPED[ch1] !== 0) {\n token.content = escapedStr\n } else {\n token.content = origStr\n }\n\n token.markup = origStr\n token.info = 'escape'\n }\n\n state.pos = pos + 1\n return true\n}\n","// Parse backticks\n\nimport type StateInline from './state_inline.ts'\n\n// Position of the last backtick run of each length. Derived from the string in\n// one pass, so unlike an incremental cache it never depends on how the parser\n// walks it, and stays valid across lookaheads and narrowed ranges.\nfunction buildLastRuns (src: string): Record<number, number> {\n const lastRuns: Record<number, number> = {}\n let pos = 0\n\n while ((pos = src.indexOf('`', pos)) !== -1) {\n const start = pos\n while (src.charCodeAt(++pos) === 0x60/* ` */) { /* scan run length */ }\n lastRuns[pos - start] = start\n }\n\n return lastRuns\n}\n\nexport default function backtick (state: StateInline, silent: boolean): boolean {\n const start = state.pos\n\n if (state.src.charCodeAt(start) !== 0x60/* ` */) { return false }\n\n const max = state.posMax\n let pos = start + 1\n\n // scan marker length\n while (pos < max && state.src.charCodeAt(pos) === 0x60/* ` */) { pos++ }\n\n const marker = state.src.slice(start, pos)\n const openerLength = marker.length\n\n if (!state.backticksScanned) {\n state.backticks = buildLastRuns(state.src)\n state.backticksScanned = true\n }\n\n // Nothing of the same length left in the string, so no closer can exist\n if ((state.backticks[openerLength] ?? -1) >= pos) {\n let matchEnd = pos\n let matchStart\n\n while ((matchStart = state.src.indexOf('`', matchEnd)) !== -1 && matchStart < max) {\n // Measure the whole run, not just its part inside the current range,\n // otherwise a run straddling `max` would be mistaken for a shorter one\n matchEnd = matchStart + 1\n while (state.src.charCodeAt(matchEnd) === 0x60/* ` */) { matchEnd++ }\n\n if (matchEnd > max) break\n\n if (matchEnd - matchStart === openerLength) {\n if (!silent) {\n const token = state.push('code_inline', 'code', 0)\n token.markup = marker\n let content = state.src.slice(pos, matchStart).replace(/\\n/g, ' ')\n\n // Strip one space from each side, unless the content is all spaces\n if (content.startsWith(' ') && content.endsWith(' ') && /[^ ]/.test(content)) {\n content = content.slice(1, -1)\n }\n\n token.content = content\n }\n state.pos = matchEnd\n return true\n }\n }\n }\n\n if (!silent) state.pending += marker\n state.pos = pos\n return true\n}\n","// ~~strike through~~\n//\n\nimport type { Delimiter } from '../types.ts'\nimport type StateInline from './state_inline.ts'\n\n// Insert each marker as a separate text token, and add it to delimiter list\n//\nfunction strikethrough_tokenize (state: StateInline, silent: boolean): boolean {\n const start = state.pos\n const marker = state.src.charCodeAt(start)\n\n if (silent) { return false }\n\n if (marker !== 0x7E/* ~ */) { return false }\n\n const scanned = state.scanDelims(state.pos, true)\n let len = scanned.length\n const ch = String.fromCharCode(marker)\n\n if (len < 2) { return false }\n\n let token\n\n if (len % 2) {\n token = state.push('text', '', 0)\n token.content = ch\n len--\n }\n\n for (let i = 0; i < len; i += 2) {\n token = state.push('text', '', 0)\n token.content = ch + ch\n\n state.delimiters.push({\n marker,\n length: 0, // disable \"rule of 3\" length checks meant for emphasis\n token: state.tokens.length - 1,\n end: -1,\n open: scanned.can_open,\n close: scanned.can_close\n })\n }\n\n state.pos += scanned.length\n\n return true\n}\n\nfunction postProcess (state: StateInline, delimiters: Delimiter[]) {\n let token\n const loneMarkers = []\n const max = delimiters.length\n\n for (let i = 0; i < max; i++) {\n const startDelim = delimiters[i]\n\n if (startDelim.marker !== 0x7E/* ~ */) {\n continue\n }\n\n if (startDelim.end === -1) {\n continue\n }\n\n const endDelim = delimiters[startDelim.end]\n\n token = state.tokens[startDelim.token]\n token.type = 's_open'\n token.tag = 's'\n token.nesting = 1\n token.markup = '~~'\n token.content = ''\n\n token = state.tokens[endDelim.token]\n token.type = 's_close'\n token.tag = 's'\n token.nesting = -1\n token.markup = '~~'\n token.content = ''\n\n if (state.tokens[endDelim.token - 1].type === 'text' &&\n state.tokens[endDelim.token - 1].content === '~') {\n loneMarkers.push(endDelim.token - 1)\n }\n }\n\n // If a marker sequence has an odd number of characters, it's splitted\n // like this: `~~~~~` -> `~` + `~~` + `~~`, leaving one marker at the\n // start of the sequence.\n //\n // So, we have to move all those markers after subsequent s_close tags.\n //\n while (loneMarkers.length) {\n const i = loneMarkers.pop()!\n let j = i + 1\n\n while (j < state.tokens.length && state.tokens[j].type === 's_close') {\n j++\n }\n\n j--\n\n if (i !== j) {\n token = state.tokens[j]\n state.tokens[j] = state.tokens[i]\n state.tokens[i] = token\n }\n }\n}\n\n// Walk through delimiter list and replace text tokens with tags\n//\nfunction strikethrough_postProcess (state: StateInline): void {\n const tokens_meta = state.tokens_meta\n const max = state.tokens_meta.length\n\n postProcess(state, state.delimiters)\n\n for (let curr = 0; curr < max; curr++) {\n const delimiters = tokens_meta[curr]?.delimiters\n if (delimiters) {\n postProcess(state, delimiters)\n }\n }\n}\n\nexport default {\n tokenize: strikethrough_tokenize,\n postProcess: strikethrough_postProcess\n}\n","// Process *this* and _that_\n//\n\nimport type { Delimiter } from '../types.ts'\nimport type StateInline from './state_inline.ts'\n\n// Insert each marker as a separate text token, and add it to delimiter list\n//\nfunction emphasis_tokenize (state: StateInline, silent: boolean): boolean {\n const start = state.pos\n const marker = state.src.charCodeAt(start)\n\n if (silent) { return false }\n\n if (marker !== 0x5F /* _ */ && marker !== 0x2A /* * */) { return false }\n\n const scanned = state.scanDelims(state.pos, marker === 0x2A)\n\n for (let i = 0; i < scanned.length; i++) {\n const token = state.push('text', '', 0)\n token.content = String.fromCharCode(marker)\n\n state.delimiters.push({\n // Char code of the starting marker (number).\n //\n marker,\n\n // Total length of these series of delimiters.\n //\n length: scanned.length,\n\n // A position of the token this delimiter corresponds to.\n //\n token: state.tokens.length - 1,\n\n // If this delimiter is matched as a valid opener, `end` will be\n // equal to its position, otherwise it's `-1`.\n //\n end: -1,\n\n // Boolean flags that determine if this delimiter could open or close\n // an emphasis.\n //\n open: scanned.can_open,\n close: scanned.can_close\n })\n }\n\n state.pos += scanned.length\n\n return true\n}\n\nfunction postProcess (state: StateInline, delimiters: Delimiter[]) {\n const max = delimiters.length\n\n for (let i = max - 1; i >= 0; i--) {\n const startDelim = delimiters[i]\n\n if (startDelim.marker !== 0x5F/* _ */ && startDelim.marker !== 0x2A/* * */) {\n continue\n }\n\n // Process only opening markers\n if (startDelim.end === -1) {\n continue\n }\n\n const endDelim = delimiters[startDelim.end]\n\n // If the previous delimiter has the same marker and is adjacent to this one,\n // merge those into one strong delimiter.\n //\n // `<em><em>whatever</em></em>` -> `<strong>whatever</strong>`\n //\n const isStrong = i > 0 &&\n delimiters[i - 1].end === startDelim.end + 1 &&\n // check that first two markers match and adjacent\n delimiters[i - 1].marker === startDelim.marker &&\n delimiters[i - 1].token === startDelim.token - 1 &&\n // check that last two markers are adjacent (we can safely assume they match)\n delimiters[startDelim.end + 1].token === endDelim.token + 1\n\n const ch = String.fromCharCode(startDelim.marker)\n\n const token_o = state.tokens[startDelim.token]\n token_o.type = isStrong ? 'strong_open' : 'em_open'\n token_o.tag = isStrong ? 'strong' : 'em'\n token_o.nesting = 1\n token_o.markup = isStrong ? ch + ch : ch\n token_o.content = ''\n\n const token_c = state.tokens[endDelim.token]\n token_c.type = isStrong ? 'strong_close' : 'em_close'\n token_c.tag = isStrong ? 'strong' : 'em'\n token_c.nesting = -1\n token_c.markup = isStrong ? ch + ch : ch\n token_c.content = ''\n\n if (isStrong) {\n state.tokens[delimiters[i - 1].token].content = ''\n state.tokens[delimiters[startDelim.end + 1].token].content = ''\n i--\n }\n }\n}\n\n// Walk through delimiter list and replace text tokens with tags\n//\nfunction emphasis_post_process (state: StateInline): void {\n const tokens_meta = state.tokens_meta\n const max = state.tokens_meta.length\n\n postProcess(state, state.delimiters)\n\n for (let curr = 0; curr < max; curr++) {\n const delimiters = tokens_meta[curr]?.delimiters\n if (delimiters) {\n postProcess(state, delimiters)\n }\n }\n}\n\nexport default {\n tokenize: emphasis_tokenize,\n postProcess: emphasis_post_process\n}\n","// Process [link](<to> \"stuff\")\n\nimport { normalizeReference, isSpace } from '../common/utils.ts'\nimport type StateInline from './state_inline.ts'\n\nexport default function link (state: StateInline, silent: boolean): boolean {\n let code, label, res, ref\n let href = ''\n let title = ''\n let start = state.pos\n let parseReference = true\n\n if (state.src.charCodeAt(state.pos) !== 0x5B/* [ */) { return false }\n\n const oldPos = state.pos\n const max = state.posMax\n const labelStart = state.pos + 1\n const labelEnd = state.md.helpers.parseLinkLabel(state, state.pos, true)\n\n // parser failed to find ']', so it's not a valid link\n if (labelEnd < 0) { return false }\n\n let pos = labelEnd + 1\n if (pos < max && state.src.charCodeAt(pos) === 0x28/* ( */) {\n //\n // Inline link\n //\n\n // might have found a valid shortcut link, disable reference parsing\n parseReference = false\n\n // [link]( <href> \"title\" )\n // ^^ skipping these spaces\n pos++\n for (; pos < max; pos++) {\n code = state.src.charCodeAt(pos)\n if (!isSpace(code) && code !== 0x0A) { break }\n }\n if (pos >= max) { return false }\n\n // [link]( <href> \"title\" )\n // ^^^^^^ parsing link destination\n start = pos\n res = state.md.helpers.parseLinkDestination(state.src, pos, state.posMax)\n if (res.ok) {\n href = state.md.normalizeLink(res.str)\n if (state.md.validateLink(href)) {\n pos = res.pos\n } else {\n href = ''\n }\n\n // [link]( <href> \"title\" )\n // ^^ skipping these spaces\n start = pos\n for (; pos < max; pos++) {\n code = state.src.charCodeAt(pos)\n if (!isSpace(code) && code !== 0x0A) { break }\n }\n\n // [link]( <href> \"title\" )\n // ^^^^^^^ parsing link title\n res = state.md.helpers.parseLinkTitle(state.src, pos, state.posMax)\n if (pos < max && start !== pos && res.ok) {\n title = res.str\n pos = res.pos\n\n // [link]( <href> \"title\" )\n // ^^ skipping these spaces\n for (; pos < max; pos++) {\n code = state.src.charCodeAt(pos)\n if (!isSpace(code) && code !== 0x0A) { break }\n }\n }\n }\n\n if (pos >= max || state.src.charCodeAt(pos) !== 0x29/* ) */) {\n // parsing a valid shortcut link failed, fallback to reference\n parseReference = true\n }\n pos++\n }\n\n if (parseReference) {\n //\n // Link reference\n //\n if (typeof state.env.references === 'undefined') { return false }\n\n if (pos < max && state.src.charCodeAt(pos) === 0x5B/* [ */) {\n start = pos + 1\n pos = state.md.helpers.parseLinkLabel(state, pos)\n if (pos >= 0) {\n label = state.src.slice(start, pos++)\n } else {\n pos = labelEnd + 1\n }\n } else {\n pos = labelEnd + 1\n }\n\n // covers label === '' and label === undefined\n // (collapsed reference link and shortcut reference link respectively)\n if (!label) { label = state.src.slice(labelStart, labelEnd) }\n\n label = normalizeReference(label)\n ref = state.env.references[label]\n if (!ref) {\n state.pos = oldPos\n return false\n }\n href = ref.href\n title = ref.title\n }\n\n //\n // We found the end of the link, and know for a fact it's a valid link;\n // so all that's left to do is to call tokenizer.\n //\n if (!silent) {\n state.pos = labelStart\n state.posMax = labelEnd\n\n const token_o = state.push('link_open', 'a', 1)\n const attrs: Array<[string, string]> = [['href', href]]\n token_o.attrs = attrs\n if (title) {\n attrs.push(['title', title])\n }\n if (label) {\n const meta: Record<string, unknown> = Object.create(null)\n meta.label = label\n token_o.meta = meta\n }\n\n state.linkLevel++\n state.md.inline.tokenize(state)\n state.linkLevel--\n\n state.push('link_close', 'a', -1)\n }\n\n state.pos = pos\n state.posMax = max\n return true\n}\n","// Process ![image](<src> \"title\")\n\nimport { normalizeReference, isSpace } from '../common/utils.ts'\nimport type Token from '../token.ts'\nimport type StateInline from './state_inline.ts'\n\nexport default function image (state: StateInline, silent: boolean): boolean {\n let code, content, label, pos, ref, res, title, start\n let href = ''\n const oldPos = state.pos\n const max = state.posMax\n\n if (state.src.charCodeAt(state.pos) !== 0x21/* ! */) { return false }\n if (state.src.charCodeAt(state.pos + 1) !== 0x5B/* [ */) { return false }\n\n const labelStart = state.pos + 2\n const labelEnd = state.md.helpers.parseLinkLabel(state, state.pos + 1, false)\n\n // parser failed to find ']', so it's not a valid link\n if (labelEnd < 0) { return false }\n\n pos = labelEnd + 1\n if (pos < max && state.src.charCodeAt(pos) === 0x28/* ( */) {\n //\n // Inline link\n //\n\n // [link]( <href> \"title\" )\n // ^^ skipping these spaces\n pos++\n for (; pos < max; pos++) {\n code = state.src.charCodeAt(pos)\n if (!isSpace(code) && code !== 0x0A) { break }\n }\n if (pos >= max) { return false }\n\n // [link]( <href> \"title\" )\n // ^^^^^^ parsing link destination\n start = pos\n res = state.md.helpers.parseLinkDestination(state.src, pos, state.posMax)\n if (res.ok) {\n href = state.md.normalizeLink(res.str)\n if (state.md.validateLink(href)) {\n pos = res.pos\n } else {\n href = ''\n }\n }\n\n // [link]( <href> \"title\" )\n // ^^ skipping these spaces\n start = pos\n for (; pos < max; pos++) {\n code = state.src.charCodeAt(pos)\n if (!isSpace(code) && code !== 0x0A) { break }\n }\n\n // [link]( <href> \"title\" )\n // ^^^^^^^ parsing link title\n res = state.md.helpers.parseLinkTitle(state.src, pos, state.posMax)\n if (pos < max && start !== pos && res.ok) {\n title = res.str\n pos = res.pos\n\n // [link]( <href> \"title\" )\n // ^^ skipping these spaces\n for (; pos < max; pos++) {\n code = state.src.charCodeAt(pos)\n if (!isSpace(code) && code !== 0x0A) { break }\n }\n } else {\n title = ''\n }\n\n if (pos >= max || state.src.charCodeAt(pos) !== 0x29/* ) */) {\n state.pos = oldPos\n return false\n }\n pos++\n } else {\n //\n // Link reference\n //\n if (typeof state.env.references === 'undefined') { return false }\n\n if (pos < max && state.src.charCodeAt(pos) === 0x5B/* [ */) {\n start = pos + 1\n pos = state.md.helpers.parseLinkLabel(state, pos)\n if (pos >= 0) {\n label = state.src.slice(start, pos++)\n } else {\n pos = labelEnd + 1\n }\n } else {\n pos = labelEnd + 1\n }\n\n // covers label === '' and label === undefined\n // (collapsed reference link and shortcut reference link respectively)\n if (!label) { label = state.src.slice(labelStart, labelEnd) }\n\n label = normalizeReference(label)\n ref = state.env.references[label]\n if (!ref) {\n state.pos = oldPos\n return false\n }\n href = ref.href\n title = ref.title\n }\n\n //\n // We found the end of the link, and know for a fact it's a valid link;\n // so all that's left to do is to call tokenizer.\n //\n if (!silent) {\n content = state.src.slice(labelStart, labelEnd)\n\n const tokens: Token[] = []\n state.md.inline.parse(\n content,\n state.md,\n state.env,\n tokens\n )\n\n const token = state.push('image', 'img', 0)\n const attrs: Array<[string, string]> = [['src', href], ['alt', '']]\n token.attrs = attrs\n token.children = tokens\n token.content = content\n\n if (title) {\n attrs.push(['title', title])\n }\n if (label) {\n const meta: Record<string, unknown> = Object.create(null)\n meta.label = label\n token.meta = meta\n }\n }\n\n state.pos = pos\n state.posMax = max\n return true\n}\n","// Process autolinks '<protocol:...>'\n\nimport type StateInline from './state_inline.ts'\n\n/* eslint max-len:0 */\nconst EMAIL_RE = /^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/\n/* eslint-disable-next-line no-control-regex */\nconst AUTOLINK_RE = /^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\\x00-\\x20]*)$/\n\nexport default function autolink (state: StateInline, silent: boolean): boolean {\n let pos = state.pos\n\n if (state.src.charCodeAt(pos) !== 0x3C/* < */) { return false }\n\n const start = state.pos\n const max = state.posMax\n\n for (;;) {\n if (++pos >= max) return false\n\n const ch = state.src.charCodeAt(pos)\n\n if (ch === 0x3C /* < */) return false\n if (ch === 0x3E /* > */) break\n }\n\n const url = state.src.slice(start + 1, pos)\n\n if (AUTOLINK_RE.test(url)) {\n const fullUrl = state.md.normalizeLink(url)\n if (!state.md.validateLink(fullUrl)) { return false }\n\n if (!silent) {\n const token_o = state.push('link_open', 'a', 1)\n token_o.attrs = [['href', fullUrl]]\n token_o.markup = 'autolink'\n token_o.info = 'auto'\n\n const token_t = state.push('text', '', 0)\n token_t.content = state.md.normalizeLinkText(url)\n\n const token_c = state.push('link_close', 'a', -1)\n token_c.markup = 'autolink'\n token_c.info = 'auto'\n }\n\n state.pos += url.length + 2\n return true\n }\n\n if (EMAIL_RE.test(url)) {\n const fullUrl = state.md.normalizeLink(`mailto:${url}`)\n if (!state.md.validateLink(fullUrl)) { return false }\n\n if (!silent) {\n const token_o = state.push('link_open', 'a', 1)\n token_o.attrs = [['href', fullUrl]]\n token_o.markup = 'autolink'\n token_o.info = 'auto'\n\n const token_t = state.push('text', '', 0)\n token_t.content = state.md.normalizeLinkText(url)\n\n const token_c = state.push('link_close', 'a', -1)\n token_c.markup = 'autolink'\n token_c.info = 'auto'\n }\n\n state.pos += url.length + 2\n return true\n }\n\n return false\n}\n","// Process html tags\n\nimport { HTML_OPEN_CLOSE_TAG_RE } from '../common/html_re.ts'\nimport type StateInline from './state_inline.ts'\n\nfunction isLinkOpen (str: string) {\n return /^<a[>\\s]/i.test(str)\n}\nfunction isLinkClose (str: string) {\n return /^<\\/a\\s*>/i.test(str)\n}\n\nfunction isLetter (ch: number) {\n /* eslint no-bitwise:0 */\n const lc = ch | 0x20 // to lower case\n return (lc >= 0x61/* a */) && (lc <= 0x7a/* z */)\n}\n\n// Comment, processing instruction, declaration or CDATA: fixed opener,\n// then everything up to the first terminator. Returns end position or -1.\nfunction scanSpecial (state: StateInline, pos: number): number {\n const src = state.src\n let start: number\n let terminator: string\n\n if (src.startsWith('<!--', pos)) {\n if (src.startsWith('>', pos + 4)) { return pos + 5 }\n if (src.startsWith('->', pos + 4)) { return pos + 6 }\n start = pos + 4\n terminator = '-->'\n } else if (src.startsWith('<![CDATA[', pos)) {\n start = pos + 9\n terminator = ']]>'\n } else if (src.charCodeAt(pos + 1) === 0x3F/* ? */) {\n start = pos + 2\n terminator = '?>'\n } else if (isLetter(src.charCodeAt(pos + 2))) {\n start = pos + 3\n terminator = '>'\n } else {\n return -1\n }\n\n if (state.skipHtmlSpecial) { return -1 }\n\n const end = src.indexOf(terminator, start)\n if (end < 0) {\n // One flag for all constructs to keep code simple. Valid constructs after\n // an unclosed one in the same paragraph become text, that's acceptable.\n state.skipHtmlSpecial = true\n return -1\n }\n return end + terminator.length\n}\n\nexport default function html_inline (state: StateInline, silent: boolean): boolean {\n if (!state.md.options.html) { return false }\n\n // Check start\n const max = state.posMax\n const pos = state.pos\n if (state.src.charCodeAt(pos) !== 0x3C/* < */ ||\n pos + 2 >= max) {\n return false\n }\n\n let end: number\n const ch = state.src.charCodeAt(pos + 1)\n\n if (ch === 0x21/* ! */ || ch === 0x3F/* ? */) {\n end = scanSpecial(state, pos)\n } else if (ch === 0x2F/* / */ || isLetter(ch)) {\n const match = state.src.slice(pos).match(HTML_OPEN_CLOSE_TAG_RE)\n end = match ? pos + match[0].length : -1\n } else {\n return false\n }\n\n if (end < 0) { return false }\n\n if (!silent) {\n const token = state.push('html_inline', '', 0)\n token.content = state.src.slice(pos, end)\n\n if (isLinkOpen(token.content)) state.linkLevel++\n if (isLinkClose(token.content)) state.linkLevel--\n }\n state.pos = end\n return true\n}\n","// Process html entity - &#123;, &#xAF;, &quot;, ...\n\nimport { decodeHTMLStrict } from 'entities'\nimport { isValidEntityCode, fromCodePoint } from '../common/utils.ts'\nimport type StateInline from './state_inline.ts'\n\nconst DIGITAL_RE = /^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i\nconst NAMED_RE = /^&([a-z][a-z0-9]{1,31});/i\n\nexport default function entity (state: StateInline, silent: boolean): boolean {\n const pos = state.pos\n const max = state.posMax\n\n if (state.src.charCodeAt(pos) !== 0x26/* & */) return false\n\n if (pos + 1 >= max) return false\n\n const ch = state.src.charCodeAt(pos + 1)\n\n if (ch === 0x23 /* # */) {\n const match = state.src.slice(pos).match(DIGITAL_RE)\n if (match) {\n if (!silent) {\n const code = match[1][0].toLowerCase() === 'x' ? parseInt(match[1].slice(1), 16) : parseInt(match[1], 10)\n\n const token = state.push('text_special', '', 0)\n token.content = isValidEntityCode(code) ? fromCodePoint(code) : fromCodePoint(0xFFFD)\n token.markup = match[0]\n token.info = 'entity'\n }\n state.pos += match[0].length\n return true\n }\n } else {\n const match = state.src.slice(pos).match(NAMED_RE)\n if (match) {\n const decoded = decodeHTMLStrict(match[0])\n if (decoded !== match[0]) {\n if (!silent) {\n const token = state.push('text_special', '', 0)\n token.content = decoded\n token.markup = match[0]\n token.info = 'entity'\n }\n state.pos += match[0].length\n return true\n }\n }\n }\n\n return false\n}\n","// For each opening emphasis-like marker find a matching closing one\n//\n\nimport type { Delimiter } from '../types.ts'\nimport type StateInline from './state_inline.ts'\n\nfunction processDelimiters (delimiters: Delimiter[]) {\n const openersBottom: Record<number, number[]> = {}\n const max = delimiters.length\n\n if (!max) return\n\n // headerIdx is the first delimiter of the current (where closer is) delimiter run\n let headerIdx = 0\n let lastTokenIdx = -2 // needs any value lower than -1\n const jumps: number[] = []\n\n for (let closerIdx = 0; closerIdx < max; closerIdx++) {\n const closer = delimiters[closerIdx]\n\n jumps.push(0)\n\n // markers belong to same delimiter run if:\n // - they have adjacent tokens\n // - AND markers are the same\n //\n if (delimiters[headerIdx].marker !== closer.marker || lastTokenIdx !== closer.token - 1) {\n headerIdx = closerIdx\n }\n\n lastTokenIdx = closer.token\n\n // Length is only used for emphasis-specific \"rule of 3\",\n // if it's not defined (in strikethrough or 3rd party plugins),\n // we can default it to 0 to disable those checks.\n //\n closer.length = closer.length || 0\n\n if (!closer.close) continue\n\n // Previously calculated lower bounds (previous fails)\n // for each marker, each delimiter length modulo 3,\n // and for whether this closer can be an opener;\n // https://github.com/commonmark/cmark/commit/34250e12ccebdc6372b8b49c44fab57c72443460\n /* eslint-disable-next-line no-prototype-builtins */\n if (!openersBottom.hasOwnProperty(closer.marker)) {\n openersBottom[closer.marker] = [-1, -1, -1, -1, -1, -1]\n }\n\n const minOpenerIdx = openersBottom[closer.marker][(closer.open ? 3 : 0) + (closer.length % 3)]\n\n let openerIdx = headerIdx - jumps[headerIdx] - 1\n\n let newMinOpenerIdx = openerIdx\n\n for (; openerIdx > minOpenerIdx; openerIdx -= jumps[openerIdx] + 1) {\n const opener = delimiters[openerIdx]\n\n if (opener.marker !== closer.marker) continue\n\n if (opener.open && opener.end < 0) {\n let isOddMatch = false\n\n // from spec:\n //\n // If one of the delimiters can both open and close emphasis, then the\n // sum of the lengths of the delimiter runs containing the opening and\n // closing delimiters must not be a multiple of 3 unless both lengths\n // are multiples of 3.\n //\n if (opener.close || closer.open) {\n if ((opener.length! + closer.length) % 3 === 0) {\n if (opener.length! % 3 !== 0 || closer.length % 3 !== 0) {\n isOddMatch = true\n }\n }\n }\n\n if (!isOddMatch) {\n // If previous delimiter cannot be an opener, we can safely skip\n // the entire sequence in future checks. This is required to make\n // sure algorithm has linear complexity (see *_*_*_*_*_... case).\n //\n const lastJump = openerIdx > 0 && !delimiters[openerIdx - 1].open\n ? jumps[openerIdx - 1] + 1\n : 0\n\n jumps[closerIdx] = closerIdx - openerIdx + lastJump\n jumps[openerIdx] = lastJump\n\n closer.open = false\n opener.end = closerIdx\n opener.close = false\n newMinOpenerIdx = -1\n // treat next token as start of run,\n // it optimizes skips in **<...>**a**<...>** pathological case\n lastTokenIdx = -2\n break\n }\n }\n }\n\n if (newMinOpenerIdx !== -1) {\n // If match for this delimiter run failed, we want to set lower bound for\n // future lookups. This is required to make sure algorithm has linear\n // complexity.\n //\n // See details here:\n // https://github.com/commonmark/cmark/issues/178#issuecomment-270417442\n //\n openersBottom[closer.marker][(closer.open ? 3 : 0) + ((closer.length || 0) % 3)] = newMinOpenerIdx\n }\n }\n}\n\nexport default function link_pairs (state: StateInline): void {\n const tokens_meta = state.tokens_meta\n const max = state.tokens_meta.length\n\n processDelimiters(state.delimiters)\n\n for (let curr = 0; curr < max; curr++) {\n const delimiters = tokens_meta[curr]?.delimiters\n if (delimiters) {\n processDelimiters(delimiters)\n }\n }\n}\n","// Clean up tokens after emphasis and strikethrough postprocessing:\n// merge adjacent text nodes into one and re-calculate all token levels\n//\n// This is necessary because initially emphasis delimiter markers (*, _, ~)\n// are treated as their own separate text tokens. Then emphasis rule either\n// leaves them as text (needed to merge with adjacent text) or turns them\n// into opening/closing tags (which messes up levels inside).\n//\n\nimport type StateInline from './state_inline.ts'\n\nexport default function fragments_join (state: StateInline): void {\n let curr, last\n let level = 0\n const tokens = state.tokens\n const max = state.tokens.length\n\n for (curr = last = 0; curr < max; curr++) {\n // re-calculate levels after emphasis/strikethrough turns some text nodes\n // into opening/closing tags\n if (tokens[curr].nesting < 0) level-- // closing tag\n tokens[curr].level = level\n if (tokens[curr].nesting > 0) level++ // opening tag\n\n if (tokens[curr].type === 'text' &&\n curr + 1 < max &&\n tokens[curr + 1].type === 'text') {\n // collapse two adjacent text nodes\n tokens[curr + 1].content = tokens[curr].content + tokens[curr + 1].content\n } else {\n if (curr !== last) { tokens[last] = tokens[curr] }\n\n last++\n }\n }\n\n if (curr !== last) {\n tokens.length = last\n }\n}\n","import Ruler from './ruler.ts'\nimport StateInline from './rules_inline/state_inline.ts'\nimport type Token from './token.ts'\nimport type MarkdownIt from './markdownit.ts'\nimport type { Env } from './types.ts'\n\nimport r_text from './rules_inline/text.ts'\nimport r_linkify from './rules_inline/linkify.ts'\nimport r_newline from './rules_inline/newline.ts'\nimport r_escape from './rules_inline/escape.ts'\nimport r_backticks from './rules_inline/backticks.ts'\nimport r_strikethrough from './rules_inline/strikethrough.ts'\nimport r_emphasis from './rules_inline/emphasis.ts'\nimport r_link from './rules_inline/link.ts'\nimport r_image from './rules_inline/image.ts'\nimport r_autolink from './rules_inline/autolink.ts'\nimport r_html_inline from './rules_inline/html_inline.ts'\nimport r_entity from './rules_inline/entity.ts'\n\nimport r_balance_pairs from './rules_inline/balance_pairs.ts'\nimport r_fragments_join from './rules_inline/fragments_join.ts'\n\n// Parser rules\n\nconst _rules: Array<[\n name: string,\n rule: (state: StateInline, silent: boolean) => boolean\n]> = [\n ['text', r_text],\n ['linkify', r_linkify],\n ['newline', r_newline],\n ['escape', r_escape],\n ['backticks', r_backticks],\n ['strikethrough', r_strikethrough.tokenize],\n ['emphasis', r_emphasis.tokenize],\n ['link', r_link],\n ['image', r_image],\n ['autolink', r_autolink],\n ['html_inline', r_html_inline],\n ['entity', r_entity]\n]\n\n// `rule2` ruleset was created specifically for emphasis/strikethrough\n// post-processing and may be changed in the future.\n//\n// Don't use this for anything except pairs (plugins working with `balance_pairs`).\n//\nconst _rules2: Array<[\n name: string,\n rule: (state: StateInline) => void\n]> = [\n ['balance_pairs', r_balance_pairs],\n ['strikethrough', r_strikethrough.postProcess],\n ['emphasis', r_emphasis.postProcess],\n // rules for pairs separate '**' into its own text tokens, which may be left unused,\n // rule below merges unused segments back with the rest of the text\n ['fragments_join', r_fragments_join]\n]\n\n/**\n * Tokenizes paragraph content.\n */\nclass ParserInline {\n /**\n * {@link Ruler} instance. Keep configuration of inline rules.\n */\n ruler = new Ruler<[StateInline, boolean], boolean>()\n\n /**\n * {@link Ruler} instance. Second ruler used for post-processing\n * (e.g. in emphasis-like rules).\n */\n ruler2 = new Ruler<[StateInline], void>()\n\n State = StateInline\n\n constructor () {\n for (let i = 0; i < _rules.length; i++) {\n this.ruler.push(_rules[i][0], _rules[i][1])\n }\n\n for (let i = 0; i < _rules2.length; i++) {\n this.ruler2.push(_rules2[i][0], _rules2[i][1])\n }\n }\n\n // Skip single token by running all rules in validation mode;\n // returns `true` if any rule reported success\n //\n skipToken (state: StateInline): void {\n const pos = state.pos\n const rules = this.ruler.getRules('')\n const len = rules.length\n const maxNesting = state.md.options.maxNesting\n const cache = state.cache\n\n if (typeof cache[pos] !== 'undefined') {\n state.pos = cache[pos]\n return\n }\n\n let ok = false\n\n if (state.level < maxNesting) {\n for (let i = 0; i < len; i++) {\n // Increment state.level and decrement it later to limit recursion.\n // It's harmless to do here, because no tokens are created. But ideally,\n // we'd need a separate private state variable for this purpose.\n //\n state.level++\n ok = rules[i](state, true)\n state.level--\n\n if (ok) {\n if (pos >= state.pos) { throw new Error(\"inline rule didn't increment state.pos\") }\n break\n }\n }\n } else {\n // Too much nesting, just skip until the end of the paragraph.\n //\n // NOTE: this will cause links to behave incorrectly in the following case,\n // when an amount of `[` is exactly equal to `maxNesting + 1`:\n //\n // [[[[[[[[[[[[[[[[[[[[[foo]()\n //\n // TODO: remove this workaround when CM standard will allow nested links\n // (we can replace it by preventing links from being parsed in\n // validation mode)\n //\n state.pos = state.posMax\n }\n\n if (!ok) { state.pos++ }\n cache[pos] = state.pos\n }\n\n // Generate tokens for input range\n //\n tokenize (state: StateInline): void {\n const rules = this.ruler.getRules('')\n const len = rules.length\n const end = state.posMax\n const maxNesting = state.md.options.maxNesting\n\n while (state.pos < end) {\n // Try all possible rules.\n // On success, rule should:\n //\n // - update `state.pos`\n // - update `state.tokens`\n // - return true\n const prevPos = state.pos\n let ok = false\n\n if (state.level < maxNesting) {\n for (let i = 0; i < len; i++) {\n ok = rules[i](state, false)\n if (ok) {\n if (prevPos >= state.pos) { throw new Error(\"inline rule didn't increment state.pos\") }\n break\n }\n }\n }\n\n if (ok) {\n if (state.pos >= end) { break }\n continue\n }\n\n state.pending += state.src[state.pos++]\n }\n\n if (state.pending) {\n state.pushPending()\n }\n }\n\n /**\n * Process input string and push inline tokens into `outTokens`\n */\n parse (str: string, md: MarkdownIt, env: Env, outTokens: Token[]): void {\n const state = new this.State(str, md, env, outTokens)\n\n this.tokenize(state)\n\n const rules = this.ruler2.getRules('')\n const len = rules.length\n\n for (let i = 0; i < len; i++) {\n rules[i](state)\n }\n }\n}\n\nexport default ParserInline\n","// markdown-it default options\n\nimport type { MarkdownItOptions } from '../types.ts'\n\nconst options: Required<MarkdownItOptions> = {\n // Enable HTML tags in source\n html: false,\n\n // Use '/' to close single tags (<br />)\n xhtmlOut: false,\n\n // Convert '\\n' in paragraphs into <br>\n breaks: false,\n\n // CSS language prefix for fenced blocks\n langPrefix: 'language-',\n\n // autoconvert URL-like texts to links\n linkify: false,\n\n // Enable some language-neutral replacements + quotes beautification\n typographer: false,\n\n // Double + single quotes replacement pairs, when typographer enabled,\n // and smartquotes on. Could be either a String or an Array.\n //\n // For example, you can use '«»„“' for Russian, '„“‚‘' for German,\n // and ['«\\xA0', '\\xA0»', '‹\\xA0', '\\xA0›'] for French (including nbsp).\n quotes: '\\u201c\\u201d\\u2018\\u2019', /* “”‘’ */\n\n // Highlighter function. Should return escaped HTML,\n // or '' if the source string is not changed and should be escaped externaly.\n // If result starts with <pre... internal wrapper is skipped.\n //\n // function (/*str, lang*/) { return ''; }\n //\n highlight: null,\n\n // Internal protection, recursion limit\n maxNesting: 100\n}\n\nexport default {\n options,\n\n components: {\n core: {},\n block: {},\n inline: {}\n }\n}\n","// \"Zero\" preset, with nothing enabled. Useful for manual configuring of simple\n// modes. For example, to parse bold/italic only.\n\nimport type { MarkdownItOptions } from '../types.ts'\n\nconst options: Required<MarkdownItOptions> = {\n // Enable HTML tags in source\n html: false,\n\n // Use '/' to close single tags (<br />)\n xhtmlOut: false,\n\n // Convert '\\n' in paragraphs into <br>\n breaks: false,\n\n // CSS language prefix for fenced blocks\n langPrefix: 'language-',\n\n // autoconvert URL-like texts to links\n linkify: false,\n\n // Enable some language-neutral replacements + quotes beautification\n typographer: false,\n\n // Double + single quotes replacement pairs, when typographer enabled,\n // and smartquotes on. Could be either a String or an Array.\n //\n // For example, you can use '«»„“' for Russian, '„“‚‘' for German,\n // and ['«\\xA0', '\\xA0»', '‹\\xA0', '\\xA0›'] for French (including nbsp).\n quotes: '\\u201c\\u201d\\u2018\\u2019', /* “”‘’ */\n\n // Highlighter function. Should return escaped HTML,\n // or '' if the source string is not changed and should be escaped externaly.\n // If result starts with <pre... internal wrapper is skipped.\n //\n // function (/*str, lang*/) { return ''; }\n //\n highlight: null,\n\n // Internal protection, recursion limit\n maxNesting: 20\n}\n\nexport default {\n options,\n\n components: {\n\n core: {\n rules: [\n 'normalize',\n 'block',\n 'strip_references',\n 'inline',\n 'text_join'\n ]\n },\n\n block: {\n rules: [\n 'paragraph'\n ]\n },\n\n inline: {\n rules: [\n 'text'\n ],\n rules2: [\n 'balance_pairs',\n 'fragments_join'\n ]\n }\n }\n}\n","// Commonmark default options\n\nimport type { MarkdownItOptions } from '../types.ts'\n\nconst options: Required<MarkdownItOptions> = {\n // Enable HTML tags in source\n html: true,\n\n // Use '/' to close single tags (<br />)\n xhtmlOut: true,\n\n // Convert '\\n' in paragraphs into <br>\n breaks: false,\n\n // CSS language prefix for fenced blocks\n langPrefix: 'language-',\n\n // autoconvert URL-like texts to links\n linkify: false,\n\n // Enable some language-neutral replacements + quotes beautification\n typographer: false,\n\n // Double + single quotes replacement pairs, when typographer enabled,\n // and smartquotes on. Could be either a String or an Array.\n //\n // For example, you can use '«»„“' for Russian, '„“‚‘' for German,\n // and ['«\\xA0', '\\xA0»', '‹\\xA0', '\\xA0›'] for French (including nbsp).\n quotes: '\\u201c\\u201d\\u2018\\u2019', /* “”‘’ */\n\n // Highlighter function. Should return escaped HTML,\n // or '' if the source string is not changed and should be escaped externaly.\n // If result starts with <pre... internal wrapper is skipped.\n //\n // function (/*str, lang*/) { return ''; }\n //\n highlight: null,\n\n // Internal protection, recursion limit\n maxNesting: 20\n}\n\nexport default {\n options,\n\n components: {\n\n core: {\n rules: [\n 'normalize',\n 'block',\n 'strip_references',\n 'inline',\n 'text_join'\n ]\n },\n\n block: {\n rules: [\n 'blockquote',\n 'code',\n 'fence',\n 'heading',\n 'hr',\n 'html_block',\n 'lheading',\n 'list',\n 'reference',\n 'paragraph'\n ]\n },\n\n inline: {\n rules: [\n 'autolink',\n 'backticks',\n 'emphasis',\n 'entity',\n 'escape',\n 'html_inline',\n 'image',\n 'link',\n 'newline',\n 'text'\n ],\n rules2: [\n 'balance_pairs',\n 'emphasis',\n 'fragments_join'\n ]\n }\n }\n}\n","// Main parser class\n\nimport * as utils from './common/utils.ts'\nimport * as helpers from './helpers/index.ts'\nimport Token from './token.ts'\nimport Ruler from './ruler.ts'\nimport Renderer from './renderer.ts'\nimport ParserCore from './parser_core.ts'\nimport StateCore from './rules_core/state_core.ts'\nimport ParserBlock from './parser_block.ts'\nimport StateBlock from './rules_block/state_block.ts'\nimport ParserInline from './parser_inline.ts'\nimport StateInline from './rules_inline/state_inline.ts'\nimport { LinkifyIt } from 'linkify-it'\nimport * as mdurl from 'mdurl'\nimport punycode from 'punycode.js'\n\nimport cfg_default from './presets/default.ts'\nimport cfg_zero from './presets/zero.ts'\nimport cfg_commonmark from './presets/commonmark.ts'\nimport type { Env, MarkdownItOptions } from './types.ts'\n\nconst config = {\n default: cfg_default,\n zero: cfg_zero,\n commonmark: cfg_commonmark\n}\n\ntype MarkdownItPresetName = keyof typeof config\n\n/**\n * Parser preset containing options and enabled rules for each parser component.\n */\nexport interface MarkdownItPreset {\n options?: Required<MarkdownItOptions>\n components?: {\n core?: {\n rules?: string[]\n }\n block?: {\n rules?: string[]\n }\n inline?: {\n rules?: string[]\n rules2?: string[]\n }\n }\n}\n\ntype MarkdownItComponentName = keyof NonNullable<MarkdownItPreset['components']>\n\n//\n// This validator can prohibit more than really needed to prevent XSS. It's a\n// tradeoff to keep code simple and to be secure by default.\n//\n// If you need different setup - override validator method as you wish. Or\n// replace it with dummy function and use external sanitizer.\n//\n\nconst BAD_PROTO_RE = /^(vbscript|javascript|file|data):/\nconst GOOD_DATA_RE = /^data:image\\/(gif|png|jpeg|webp);/\n\nconst RECODE_HOSTNAME_FOR = ['http:', 'https:', 'mailto:']\n\n/**\n * Parses Markdown into tokens and renders them to HTML.\n *\n * @category Main\n */\nclass MarkdownIt {\n /**\n * Instance of {@link ParserInline}. You may need it to add new rules when\n * writing plugins. For simple rules control use {@link MarkdownIt.disable}\n * and {@link MarkdownIt.enable}.\n */\n inline = new ParserInline()\n\n /**\n * Instance of {@link ParserBlock}. You may need it to add new rules when\n * writing plugins. For simple rules control use {@link MarkdownIt.disable}\n * and {@link MarkdownIt.enable}.\n */\n block = new ParserBlock()\n\n /**\n * Instance of {@link ParserCore} chain executor. You may need it to add new\n * rules when writing plugins. For simple rules control use\n * {@link MarkdownIt.disable} and {@link MarkdownIt.enable}.\n */\n core = new ParserCore()\n\n /**\n * Instance of {@link Renderer}. Use it to modify output look. Or to add rendering\n * rules for new token types, generated by plugins.\n *\n * See {@link Renderer} docs and\n * [source code](https://github.com/markdown-it/markdown-it/blob/master/src/renderer.ts).\n *\n * @example\n * ```javascript\n * import MarkdownIt from 'markdown-it'\n * const md = new MarkdownIt()\n *\n * function myToken(tokens, idx, options, env, self) {\n * //...\n * return result;\n * };\n *\n * md.renderer.rules['my_token'] = myToken\n * ```\n */\n renderer = new Renderer()\n\n /**\n * [linkify-it](https://github.com/markdown-it/linkify-it) instance.\n * Used by [linkify](https://github.com/markdown-it/markdown-it/blob/master/src/rules_core/linkify.ts)\n * rule.\n */\n linkify = new LinkifyIt()\n\n /**\n * Link validation function. CommonMark allows too much in links. By default\n * we disable `javascript:`, `vbscript:`, `file:` schemas, and almost all `data:...` schemas\n * except some embedded image types.\n *\n * You can change this behaviour:\n *\n * @example\n * ```javascript\n * import MarkdownIt from 'markdown-it'\n * const md = new MarkdownIt()\n *\n * // enable everything\n * md.validateLink = function () { return true; }\n * ```\n */\n validateLink (url: string): boolean {\n // url should be normalized at this point, and existing entities are decoded\n const str = url.trim().toLowerCase()\n\n return BAD_PROTO_RE.test(str) ? GOOD_DATA_RE.test(str) : true\n }\n\n /**\n * Function used to encode link url to a machine-readable format,\n * which includes url-encoding, punycode, etc.\n */\n normalizeLink (url: string): string {\n // Each url part should be encoded separately, with proper encoder\n const parsed = mdurl.parse(url, true)\n\n if (parsed.hostname) {\n // Encode hostnames in urls like:\n // `http://host/`, `https://host/`, `mailto:user@host`, `//host/`\n //\n // We don't encode unknown schemas, because it's likely that we encode\n // something we shouldn't (e.g. `skype:name` treated as `skype:host`)\n //\n if (!parsed.protocol || RECODE_HOSTNAME_FOR.indexOf(parsed.protocol) >= 0) {\n try {\n parsed.hostname = punycode.toASCII(parsed.hostname)\n } catch (er) { /**/ }\n }\n }\n\n if (parsed.auth) parsed.auth = mdurl.encode(parsed.auth)\n if (parsed.hostname) parsed.hostname = mdurl.encode(parsed.hostname)\n if (parsed.pathname) parsed.pathname = mdurl.encode(parsed.pathname)\n if (parsed.search) parsed.search = mdurl.encode(parsed.search)\n if (parsed.hash) parsed.hash = mdurl.encode(parsed.hash)\n\n return mdurl.format(parsed)\n }\n\n /**\n * Function used to decode link url to a human-readable format`\n */\n normalizeLinkText (url: string): string {\n const parsed = mdurl.parse(url, true)\n\n if (parsed.hostname) {\n // Encode hostnames in urls like:\n // `http://host/`, `https://host/`, `mailto:user@host`, `//host/`\n //\n // We don't encode unknown schemas, because it's likely that we encode\n // something we shouldn't (e.g. `skype:name` treated as `skype:host`)\n //\n if (!parsed.protocol || RECODE_HOSTNAME_FOR.indexOf(parsed.protocol) >= 0) {\n try {\n parsed.hostname = punycode.toUnicode(parsed.hostname)\n } catch (er) { /**/ }\n }\n }\n\n // add '%' to exclude list because of https://github.com/markdown-it/markdown-it/issues/720\n return mdurl.decode(mdurl.format(parsed), mdurl.decode.defaultChars + '%')\n }\n\n // Expose utils & helpers for easy acces from plugins\n\n /**\n * Assorted utility functions, useful to write plugins. See details\n * [here](https://github.com/markdown-it/markdown-it/blob/master/src/common/utils.ts).\n */\n utils = utils\n\n /**\n * Link components parser functions, useful to write plugins. See details\n * [here](https://github.com/markdown-it/markdown-it/blob/master/src/helpers).\n */\n helpers = Object.assign({}, helpers)\n\n declare options: Required<MarkdownItOptions>\n\n constructor (\n ...args:\n | []\n | [options: MarkdownItOptions]\n | [presetName: MarkdownItPresetName, options?: MarkdownItOptions]\n ) {\n const [presetNameOrOptions, options] = args\n\n if (typeof presetNameOrOptions === 'string') {\n this.configure(presetNameOrOptions)\n if (options) { this.set(options) }\n } else {\n this.configure('default')\n this.set(presetNameOrOptions || {})\n }\n }\n\n /**\n * Set parser options (in the same format as in constructor). Probably, you\n * will never need it, but you can change options after constructor call.\n *\n * __Note:__ To achieve the best possible performance, don't modify a\n * `markdown-it` instance options on the fly. If you need multiple configurations\n * it's best to create multiple instances and initialize each with separate\n * config.\n *\n * @example\n * ```javascript\n * import MarkdownIt from 'markdown-it'\n *\n * const md = new MarkdownIt()\n * .set({ html: true, breaks: true })\n * .set({ typographer: true })\n * ```\n */\n set (options: MarkdownItOptions): this {\n Object.assign(this.options, options)\n return this\n }\n\n /**\n * Batch load of all options and compenent settings. This is internal method,\n * and you probably will not need it. But if you will - see available presets\n * and data structure [here](https://github.com/markdown-it/markdown-it/tree/master/src/presets)\n *\n * We strongly recommend to use presets instead of direct config loads. That\n * will give better compatibility with next versions.\n */\n configure (presets: MarkdownItPresetName | MarkdownItPreset): this {\n let p: MarkdownItPreset\n\n if (typeof presets === 'string') {\n const presetName = presets\n p = config[presetName]\n if (!p) { throw new Error(`Wrong 'markdown-it' preset \"${presetName}\", check name`) }\n } else {\n p = presets\n }\n\n if (!p) { throw new Error('Wrong `markdown-it` preset, can\\'t be empty') }\n\n if (p.options) { this.options = { ...p.options } }\n\n const components = p.components\n if (components) {\n const componentNames: MarkdownItComponentName[] = ['core', 'block', 'inline']\n componentNames.forEach((name) => {\n const rules = components[name]?.rules\n if (rules) {\n this[name].ruler.enableOnly(rules)\n }\n })\n\n const rules2 = components.inline?.rules2\n if (rules2) {\n this.inline.ruler2.enableOnly(rules2)\n }\n }\n return this\n }\n\n /**\n * Enable list or rules. It will automatically find appropriate components,\n * containing rules with given names. If rule not found, and `ignoreInvalid`\n * not set - throws exception.\n *\n * @example\n * ```javascript\n * import MarkdownIt from 'markdown-it'\n *\n * const md = new MarkdownIt()\n * .enable(['sub', 'sup'])\n * .disable('smartquotes')\n * ```\n */\n enable (list: string | string[], ignoreInvalid = false): this {\n let result: string[] = []\n\n if (!Array.isArray(list)) { list = [list] }\n\n const chains: MarkdownItComponentName[] = ['core', 'block', 'inline']\n chains.forEach((chain) => {\n result = result.concat(this[chain].ruler.enable(list, true))\n })\n\n result = result.concat(this.inline.ruler2.enable(list, true))\n\n const missed = list.filter((name) => result.indexOf(name) < 0)\n\n if (missed.length && !ignoreInvalid) {\n throw new Error(`MarkdownIt. Failed to enable unknown rule(s): ${missed}`)\n }\n\n return this\n }\n\n /**\n * The same as {@link MarkdownIt.enable}, but turn specified rules off.\n */\n disable (list: string | string[], ignoreInvalid = false): this {\n let result: string[] = []\n\n if (!Array.isArray(list)) { list = [list] }\n\n const chains: MarkdownItComponentName[] = ['core', 'block', 'inline']\n chains.forEach((chain) => {\n result = result.concat(this[chain].ruler.disable(list, true))\n })\n\n result = result.concat(this.inline.ruler2.disable(list, true))\n\n const missed = list.filter((name) => result.indexOf(name) < 0)\n\n if (missed.length && !ignoreInvalid) {\n throw new Error(`MarkdownIt. Failed to disable unknown rule(s): ${missed}`)\n }\n return this\n }\n\n /**\n * Load specified plugin with given params into current parser instance.\n * It's just a sugar to call `plugin(md, params)` with curring.\n *\n * @example\n * ```javascript\n * import MarkdownIt from 'markdown-it'\n * import iterator from 'markdown-it-for-inline'\n *\n * const md = new MarkdownIt()\n * .use(iterator, 'foo_replace', 'text', function (tokens, idx) {\n * tokens[idx].content = tokens[idx].content.replace(/foo/g, 'bar')\n * })\n * ```\n */\n use<Params extends unknown[]> (\n plugin: (md: this, ...params: Params) => void,\n ...params: Params\n ): this {\n plugin.apply(plugin, [this, ...params])\n return this\n }\n\n /**\n * Parse input string and return list of block tokens (special token type\n * \"inline\" will contain list of inline tokens). You should not call this\n * method directly, until you write custom renderer (for example, to produce\n * AST).\n *\n * `env` is used to pass data between \"distributed\" rules and return additional\n * metadata like reference info, needed for the renderer. It also can be used to\n * inject data in specific cases. Usually, you will be ok to pass `{}`,\n * and then pass updated object to renderer.\n */\n parse (src: string, env: Env): Token[] {\n if (typeof src !== 'string') {\n throw new Error('Input data should be a String')\n }\n\n const state = new this.core.State(src, this, env)\n\n this.core.process(state)\n\n return state.tokens\n }\n\n /**\n * Render markdown string into html. It does all magic for you :).\n *\n * `env` can be used to inject additional metadata (`{}` by default).\n * But you will not need it with high probability. See also comment\n * in {@link MarkdownIt.parse}.\n */\n render (src: string, env: Env = {}): string {\n return this.renderer.render(this.parse(src, env), this.options, env)\n }\n\n /**\n * The same as {@link MarkdownIt.parse} but skip all block rules. It returns\n * the block tokens list with the single `inline` element, containing parsed\n * inline tokens in `children` property. Also updates `env` object.\n */\n parseInline (src: string, env: Env): Token[] {\n const state = new this.core.State(src, this, env)\n\n state.inlineMode = true\n this.core.process(state)\n\n return state.tokens\n }\n\n /**\n * Similar to {@link MarkdownIt.render} but for single paragraph content.\n * Result will NOT be wrapped into `<p>` tags.\n */\n renderInline (src: string, env: Env = {}): string {\n return this.renderer.render(this.parseInline(src, env), this.options, env)\n }\n\n static Token = Token\n static Ruler = Ruler\n static Renderer = Renderer\n static ParserCore = ParserCore\n static StateCore = StateCore\n static ParserBlock = ParserBlock\n static StateBlock = StateBlock\n static ParserInline = ParserInline\n static StateInline = StateInline\n}\n\nexport default MarkdownIt\n","import { callable } from './common/utils.ts'\nimport MarkdownIt from './markdownit.ts'\n\n/**\n * Default package export.\n *\n * For backward compatibility, the {@link MarkdownIt} class is wrapped so\n * legacy code can call it without `new`. New code should instantiate it as a\n * regular class with `new`. The compatibility wrapper may be removed in a\n * future release.\n *\n * @category Main\n */\nconst MarkdownItCallable = callable(MarkdownIt)\n\nexport default MarkdownItCallable\n\nexport type { default as MarkdownIt, MarkdownItPreset } from './markdownit.ts'\nexport type { Delimiter, Env, MarkdownItOptions } from './types.ts'\nexport type { default as Token } from './token.ts'\nexport type { default as Ruler } from './ruler.ts'\nexport type { default as Renderer, RendererRule } from './renderer.ts'\nexport type { default as ParserCore } from './parser_core.ts'\nexport type { default as StateCore } from './rules_core/state_core.ts'\nexport type { default as ParserBlock } from './parser_block.ts'\nexport type { default as StateBlock } from './rules_block/state_block.ts'\nexport type { default as ParserInline } from './parser_inline.ts'\nexport type { default as StateInline } from './rules_inline/state_inline.ts'\n"],"ignoreList":[0,1,2,3,4],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,IAAM,KAAK;CACP;CAAM;CAAG;CAAM;CAAK;CAAM;CAAM;CAAM;CAAM;CAAK;CAAM;CAAK;CAAM;CAAK;CACvE;CAAK;CAAG;CAAG;CAAM;CAAM;CAAM;CAAM;CAAM;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