@depup/markdown-it 15.0.1-depup.8 → 15.0.2-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.esm.min.mjs","names":["decode","encode"],"sources":["../../node_modules/mdurl/lib/decode.mjs","../../node_modules/mdurl/lib/encode.mjs","../../node_modules/mdurl/lib/format.mjs","../../node_modules/mdurl/lib/parse.mjs","../../node_modules/mdurl/index.mjs","../../node_modules/uc.micro/build/index.mjs","../../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","../../node_modules/linkify-it/build/index.mjs","../../node_modules/punycode.js/punycode.es6.js","../../src/presets/default.ts","../../src/presets/zero.ts","../../src/presets/commonmark.ts","../../src/markdownit.ts","../../src/index.ts"],"sourcesContent":["/* eslint-disable no-bitwise */\n\nconst decodeCache = {}\n\nfunction getDecodeCache (exclude) {\n let cache = decodeCache[exclude]\n if (cache) { return cache }\n\n cache = decodeCache[exclude] = []\n\n for (let i = 0; i < 128; i++) {\n const ch = String.fromCharCode(i)\n cache.push(ch)\n }\n\n for (let i = 0; i < exclude.length; i++) {\n const ch = exclude.charCodeAt(i)\n cache[ch] = '%' + ('0' + ch.toString(16).toUpperCase()).slice(-2)\n }\n\n return cache\n}\n\n// Decode percent-encoded string.\n//\nfunction decode (string, exclude) {\n if (typeof exclude !== 'string') {\n exclude = decode.defaultChars\n }\n\n const cache = getDecodeCache(exclude)\n\n return string.replace(/(%[a-f0-9]{2})+/gi, function (seq) {\n let result = ''\n\n for (let i = 0, l = seq.length; i < l; i += 3) {\n const b1 = parseInt(seq.slice(i + 1, i + 3), 16)\n\n if (b1 < 0x80) {\n result += cache[b1]\n continue\n }\n\n if ((b1 & 0xE0) === 0xC0 && (i + 3 < l)) {\n // 110xxxxx 10xxxxxx\n const b2 = parseInt(seq.slice(i + 4, i + 6), 16)\n\n if ((b2 & 0xC0) === 0x80) {\n const chr = ((b1 << 6) & 0x7C0) | (b2 & 0x3F)\n\n if (chr < 0x80) {\n result += '\\ufffd\\ufffd'\n } else {\n result += String.fromCharCode(chr)\n }\n\n i += 3\n continue\n }\n }\n\n if ((b1 & 0xF0) === 0xE0 && (i + 6 < l)) {\n // 1110xxxx 10xxxxxx 10xxxxxx\n const b2 = parseInt(seq.slice(i + 4, i + 6), 16)\n const b3 = parseInt(seq.slice(i + 7, i + 9), 16)\n\n if ((b2 & 0xC0) === 0x80 && (b3 & 0xC0) === 0x80) {\n const chr = ((b1 << 12) & 0xF000) | ((b2 << 6) & 0xFC0) | (b3 & 0x3F)\n\n if (chr < 0x800 || (chr >= 0xD800 && chr <= 0xDFFF)) {\n result += '\\ufffd\\ufffd\\ufffd'\n } else {\n result += String.fromCharCode(chr)\n }\n\n i += 6\n continue\n }\n }\n\n if ((b1 & 0xF8) === 0xF0 && (i + 9 < l)) {\n // 111110xx 10xxxxxx 10xxxxxx 10xxxxxx\n const b2 = parseInt(seq.slice(i + 4, i + 6), 16)\n const b3 = parseInt(seq.slice(i + 7, i + 9), 16)\n const b4 = parseInt(seq.slice(i + 10, i + 12), 16)\n\n if ((b2 & 0xC0) === 0x80 && (b3 & 0xC0) === 0x80 && (b4 & 0xC0) === 0x80) {\n let chr = ((b1 << 18) & 0x1C0000) | ((b2 << 12) & 0x3F000) | ((b3 << 6) & 0xFC0) | (b4 & 0x3F)\n\n if (chr < 0x10000 || chr > 0x10FFFF) {\n result += '\\ufffd\\ufffd\\ufffd\\ufffd'\n } else {\n chr -= 0x10000\n result += String.fromCharCode(0xD800 + (chr >> 10), 0xDC00 + (chr & 0x3FF))\n }\n\n i += 9\n continue\n }\n }\n\n result += '\\ufffd'\n }\n\n return result\n })\n}\n\ndecode.defaultChars = ';/?:@&=+$,#'\ndecode.componentChars = ''\n\nexport default decode\n","const encodeCache = {}\n\n// Create a lookup array where anything but characters in `chars` string\n// and alphanumeric chars is percent-encoded.\n//\nfunction getEncodeCache (exclude) {\n let cache = encodeCache[exclude]\n if (cache) { return cache }\n\n cache = encodeCache[exclude] = []\n\n for (let i = 0; i < 128; i++) {\n const ch = String.fromCharCode(i)\n\n if (/^[0-9a-z]$/i.test(ch)) {\n // always allow unencoded alphanumeric characters\n cache.push(ch)\n } else {\n cache.push('%' + ('0' + i.toString(16).toUpperCase()).slice(-2))\n }\n }\n\n for (let i = 0; i < exclude.length; i++) {\n cache[exclude.charCodeAt(i)] = exclude[i]\n }\n\n return cache\n}\n\n// Encode unsafe characters with percent-encoding, skipping already\n// encoded sequences.\n//\n// - string - string to encode\n// - exclude - list of characters to ignore (in addition to a-zA-Z0-9)\n// - keepEscaped - don't encode '%' in a correct escape sequence (default: true)\n//\nfunction encode (string, exclude, keepEscaped) {\n if (typeof exclude !== 'string') {\n // encode(string, keepEscaped)\n keepEscaped = exclude\n exclude = encode.defaultChars\n }\n\n if (typeof keepEscaped === 'undefined') {\n keepEscaped = true\n }\n\n const cache = getEncodeCache(exclude)\n let result = ''\n\n for (let i = 0, l = string.length; i < l; i++) {\n const code = string.charCodeAt(i)\n\n if (keepEscaped && code === 0x25 /* % */ && i + 2 < l) {\n if (/^[0-9a-f]{2}$/i.test(string.slice(i + 1, i + 3))) {\n result += string.slice(i, i + 3)\n i += 2\n continue\n }\n }\n\n if (code < 128) {\n result += cache[code]\n continue\n }\n\n if (code >= 0xD800 && code <= 0xDFFF) {\n if (code >= 0xD800 && code <= 0xDBFF && i + 1 < l) {\n const nextCode = string.charCodeAt(i + 1)\n if (nextCode >= 0xDC00 && nextCode <= 0xDFFF) {\n result += encodeURIComponent(string[i] + string[i + 1])\n i++\n continue\n }\n }\n result += '%EF%BF%BD'\n continue\n }\n\n result += encodeURIComponent(string[i])\n }\n\n return result\n}\n\nencode.defaultChars = \";/?:@&=+$,-_.!~*'()#\"\nencode.componentChars = \"-_.!~*'()\"\n\nexport default encode\n","export default function format (url) {\n let result = ''\n\n result += url.protocol || ''\n result += url.slashes ? '//' : ''\n result += url.auth ? url.auth + '@' : ''\n\n if (url.hostname && url.hostname.indexOf(':') !== -1) {\n // ipv6 address\n result += '[' + url.hostname + ']'\n } else {\n result += url.hostname || ''\n }\n\n result += url.port ? ':' + url.port : ''\n result += url.pathname || ''\n result += url.search || ''\n result += url.hash || ''\n\n return result\n};\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n//\n// Changes from joyent/node:\n//\n// 1. No leading slash in paths,\n// e.g. in `url.parse('http://foo?bar')` pathname is ``, not `/`\n//\n// 2. Backslashes are not replaced with slashes,\n// so `http:\\\\example.org\\` is treated like a relative path\n//\n// 3. Trailing colon is treated like a part of the path,\n// i.e. in `http://example.org:foo` pathname is `:foo`\n//\n// 4. Nothing is URL-encoded in the resulting object,\n// (in joyent/node some chars in auth and paths are encoded)\n//\n// 5. `url.parse()` does not have `parseQueryString` argument\n//\n// 6. Removed extraneous result properties: `host`, `path`, `query`, etc.,\n// which can be constructed using other parts of the url.\n//\n\nfunction Url () {\n this.protocol = null\n this.slashes = null\n this.auth = null\n this.port = null\n this.hostname = null\n this.hash = null\n this.search = null\n this.pathname = null\n}\n\n// Reference: RFC 3986, RFC 1808, RFC 2396\n\n// define these here so at least they only have to be\n// compiled once on the first module load.\nconst protocolPattern = /^([a-z0-9.+-]+:)/i\nconst portPattern = /:[0-9]*$/\n\n// Special case for a simple path URL\n/* eslint-disable-next-line no-useless-escape */\nconst simplePathPattern = /^(\\/\\/?(?!\\/)[^\\?\\s]*)(\\?[^\\s]*)?$/\n\n// RFC 2396: characters reserved for delimiting URLs.\n// We actually just auto-escape these.\nconst delims = ['<', '>', '\"', '`', ' ', '\\r', '\\n', '\\t']\n\n// RFC 2396: characters not allowed for various reasons.\nconst unwise = ['{', '}', '|', '\\\\', '^', '`'].concat(delims)\n\n// Allowed by RFCs, but cause of XSS attacks. Always escape these.\nconst autoEscape = ['\\''].concat(unwise)\n// Characters that are never ever allowed in a hostname.\n// Note that any invalid chars are also handled, but these\n// are the ones that are *expected* to be seen, so we fast-path\n// them.\nconst nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape)\nconst hostEndingChars = ['/', '?', '#']\nconst hostnameMaxLen = 255\nconst hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/\nconst hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/\n// protocols that can allow \"unsafe\" and \"unwise\" chars.\n// protocols that never have a hostname.\nconst hostlessProtocol = {\n javascript: true,\n 'javascript:': true\n}\n// protocols that always contain a // bit.\nconst slashedProtocol = {\n http: true,\n https: true,\n ftp: true,\n gopher: true,\n file: true,\n 'http:': true,\n 'https:': true,\n 'ftp:': true,\n 'gopher:': true,\n 'file:': true\n}\n\nfunction urlParse (url, slashesDenoteHost) {\n if (url && url instanceof Url) return url\n\n const u = new Url()\n u.parse(url, slashesDenoteHost)\n return u\n}\n\nUrl.prototype.parse = function (url, slashesDenoteHost) {\n let lowerProto, hec, slashes\n let rest = url\n\n // trim before proceeding.\n // This is to support parse stuff like \" http://foo.com \\n\"\n rest = rest.trim()\n\n if (!slashesDenoteHost && url.split('#').length === 1) {\n // Try fast path regexp\n const simplePath = simplePathPattern.exec(rest)\n if (simplePath) {\n this.pathname = simplePath[1]\n if (simplePath[2]) {\n this.search = simplePath[2]\n }\n return this\n }\n }\n\n let proto = protocolPattern.exec(rest)\n if (proto) {\n proto = proto[0]\n lowerProto = proto.toLowerCase()\n this.protocol = proto\n rest = rest.substr(proto.length)\n }\n\n // figure out if it's got a host\n // user@server is *always* interpreted as a hostname, and url\n // resolution will treat //foo/bar as host=foo,path=bar because that's\n // how the browser resolves relative URLs.\n /* eslint-disable-next-line no-useless-escape */\n if (slashesDenoteHost || proto || rest.match(/^\\/\\/[^@\\/]+@[^@\\/]+/)) {\n slashes = rest.substr(0, 2) === '//'\n if (slashes && !(proto && hostlessProtocol[proto])) {\n rest = rest.substr(2)\n this.slashes = true\n }\n }\n\n if (!hostlessProtocol[proto] &&\n (slashes || (proto && !slashedProtocol[proto]))) {\n // there's a hostname.\n // the first instance of /, ?, ;, or # ends the host.\n //\n // If there is an @ in the hostname, then non-host chars *are* allowed\n // to the left of the last @ sign, unless some host-ending character\n // comes *before* the @-sign.\n // URLs are obnoxious.\n //\n // ex:\n // http://a@b@c/ => user:a@b host:c\n // http://a@b?@c => user:a host:c path:/?@c\n\n // v0.12 TODO(isaacs): This is not quite how Chrome does things.\n // Review our test case against browsers more comprehensively.\n\n // find the first instance of any hostEndingChars\n let hostEnd = -1\n for (let i = 0; i < hostEndingChars.length; i++) {\n hec = rest.indexOf(hostEndingChars[i])\n if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) {\n hostEnd = hec\n }\n }\n\n // at this point, either we have an explicit point where the\n // auth portion cannot go past, or the last @ char is the decider.\n let auth, atSign\n if (hostEnd === -1) {\n // atSign can be anywhere.\n atSign = rest.lastIndexOf('@')\n } else {\n // atSign must be in auth portion.\n // http://a@b/c@d => host:b auth:a path:/c@d\n atSign = rest.lastIndexOf('@', hostEnd)\n }\n\n // Now we have a portion which is definitely the auth.\n // Pull that off.\n if (atSign !== -1) {\n auth = rest.slice(0, atSign)\n rest = rest.slice(atSign + 1)\n this.auth = auth\n }\n\n // the host is the remaining to the left of the first non-host char\n hostEnd = -1\n for (let i = 0; i < nonHostChars.length; i++) {\n hec = rest.indexOf(nonHostChars[i])\n if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) {\n hostEnd = hec\n }\n }\n // if we still have not hit it, then the entire thing is a host.\n if (hostEnd === -1) {\n hostEnd = rest.length\n }\n\n if (rest[hostEnd - 1] === ':') { hostEnd-- }\n const host = rest.slice(0, hostEnd)\n rest = rest.slice(hostEnd)\n\n // pull out port.\n this.parseHost(host)\n\n // we've indicated that there is a hostname,\n // so even if it's empty, it has to be present.\n this.hostname = this.hostname || ''\n\n // if hostname begins with [ and ends with ]\n // assume that it's an IPv6 address.\n const ipv6Hostname = this.hostname[0] === '[' &&\n this.hostname[this.hostname.length - 1] === ']'\n\n // validate a little.\n if (!ipv6Hostname) {\n const hostparts = this.hostname.split(/\\./)\n for (let i = 0, l = hostparts.length; i < l; i++) {\n const part = hostparts[i]\n if (!part) { continue }\n if (!part.match(hostnamePartPattern)) {\n let newpart = ''\n for (let j = 0, k = part.length; j < k; j++) {\n if (part.charCodeAt(j) > 127) {\n // we replace non-ASCII char with a temporary placeholder\n // we need this to make sure size of hostname is not\n // broken by replacing non-ASCII by nothing\n newpart += 'x'\n } else {\n newpart += part[j]\n }\n }\n // we test again with ASCII char only\n if (!newpart.match(hostnamePartPattern)) {\n const validParts = hostparts.slice(0, i)\n const notHost = hostparts.slice(i + 1)\n const bit = part.match(hostnamePartStart)\n if (bit) {\n validParts.push(bit[1])\n notHost.unshift(bit[2])\n }\n if (notHost.length) {\n rest = notHost.join('.') + rest\n }\n this.hostname = validParts.join('.')\n break\n }\n }\n }\n }\n\n if (this.hostname.length > hostnameMaxLen) {\n this.hostname = ''\n }\n\n // strip [ and ] from the hostname\n // the host field still retains them, though\n if (ipv6Hostname) {\n this.hostname = this.hostname.substr(1, this.hostname.length - 2)\n }\n }\n\n // chop off from the tail first.\n const hash = rest.indexOf('#')\n if (hash !== -1) {\n // got a fragment string.\n this.hash = rest.substr(hash)\n rest = rest.slice(0, hash)\n }\n const qm = rest.indexOf('?')\n if (qm !== -1) {\n this.search = rest.substr(qm)\n rest = rest.slice(0, qm)\n }\n if (rest) { this.pathname = rest }\n if (slashedProtocol[lowerProto] &&\n this.hostname && !this.pathname) {\n this.pathname = ''\n }\n\n return this\n}\n\nUrl.prototype.parseHost = function (host) {\n let port = portPattern.exec(host)\n if (port) {\n port = port[0]\n if (port !== ':') {\n this.port = port.substr(1)\n }\n host = host.substr(0, host.length - port.length)\n }\n if (host) { this.hostname = host }\n}\n\nexport default urlParse\n","import decode from './lib/decode.mjs'\nimport encode from './lib/encode.mjs'\nimport format from './lib/format.mjs'\nimport parse from './lib/parse.mjs'\n\nexport {\n decode,\n encode,\n format,\n parse\n}\n","const Any = /[\\0-\\uD7FF\\uE000-\\uFFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF]/;\nconst Cc = /[\\0-\\x1F\\x7F-\\x9F]/;\nconst Cf = /[\\xAD\\u0600-\\u0605\\u061C\\u06DD\\u070F\\u0890\\u0891\\u08E2\\u180E\\u200B-\\u200F\\u202A-\\u202E\\u2060-\\u2064\\u2066-\\u206F\\uFEFF\\uFFF9-\\uFFFB]|\\uD804[\\uDCBD\\uDCCD]|\\uD80D[\\uDC30-\\uDC3F]|\\uD82F[\\uDCA0-\\uDCA3]|\\uD834[\\uDD73-\\uDD7A]|\\uDB40[\\uDC01\\uDC20-\\uDC7F]/;\nconst P = /[!-#%-\\*,-\\/:;\\?@\\[-\\]_\\{\\}\\xA1\\xA7\\xAB\\xB6\\xB7\\xBB\\xBF\\u037E\\u0387\\u055A-\\u055F\\u0589\\u058A\\u05BE\\u05C0\\u05C3\\u05C6\\u05F3\\u05F4\\u0609\\u060A\\u060C\\u060D\\u061B\\u061D-\\u061F\\u066A-\\u066D\\u06D4\\u0700-\\u070D\\u07F7-\\u07F9\\u0830-\\u083E\\u085E\\u0964\\u0965\\u0970\\u09FD\\u0A76\\u0AF0\\u0C77\\u0C84\\u0DF4\\u0E4F\\u0E5A\\u0E5B\\u0F04-\\u0F12\\u0F14\\u0F3A-\\u0F3D\\u0F85\\u0FD0-\\u0FD4\\u0FD9\\u0FDA\\u104A-\\u104F\\u10FB\\u1360-\\u1368\\u1400\\u166E\\u169B\\u169C\\u16EB-\\u16ED\\u1735\\u1736\\u17D4-\\u17D6\\u17D8-\\u17DA\\u1800-\\u180A\\u1944\\u1945\\u1A1E\\u1A1F\\u1AA0-\\u1AA6\\u1AA8-\\u1AAD\\u1B4E\\u1B4F\\u1B5A-\\u1B60\\u1B7D-\\u1B7F\\u1BFC-\\u1BFF\\u1C3B-\\u1C3F\\u1C7E\\u1C7F\\u1CC0-\\u1CC7\\u1CD3\\u2010-\\u2027\\u2030-\\u2043\\u2045-\\u2051\\u2053-\\u205E\\u207D\\u207E\\u208D\\u208E\\u2308-\\u230B\\u2329\\u232A\\u2768-\\u2775\\u27C5\\u27C6\\u27E6-\\u27EF\\u2983-\\u2998\\u29D8-\\u29DB\\u29FC\\u29FD\\u2CF9-\\u2CFC\\u2CFE\\u2CFF\\u2D70\\u2E00-\\u2E2E\\u2E30-\\u2E4F\\u2E52-\\u2E5D\\u3001-\\u3003\\u3008-\\u3011\\u3014-\\u301F\\u3030\\u303D\\u30A0\\u30FB\\uA4FE\\uA4FF\\uA60D-\\uA60F\\uA673\\uA67E\\uA6F2-\\uA6F7\\uA874-\\uA877\\uA8CE\\uA8CF\\uA8F8-\\uA8FA\\uA8FC\\uA92E\\uA92F\\uA95F\\uA9C1-\\uA9CD\\uA9DE\\uA9DF\\uAA5C-\\uAA5F\\uAADE\\uAADF\\uAAF0\\uAAF1\\uABEB\\uFD3E\\uFD3F\\uFE10-\\uFE19\\uFE30-\\uFE52\\uFE54-\\uFE61\\uFE63\\uFE68\\uFE6A\\uFE6B\\uFF01-\\uFF03\\uFF05-\\uFF0A\\uFF0C-\\uFF0F\\uFF1A\\uFF1B\\uFF1F\\uFF20\\uFF3B-\\uFF3D\\uFF3F\\uFF5B\\uFF5D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0385\\u03F6\\u0482\\u058D-\\u058F\\u0606-\\u0608\\u060B\\u060E\\u060F\\u06DE\\u06E9\\u06FD\\u06FE\\u07F6\\u07FE\\u07FF\\u0888\\u09F2\\u09F3\\u09FA\\u09FB\\u0AF1\\u0B70\\u0BF3-\\u0BFA\\u0C7F\\u0D4F\\u0D79\\u0E3F\\u0F01-\\u0F03\\u0F13\\u0F15-\\u0F17\\u0F1A-\\u0F1F\\u0F34\\u0F36\\u0F38\\u0FBE-\\u0FC5\\u0FC7-\\u0FCC\\u0FCE\\u0FCF\\u0FD5-\\u0FD8\\u109E\\u109F\\u1390-\\u1399\\u166D\\u17DB\\u1940\\u19DE-\\u19FF\\u1B61-\\u1B6A\\u1B74-\\u1B7C\\u1FBD\\u1FBF-\\u1FC1\\u1FCD-\\u1FCF\\u1FDD-\\u1FDF\\u1FED-\\u1FEF\\u1FFD\\u1FFE\\u2044\\u2052\\u207A-\\u207C\\u208A-\\u208C\\u20A0-\\u20C1\\u2100\\u2101\\u2103-\\u2106\\u2108\\u2109\\u2114\\u2116-\\u2118\\u211E-\\u2123\\u2125\\u2127\\u2129\\u212E\\u213A\\u213B\\u2140-\\u2144\\u214A-\\u214D\\u214F\\u218A\\u218B\\u2190-\\u2307\\u230C-\\u2328\\u232B-\\u2429\\u2440-\\u244A\\u249C-\\u24E9\\u2500-\\u2767\\u2794-\\u27C4\\u27C7-\\u27E5\\u27F0-\\u2982\\u2999-\\u29D7\\u29DC-\\u29FB\\u29FE-\\u2B73\\u2B76-\\u2BFF\\u2CE5-\\u2CEA\\u2E50\\u2E51\\u2E80-\\u2E99\\u2E9B-\\u2EF3\\u2F00-\\u2FD5\\u2FF0-\\u2FFF\\u3004\\u3012\\u3013\\u3020\\u3036\\u3037\\u303E\\u303F\\u309B\\u309C\\u3190\\u3191\\u3196-\\u319F\\u31C0-\\u31E5\\u31EF\\u3200-\\u321E\\u322A-\\u3247\\u3250\\u3260-\\u327F\\u328A-\\u32B0\\u32C0-\\u33FF\\u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C93\\uDCA0-\\uDCAE\\uDCB1-\\uDCBF\\uDCC1-\\uDCCF\\uDCD1-\\uDCF5\\uDD0D-\\uDDAD\\uDDE6-\\uDE02\\uDE10-\\uDE3B\\uDE40-\\uDE48\\uDE50\\uDE51\\uDE60-\\uDE65\\uDF00-\\uDFFF]|\\uD83D[\\uDC00-\\uDED8\\uDEDC-\\uDEEC\\uDEF0-\\uDEFC\\uDF00-\\uDFD9\\uDFE0-\\uDFEB\\uDFF0]|\\uD83E[\\uDC00-\\uDC0B\\uDC10-\\uDC47\\uDC50-\\uDC59\\uDC60-\\uDC87\\uDC90-\\uDCAD\\uDCB0-\\uDCBB\\uDCC0\\uDCC1\\uDCD0-\\uDCD8\\uDD00-\\uDE57\\uDE60-\\uDE6D\\uDE70-\\uDE7C\\uDE80-\\uDE8A\\uDE8E-\\uDEC6\\uDEC8\\uDECD-\\uDEDC\\uDEDF-\\uDEEA\\uDEEF-\\uDEF8\\uDF00-\\uDF92\\uDF94-\\uDFEF\\uDFFA]/;\nconst Z = /[ \\xA0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]/;\n\nexport { Any, Cc, Cf, P, S, Z };\n","// 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/IPAAAAAAAAAAAAAAAAKhBMEY8TmxUWF2EYLBkxGuAa3RsJHDscWR8YIC8jSCSIJcMl6ie3Ku8rEC0CLjoupS7kLgAIRU1hYmNmZ2xtbm9wcnN0dVQAWgBeAGUAaQBzAHcAfgCBAIQAhwCSAJoAoACsALMAbABpAGcAO4DGAMZAUAA7gCYAJkBjAHUAdABlADuAwQDBQHIiZXZlAAJhAAFpeW0AcgByAGMAO4DCAMJAEGRyAADgNdgE3XIAYQB2AGUAO4DAAMBA8CFoYZFj4SFjcgBhZAAAoFMqAAFncIsAjgBvAG4ABGFmAADgNdg43fAlbHlGdW5jdGlvbgCgYSBpAG4AZwA7gMUAxUAAAWNzpACoAHIAAOA12Jzc6SFnbgCgVCJpAGwAZABlADuAwwDDQG0AbAA7gMQAxEAABGFjZWZvcnN1xQDYANoA7QDxAPYA+QD8AAABY3LJAM8AayNzbGFza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AV2RwAGYAAOA12GrdYwByAADgNdjO3AABY23dLt8ueQBOZGwAO4D/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\ninterface Replacement {\n pos: number\n ch: string\n}\n\ntype ReplacementMap = Record<string, Replacement[]>\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 = []\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 stack.length = 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 // this could be a closing quote, rewind the stack to get a match\n for (j = stack.length - 1; j >= 0; j--) {\n let item = stack[j]\n if (stack[j].level < thisLevel) { break }\n if (item.single === isSingle && stack[j].level === thisLevel) {\n 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.token, item.pos, openQuote)\n\n stack.length = j\n continue OUTER\n }\n }\n }\n\n if (canOpen) {\n stack.push({\n token: i,\n pos: t.index,\n single: isSingle,\n level: thisLevel\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","import { Any, Cc, P, Z } from \"uc.micro\";\n//#region src/rebuilder.ts\nvar REBuilder = class {\n\tsrc_Any = Any.source;\n\tsrc_Cc = Cc.source;\n\tsrc_Z = Z.source;\n\tsrc_P = P.source;\n\tsrc_ZPCc = [\n\t\tthis.src_Z,\n\t\tthis.src_P,\n\t\tthis.src_Cc\n\t].join(\"|\");\n\tsrc_ZCc = [this.src_Z, this.src_Cc].join(\"|\");\n\tcache = {};\n\topts = {\n\t\tmaxLength: 1e4,\n\t\turlAuth: false,\n\t\tschema_names: []\n\t};\n\tconstructor(opts = {}) {\n\t\tthis.opts = {\n\t\t\t...this.opts,\n\t\t\t...opts\n\t\t};\n\t}\n\tset(opts = {}) {\n\t\tthis.opts = {\n\t\t\t...this.opts,\n\t\t\t...opts\n\t\t};\n\t\tthis.cache = {};\n\t\treturn this;\n\t}\n\tescapeRE(str) {\n\t\treturn str.replace(/[.?*+^$[\\]\\\\(){}|-]/g, \"\\\\$&\");\n\t}\n\tnestedPairRE(open, close, depth = 4) {\n\t\tconst openRE = this.escapeRE(open);\n\t\tconst closeRE = this.escapeRE(close);\n\t\tconst atom = `(?:(?!${this.src_ZCc}|${openRE}|${closeRE}).)`;\n\t\tlet pair = `${openRE}${atom}{0,1000}${closeRE}`;\n\t\tfor (let level = 2; level <= depth; level++) pair = `${openRE}(?:${atom}|${pair}){0,1000}${closeRE}`;\n\t\treturn pair;\n\t}\n\tget_text_separators() {\n\t\treturn this.cache.text_separators ??= /[><\\uff5c]/;\n\t}\n\tget_pseudo_letter() {\n\t\treturn this.cache.src_pseudo_letter ??= new RegExp(`(?:(?!${this.get_text_separators().source}|${this.src_ZPCc})${this.src_Any})`);\n\t}\n\tget_ipv4_addr() {\n\t\treturn this.cache.src_ip4 ??= /* @__PURE__ */ new RegExp(\"(?:(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])[.]){3}(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\");\n\t}\n\tget_ipv6_addr() {\n\t\tconst h16 = \"[0-9A-Fa-f]{1,4}\";\n\t\tconst ls32 = `(?:(?:${h16}:${h16})|${this.get_ipv4_addr().source})`;\n\t\treturn this.cache.src_ip6_addr ??= new RegExp(`(?:(?:${h16}:){6}${ls32}|::(?:${h16}:){5}${ls32}|(?:${h16})?::(?:${h16}:){4}${ls32}|(?:(?:${h16}:){0,1}${h16})?::(?:${h16}:){3}${ls32}|(?:(?:${h16}:){0,2}${h16})?::(?:${h16}:){2}${ls32}|(?:(?:${h16}:){0,3}${h16})?::${h16}:${ls32}|(?:(?:${h16}:){0,4}${h16})?::${ls32}|(?:(?:${h16}:){0,5}${h16})?::${h16}|(?:(?:${h16}:){0,6}${h16})?::)`);\n\t}\n\tget_ipv6_url_host() {\n\t\treturn this.cache.src_ip6_host ??= new RegExp(`\\\\[${this.get_ipv6_addr().source}\\\\]`);\n\t}\n\tget_ipv6_mail_host() {\n\t\treturn this.cache.src_ipv6_mail_host ??= new RegExp(`\\\\[IPv6:${this.get_ipv6_addr().source}\\\\]`);\n\t}\n\tget_auth() {\n\t\treturn this.cache.src_auth ??= new RegExp(`(?:(?:(?!${this.src_ZCc}|[@/\\\\[\\\\]()]).){1,50}@)?`);\n\t}\n\tget_port() {\n\t\treturn this.cache.src_port ??= /* @__PURE__ */ new RegExp(\"(?::(?:6(?:[0-4]\\\\d{3}|5(?:[0-4]\\\\d{2}|5(?:[0-2]\\\\d|3[0-5])))|[1-5]?\\\\d{1,4}))?\");\n\t}\n\tget_host_terminator() {\n\t\treturn this.cache.src_host_terminator ??= new RegExp(`(?=$|${this.get_text_separators().source}|${this.src_ZPCc})(?!${this.opts[\"---\"] ? \"-(?!--)|\" : \"-|\"}_|:\\\\d|\\\\.-|\\\\.(?!$|${this.src_ZPCc}))`);\n\t}\n\tget_path_terminator() {\n\t\treturn this.cache.src_path_terminator ??= new RegExp(`${this.src_ZPCc}|${this.get_text_separators().source}`);\n\t}\n\tget_path() {\n\t\treturn this.cache.src_path ??= new RegExp(`(?:[/?#](?:${this.nestedPairRE(\"[\", \"]\")}|${this.nestedPairRE(\"(\", \")\")}|${this.nestedPairRE(\"{\", \"}\")}|\\\\\"(?:(?!${this.src_ZCc}|[\"]).){1,100}\\\\\"|\\\\'(?:(?!${this.src_ZCc}|[']).){1,100}\\\\'|\\\\'(?=${this.get_pseudo_letter().source}|[-])|\\\\.{2,20}[:]?[a-zA-Z0-9%/&]|\\\\.(?!${this.src_ZCc}|[.]|$)|` + (this.opts[\"---\"] ? \"\\\\-(?!--(?:[^-]|$))(?:-{0,19})|\" : \"\\\\-{1,20}|\") + `,(?!${this.src_ZCc}|$)|;(?!${this.src_ZCc}|$)|\\\\!{1,20}(?!${this.src_ZCc}|[!]|$)|\\\\?(?!${this.src_ZCc}|[?]|$)|` + this.get_path_extra().source + `[\\\\\\\\/:%@#&=_~*]|(?!${this.get_path_terminator().source}).){1,${this.opts.maxLength}}|\\\\/)?`);\n\t}\n\tget_mail_name() {\n\t\treturn this.cache.src_mail_name ??= /* @__PURE__ */ new RegExp(\"[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9](?:[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9]|[.](?=[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9])){0,63}\");\n\t}\n\tget_xn() {\n\t\treturn this.cache.src_xn ??= /* @__PURE__ */ new RegExp(\"xn--[a-z0-9\\\\-]{1,59}\");\n\t}\n\tget_tld() {\n\t\tif (this.cache.tld) return this.cache.tld;\n\t\tconst tlds_src = [...new Set(this.opts.tlds || [])].sort().reverse().join(\"|\");\n\t\tthis.cache.tld = new RegExp(`${tlds_src || \"$#none#$\"}|${this.get_xn().source}`);\n\t\treturn this.cache.tld;\n\t}\n\tget_domain_root() {\n\t\treturn this.cache.src_domain_root ??= new RegExp(\"(?:\" + this.get_xn().source + `|${this.get_pseudo_letter().source}{1,63})`);\n\t}\n\tget_domain() {\n\t\treturn this.cache.src_domain ??= new RegExp(\"(?:\" + this.get_xn().source + `|(?:${this.get_pseudo_letter().source})|(?:${this.get_pseudo_letter().source}(?:-|${this.get_pseudo_letter().source}){0,61}${this.get_pseudo_letter().source}))`);\n\t}\n\tget_url_host_port() {\n\t\treturn this.cache.url_host_port ??= new RegExp(\"(?:\" + this.get_ipv6_url_host().source + `|(?:(?:(?:${this.get_domain().source})\\\\.){0,10}${this.get_domain().source}))` + this.get_port().source + this.get_host_terminator().source);\n\t}\n\tget_fuzzy_url_host_port() {\n\t\treturn this.cache.fuzzy_url_host_port ??= new RegExp(\"(?:\" + (this.opts.fuzzyIP ? this.get_ipv4_addr().source + \"|\" : \"\") + `(?:(?:(?:${this.get_domain().source})\\\\.){1,10}(?:${this.get_tld().source})))` + this.get_host_terminator().source);\n\t}\n\tget_mail_host() {\n\t\treturn this.cache.src_mail_host ??= new RegExp(\"(?:\" + this.get_ipv6_mail_host().source + `|(?:(?:(?:${this.get_domain().source})\\\\.){0,4}${this.get_domain().source}))` + this.get_host_terminator().source);\n\t}\n\tget_fuzzy_mail_host() {\n\t\treturn this.cache.src_fuzzy_mail_host ??= new RegExp(\"(?:\" + this.get_ipv6_mail_host().source + `|(?:(?:(?:${this.get_domain().source})[.]){1,4}${this.get_domain_root().source}))` + this.get_host_terminator().source);\n\t}\n\tget_path_extra() {\n\t\treturn this.cache.src_path_extra ??= /* @__PURE__ */ new RegExp(\"\");\n\t}\n\tget_fuzzy_mail_host_search() {\n\t\treturn this.cache.mail_fuzzy_host_search ??= new RegExp(`@${this.get_fuzzy_mail_host().source}`, \"ig\");\n\t}\n\tget_fuzzy_link_search() {\n\t\treturn this.cache.link_fuzzy_search ??= new RegExp(`(^|(?![.:/\\\\-_@])(?:[$+<=>^\\`|\\uff5c]|${this.src_ZPCc}))(?:(?![$+<=>^\\`|\\uff5c])${this.get_fuzzy_url_host_port().source}${this.get_path().source})`, \"ig\");\n\t}\n\tget_http_validator() {\n\t\treturn this.cache.http_validator ??= new RegExp(\"\\\\/\\\\/\" + (this.opts.urlAuth ? this.get_auth().source : \"\") + this.get_url_host_port().source + this.get_path().source, \"iy\");\n\t}\n\tget_relative_proto_validator() {\n\t\treturn this.cache.relative_proto_validator ??= new RegExp((this.opts.urlAuth ? this.get_auth().source : \"\") + `(?:localhost|${this.get_ipv6_url_host().source}|(?:(?:${this.get_domain().source})[.]){1,10}${this.get_domain_root().source})` + this.get_port().source + this.get_host_terminator().source + this.get_path().source, \"iy\");\n\t}\n\tget_mail_name_validator() {\n\t\treturn this.cache.mail_name_validator ??= new RegExp(`(?:^|${this.get_text_separators().source}|\"|\\\\(|${this.src_ZCc})(${this.get_mail_name().source})$`);\n\t}\n\tget_mailto_validator() {\n\t\treturn this.cache.mailto_validator ??= new RegExp(`${this.get_mail_name().source}@${this.get_mail_host().source}`, \"iy\");\n\t}\n\tget_schema_names() {\n\t\treturn this.cache.schema_names ??= new RegExp((this.opts.schema_names || []).map((name) => this.escapeRE(name)).join(\"|\"));\n\t}\n\tget_schema_search() {\n\t\treturn this.cache.schema_search ??= new RegExp(`(^|(?!_)(?:[><\\uff5c]|${this.src_ZPCc}))(${this.get_schema_names().source})`, \"ig\");\n\t}\n\tget_schema_at_start() {\n\t\treturn this.cache.schema_at_start ??= new RegExp(`^${this.get_schema_search().source}`, \"i\");\n\t}\n};\n//#endregion\n//#region src/linkifyit.ts\nvar web_schema = {\n\tvalidate: (text, pos, self) => {\n\t\tconst re = self.re.get_http_validator();\n\t\tre.lastIndex = pos;\n\t\tconst m = re.exec(text);\n\t\treturn m ? m[0].length : 0;\n\t},\n\tnormalize: (match, self) => self.normalize(match)\n};\nvar defaultSchemas = {\n\t\"http:\": web_schema,\n\t\"https:\": web_schema,\n\t\"ftp:\": web_schema,\n\t\"//\": {\n\t\tvalidate: function(text, pos, self) {\n\t\t\tconst re = self.re.get_relative_proto_validator();\n\t\t\tre.lastIndex = pos;\n\t\t\tconst m = re.exec(text);\n\t\t\tif (m) {\n\t\t\t\tif (pos >= 3 && text[pos - 3] === \":\") return 0;\n\t\t\t\tif (pos >= 3 && text[pos - 3] === \"/\") return 0;\n\t\t\t\treturn m[0].length;\n\t\t\t}\n\t\t\treturn 0;\n\t\t},\n\t\tnormalize: (match, self) => self.normalize(match)\n\t},\n\t\"mailto:\": {\n\t\tvalidate: function(text, pos, self) {\n\t\t\tconst re = self.re.get_mailto_validator();\n\t\t\tre.lastIndex = pos;\n\t\t\tconst m = re.exec(text);\n\t\t\treturn m ? m[0].length : 0;\n\t\t},\n\t\tnormalize: (match, self) => self.normalize(match)\n\t}\n};\nvar tlds_2ch = \"a:cdefgilmnoqrstuwxz|b:abdefghijmnorstvwyz|c:acdfghiklmnoruvwxyz|d:ejkmoz|e:cegrstu|f:ijkmor|g:abdefghilmnpqrstuwy|h:kmnrtu|i:delmnoqrst|j:emop|k:eghimnprwyz|l:abcikrstuvy|m:acdeghklmnopqrstuvwxyz|n:acefgilopruz|o:m|p:aefghklmnrstwy|q:a|r:eosuw|s:abcdeghijklmnortuvxyz|t:cdfghjklmnortvwz|u:agksyz|v:aceginu|w:fs|y:et|z:amw\";\nvar tlds_default = \"biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф\";\nfunction unpackTlds() {\n\tconst result = tlds_default.split(\"|\");\n\ttlds_2ch.split(\"|\").forEach((item) => {\n\t\tconst sep = item.indexOf(\":\");\n\t\tconst prefix = item.slice(0, sep);\n\t\tfor (const suffix of item.slice(sep + 1)) result.push(prefix + suffix);\n\t});\n\treturn result;\n}\nvar defaultOptions = {\n\tfuzzyLink: false,\n\tfuzzyEmail: true,\n\tfuzzyIP: false,\n\t\"---\": false,\n\ttlds: unpackTlds(),\n\turlAuth: false,\n\tmaxLength: 1e4\n};\n/**\n* Match result returned by {@link LinkifyIt.match} and\n* {@link LinkifyIt.matchAtStart}.\n*\n* @category types\n*/\nvar Match = class {\n\t/** Prefix (protocol) for matched string. Empty for fuzzy links. */\n\tschema;\n\t/** First position of matched string. */\n\tindex;\n\t/** Next position after matched string. */\n\tlastIndex;\n\t/** Matched string. */\n\traw;\n\t/** Normalized text of matched string. */\n\ttext;\n\t/** Normalized URL of matched string. */\n\turl;\n\tconstructor(text, schema, index, lastIndex) {\n\t\tconst raw = text.slice(index, lastIndex);\n\t\tthis.schema = schema.toLowerCase();\n\t\tthis.index = index;\n\t\tthis.lastIndex = lastIndex;\n\t\tthis.raw = raw;\n\t\tthis.text = raw;\n\t\tthis.url = raw;\n\t}\n};\n/** Linkifier instance. */\nvar LinkifyIt = class {\n\t__opts__;\n\t__schemas__;\n\tre;\n\t/**\n\t* Creates new linkifier instance.\n\t*\n\t* By default understands:\n\t*\n\t* - `http(s)://...` , `ftp://...`, `mailto:...` & `//...` links\n\t* - \"fuzzy\" emails (foo@bar.com).\n\t*\n\t* See {@link LinkifyConstructorOptions} for available options.\n\t*\n\t* @param options Recognition options.\n\t*\n\t* @example\n\t* ```javascript\n\t* import { LinkifyIt } from 'linkify-it'\n\t*\n\t* const linkify = new LinkifyIt({ fuzzyLink: true })\n\t*\n\t* linkify\n\t* .tlds(require('tlds')) // Reload with full TLD list\n\t* .tlds('onion', true) // Add unofficial `.onion` domain\n\t* .add('ftp:', null) // Disable `ftp:` protocol\n\t* .set({ fuzzyIP: true }) // Enable IPs in fuzzy links\n\t*\n\t* console.log(linkify.test('Site github.com!')) // true\n\t* console.log(linkify.match('Site github.com!'))\n\t* ```\n\t*/\n\tconstructor(options = {}) {\n\t\tconst { rebuilder, ...linkifyOptions } = options;\n\t\tthis.__opts__ = {\n\t\t\t...defaultOptions,\n\t\t\t...linkifyOptions\n\t\t};\n\t\tthis.__schemas__ = { ...defaultSchemas };\n\t\tthis.re = rebuilder || new REBuilder();\n\t\tthis.re.set({\n\t\t\t...this.__opts__,\n\t\t\tschema_names: Object.keys(this.__schemas__)\n\t\t});\n\t}\n\t/**\n\t* Add new rule definition.\n\t*\n\t* `schema` is a link prefix (usually, protocol name with `:` at the end,\n\t* `skype:` for example). `linkify-it` makes sure that prefix is not\n\t* preceded with alphanumeric char and symbols. Only whitespaces and\n\t* punctuation allowed.\n\t*\n\t* `definition` is a rule to check tail after link prefix. To disable an\n\t* existing rule, pass `null`.\n\t*\n\t* @param schema Rule name (fixed pattern prefix).\n\t* @param definition Schema definition, or `null` to disable the rule.\n\t*\n\t* See [twitter mentions example](https://github.com/markdown-it/linkify-it/blob/master/examples/twitter.mjs).\n\t*/\n\tadd(schema, definition = null) {\n\t\tif (!definition) delete this.__schemas__[schema];\n\t\telse {\n\t\t\tconst def = {\n\t\t\t\tnormalize: (match, self) => self.normalize(match),\n\t\t\t\t...definition\n\t\t\t};\n\t\t\tthis.__schemas__[schema] = def;\n\t\t}\n\t\tthis.re.set({\n\t\t\t...this.__opts__,\n\t\t\tschema_names: Object.keys(this.__schemas__)\n\t\t});\n\t\treturn this;\n\t}\n\t/**\n\t* Set recognition options for links without schema.\n\t*\n\t* @param options Recognition options.\n\t*/\n\tset(options = {}) {\n\t\tthis.__opts__ = {\n\t\t\t...this.__opts__,\n\t\t\t...options\n\t\t};\n\t\tthis.re.set({\n\t\t\t...this.__opts__,\n\t\t\tschema_names: Object.keys(this.__schemas__)\n\t\t});\n\t\treturn this;\n\t}\n\t/**\n\t* Searches linkifiable pattern and returns `true` on success or `false` on fail.\n\t*\n\t* @param text Text to scan.\n\t*/\n\ttest(text) {\n\t\tif (!text.length) return false;\n\t\tlet m, re;\n\t\tre = this.re.get_schema_search();\n\t\tre.lastIndex = 0;\n\t\twhile ((m = re.exec(text)) !== null) if (this.testSchemaAt(text, m[2], re.lastIndex)) return true;\n\t\tif (this.__opts__.fuzzyLink && this.__schemas__[\"http:\"]) {\n\t\t\tre = this.re.get_fuzzy_link_search();\n\t\t\tre.lastIndex = 0;\n\t\t\tif (re.exec(text) !== null) return true;\n\t\t}\n\t\tif (this.__opts__.fuzzyEmail && this.__schemas__[\"mailto:\"]) {\n\t\t\tif (text.indexOf(\"@\") >= 0) {\n\t\t\t\tconst mailHostRe = this.re.get_fuzzy_mail_host_search();\n\t\t\t\tconst mailNameRe = this.re.get_mail_name_validator();\n\t\t\t\tmailHostRe.lastIndex = 0;\n\t\t\t\twhile ((m = mailHostRe.exec(text)) !== null) {\n\t\t\t\t\tconst name = text.slice(Math.max(0, m.index - 65), m.index);\n\t\t\t\t\tif (mailNameRe.test(name)) return true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\t/**\n\t* Similar to {@link LinkifyIt.test} but checks only specific protocol tail exactly\n\t* at given position. Returns length of found pattern (0 on fail).\n\t*\n\t* @param text Text to scan.\n\t* @param schema Rule (schema) name.\n\t* @param pos Text offset to check from.\n\t*/\n\ttestSchemaAt(text, schema, pos) {\n\t\tif (!this.__schemas__[schema.toLowerCase()]) return 0;\n\t\treturn this.__schemas__[schema.toLowerCase()].validate(text.slice(0, pos + this.__opts__.maxLength), pos, this);\n\t}\n\t/**\n\t* Returns array of found link descriptions or `null` on fail. We strongly\n\t* recommend to use {@link LinkifyIt.test} first, for best speed.\n\t*\n\t* @param text Text to scan.\n\t*/\n\tmatch(text) {\n\t\tconst result = [];\n\t\tconst schemaRe = this.re.get_schema_search();\n\t\tlet fuzzyLinkRe;\n\t\tlet mailHostRe;\n\t\tlet mailNameRe;\n\t\tlet fuzzyLinkCandidate;\n\t\tlet fuzzyEmailCandidate;\n\t\tlet schemaPrefix;\n\t\tlet schemaDone = false;\n\t\tlet fuzzyLinkDone = false;\n\t\tlet fuzzyEmailDone = false;\n\t\tlet pos = 0;\n\t\tif (!text.length) return null;\n\t\tschemaRe.lastIndex = 0;\n\t\tif (this.__opts__.fuzzyLink && this.__schemas__[\"http:\"]) {\n\t\t\tfuzzyLinkRe = this.re.get_fuzzy_link_search();\n\t\t\tfuzzyLinkRe.lastIndex = 0;\n\t\t}\n\t\tif (this.__opts__.fuzzyEmail && this.__schemas__[\"mailto:\"]) {\n\t\t\tmailHostRe = this.re.get_fuzzy_mail_host_search();\n\t\t\tmailHostRe.lastIndex = 0;\n\t\t\tmailNameRe = this.re.get_mail_name_validator();\n\t\t}\n\t\tfor (;;) {\n\t\t\tconst scanFrom = Math.max(pos - 1, 0);\n\t\t\tif (mailHostRe && mailNameRe && !fuzzyEmailDone && (!fuzzyEmailCandidate || fuzzyEmailCandidate.index < pos)) {\n\t\t\t\tif (mailHostRe.lastIndex < scanFrom) mailHostRe.lastIndex = scanFrom;\n\t\t\t\tfor (;;) {\n\t\t\t\t\tconst m = mailHostRe.exec(text);\n\t\t\t\t\tif (!m) {\n\t\t\t\t\t\tfuzzyEmailDone = true;\n\t\t\t\t\t\tfuzzyEmailCandidate = void 0;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tconst name = mailNameRe.exec(text.slice(Math.max(0, m.index - 65), m.index));\n\t\t\t\t\tif (!name) continue;\n\t\t\t\t\tfuzzyEmailCandidate = {\n\t\t\t\t\t\tschema: \"mailto:\",\n\t\t\t\t\t\tindex: m.index - name[1].length,\n\t\t\t\t\t\tlastIndex: m.index + m[0].length\n\t\t\t\t\t};\n\t\t\t\t\tif (fuzzyEmailCandidate.index >= pos) break;\n\t\t\t\t\tif (mailHostRe.lastIndex < scanFrom) mailHostRe.lastIndex = scanFrom;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (fuzzyLinkRe && !fuzzyLinkDone && (!fuzzyLinkCandidate || fuzzyLinkCandidate.index < pos)) {\n\t\t\t\tif (fuzzyLinkRe.lastIndex < scanFrom) fuzzyLinkRe.lastIndex = scanFrom;\n\t\t\t\tfor (;;) {\n\t\t\t\t\tconst m = fuzzyLinkRe.exec(text);\n\t\t\t\t\tif (!m) {\n\t\t\t\t\t\tfuzzyLinkDone = true;\n\t\t\t\t\t\tfuzzyLinkCandidate = void 0;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tfuzzyLinkCandidate = {\n\t\t\t\t\t\tschema: \"\",\n\t\t\t\t\t\tindex: m.index + m[1].length,\n\t\t\t\t\t\tlastIndex: m.index + m[0].length\n\t\t\t\t\t};\n\t\t\t\t\tif (fuzzyLinkCandidate.index >= pos) break;\n\t\t\t\t\tif (fuzzyLinkRe.lastIndex < scanFrom) fuzzyLinkRe.lastIndex = scanFrom;\n\t\t\t\t}\n\t\t\t}\n\t\t\tlet fuzzyCandidate = fuzzyEmailCandidate;\n\t\t\tif (!fuzzyCandidate || fuzzyLinkCandidate && (fuzzyLinkCandidate.index < fuzzyCandidate.index || fuzzyLinkCandidate.index === fuzzyCandidate.index && fuzzyLinkCandidate.lastIndex > fuzzyCandidate.lastIndex)) fuzzyCandidate = fuzzyLinkCandidate;\n\t\t\tlet schemaCandidate;\n\t\t\tif (!schemaDone) for (;;) {\n\t\t\t\tif (!schemaPrefix) {\n\t\t\t\t\tif (schemaRe.lastIndex < scanFrom) schemaRe.lastIndex = scanFrom;\n\t\t\t\t\tconst m = schemaRe.exec(text);\n\t\t\t\t\tif (!m) {\n\t\t\t\t\t\tschemaDone = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tschemaPrefix = {\n\t\t\t\t\t\tschema: m[2],\n\t\t\t\t\t\tindex: m.index + m[1].length,\n\t\t\t\t\t\tlastIndex: m.index + m[0].length\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tif (schemaPrefix.index < pos) {\n\t\t\t\t\tschemaPrefix = void 0;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (fuzzyCandidate && schemaPrefix.index > fuzzyCandidate.index) break;\n\t\t\t\tconst prefix = schemaPrefix;\n\t\t\t\tschemaPrefix = void 0;\n\t\t\t\tconst len = this.testSchemaAt(text, prefix.schema, prefix.lastIndex);\n\t\t\t\tif (len) {\n\t\t\t\t\tschemaCandidate = {\n\t\t\t\t\t\tschema: prefix.schema,\n\t\t\t\t\t\tindex: prefix.index,\n\t\t\t\t\t\tlastIndex: prefix.lastIndex + len\n\t\t\t\t\t};\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tlet candidate = schemaCandidate;\n\t\t\tif (!candidate || fuzzyEmailCandidate && (fuzzyEmailCandidate.index < candidate.index || fuzzyEmailCandidate.index === candidate.index && fuzzyEmailCandidate.lastIndex > candidate.lastIndex)) candidate = fuzzyEmailCandidate;\n\t\t\tif (!candidate || fuzzyLinkCandidate && (fuzzyLinkCandidate.index < candidate.index || fuzzyLinkCandidate.index === candidate.index && fuzzyLinkCandidate.lastIndex > candidate.lastIndex)) candidate = fuzzyLinkCandidate;\n\t\t\tif (!candidate) break;\n\t\t\tif (candidate === fuzzyEmailCandidate) fuzzyEmailCandidate = void 0;\n\t\t\telse if (candidate === fuzzyLinkCandidate) fuzzyLinkCandidate = void 0;\n\t\t\tconst match = new Match(text, candidate.schema, candidate.index, candidate.lastIndex);\n\t\t\tif (match.schema) this.__schemas__[match.schema].normalize(match, this);\n\t\t\telse this.normalize(match);\n\t\t\tresult.push(match);\n\t\t\tpos = candidate.lastIndex;\n\t\t}\n\t\tif (result.length) return result;\n\t\treturn null;\n\t}\n\t/**\n\t* Returns fully-formed (not fuzzy) link if it starts at the beginning\n\t* of the string, and null otherwise.\n\t*\n\t* @param text Text to scan.\n\t*/\n\tmatchAtStart(text) {\n\t\tif (!text.length) return null;\n\t\tconst m = this.re.get_schema_at_start().exec(text);\n\t\tif (!m) return null;\n\t\tconst len = this.testSchemaAt(text, m[2], m[0].length);\n\t\tif (!len) return null;\n\t\tconst match = new Match(text, m[2], m.index + m[1].length, m.index + m[0].length + len);\n\t\tthis.__schemas__[match.schema].normalize(match, this);\n\t\treturn match;\n\t}\n\t/**\n\t* Load (or merge) new TLDs list. Those are used for fuzzy links (without\n\t* prefix) to avoid false positives. By default this algorithm is used:\n\t*\n\t* - hostname with any 2-letter root zones are ok.\n\t* - biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф\n\t* are ok.\n\t* - encoded (`xn--...`) root zones are ok.\n\t*\n\t* If list is replaced, then exact match for 2-chars root zones will be checked.\n\t*\n\t* @param list List of TLDs.\n\t* @param keepOld Merge with current list if `true` (`false` by default).\n\t*/\n\ttlds(list, keepOld = false) {\n\t\tlist = Array.isArray(list) ? list : [list];\n\t\tif (!keepOld) this.__opts__.tlds = list;\n\t\telse this.__opts__.tlds = this.__opts__.tlds.concat(list);\n\t\tthis.re.set({\n\t\t\t...this.__opts__,\n\t\t\tschema_names: Object.keys(this.__schemas__)\n\t\t});\n\t\treturn this;\n\t}\n\t/**\n\t* Default normalizer (if schema does not define its own).\n\t*\n\t* @param match Match to normalize.\n\t*/\n\tnormalize(match) {\n\t\tif (!match.schema) match.url = `http://${match.url}`;\n\t\tif (match.schema === \"mailto:\" && !/^mailto:/i.test(match.url)) match.url = `mailto:${match.url}`;\n\t}\n};\nfunction linkifyit(options = {}) {\n\treturn new LinkifyIt(options);\n}\n//#endregion\nexport { LinkifyIt, REBuilder, linkifyit };\n\n//# sourceMappingURL=index.mjs.map","'use strict';\n\n/** Highest positive signed 32-bit float value */\nconst maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1\n\n/** Bootstring parameters */\nconst base = 36;\nconst tMin = 1;\nconst tMax = 26;\nconst skew = 38;\nconst damp = 700;\nconst initialBias = 72;\nconst initialN = 128; // 0x80\nconst delimiter = '-'; // '\\x2D'\n\n/** Regular expressions */\nconst regexPunycode = /^xn--/;\nconst regexNonASCII = /[^\\0-\\x7F]/; // Note: U+007F DEL is excluded too.\nconst regexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g; // RFC 3490 separators\n\n/** Error messages */\nconst errors = {\n\t'overflow': 'Overflow: input needs wider integers to process',\n\t'not-basic': 'Illegal input >= 0x80 (not a basic code point)',\n\t'invalid-input': 'Invalid input'\n};\n\n/** Convenience shortcuts */\nconst baseMinusTMin = base - tMin;\nconst floor = Math.floor;\nconst stringFromCharCode = String.fromCharCode;\n\n/*--------------------------------------------------------------------------*/\n\n/**\n * A generic error utility function.\n * @private\n * @param {String} type The error type.\n * @returns {Error} Throws a `RangeError` with the applicable error message.\n */\nfunction error(type) {\n\tthrow new RangeError(errors[type]);\n}\n\n/**\n * A generic `Array#map` utility function.\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} callback The function that gets called for every array\n * item.\n * @returns {Array} A new array of values returned by the callback function.\n */\nfunction map(array, callback) {\n\tconst result = [];\n\tlet length = array.length;\n\twhile (length--) {\n\t\tresult[length] = callback(array[length]);\n\t}\n\treturn result;\n}\n\n/**\n * A simple `Array#map`-like wrapper to work with domain name strings or email\n * addresses.\n * @private\n * @param {String} domain The domain name or email address.\n * @param {Function} callback The function that gets called for every\n * character.\n * @returns {String} A new string of characters returned by the callback\n * function.\n */\nfunction mapDomain(domain, callback) {\n\tconst parts = domain.split('@');\n\tlet result = '';\n\tif (parts.length > 1) {\n\t\t// In email addresses, only the domain name should be punycoded. Leave\n\t\t// the local part (i.e. everything up to `@`) intact.\n\t\tresult = parts[0] + '@';\n\t\tdomain = parts[1];\n\t}\n\t// Avoid `split(regex)` for IE8 compatibility. See #17.\n\tdomain = domain.replace(regexSeparators, '\\x2E');\n\tconst labels = domain.split('.');\n\tconst encoded = map(labels, callback).join('.');\n\treturn result + encoded;\n}\n\n/**\n * Creates an array containing the numeric code points of each Unicode\n * character in the string. While JavaScript uses UCS-2 internally,\n * this function will convert a pair of surrogate halves (each of which\n * UCS-2 exposes as separate characters) into a single code point,\n * matching UTF-16.\n * @see `punycode.ucs2.encode`\n * @see <https://mathiasbynens.be/notes/javascript-encoding>\n * @memberOf punycode.ucs2\n * @name decode\n * @param {String} string The Unicode input string (UCS-2).\n * @returns {Array} The new array of code points.\n */\nfunction ucs2decode(string) {\n\tconst output = [];\n\tlet counter = 0;\n\tconst length = string.length;\n\twhile (counter < length) {\n\t\tconst value = string.charCodeAt(counter++);\n\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t// It's a high surrogate, and there is a next character.\n\t\t\tconst extra = string.charCodeAt(counter++);\n\t\t\tif ((extra & 0xFC00) == 0xDC00) { // Low surrogate.\n\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t} else {\n\t\t\t\t// It's an unmatched surrogate; only append this code unit, in case the\n\t\t\t\t// next code unit is the high surrogate of a surrogate pair.\n\t\t\t\toutput.push(value);\n\t\t\t\tcounter--;\n\t\t\t}\n\t\t} else {\n\t\t\toutput.push(value);\n\t\t}\n\t}\n\treturn output;\n}\n\n/**\n * Creates a string based on an array of numeric code points.\n * @see `punycode.ucs2.decode`\n * @memberOf punycode.ucs2\n * @name encode\n * @param {Array} codePoints The array of numeric code points.\n * @returns {String} The new Unicode string (UCS-2).\n */\nconst ucs2encode = codePoints => String.fromCodePoint(...codePoints);\n\n/**\n * Converts a basic code point into a digit/integer.\n * @see `digitToBasic()`\n * @private\n * @param {Number} codePoint The basic numeric code point value.\n * @returns {Number} The numeric value of a basic code point (for use in\n * representing integers) in the range `0` to `base - 1`, or `base` if\n * the code point does not represent a value.\n */\nconst basicToDigit = function(codePoint) {\n\tif (codePoint >= 0x30 && codePoint < 0x3A) {\n\t\treturn 26 + (codePoint - 0x30);\n\t}\n\tif (codePoint >= 0x41 && codePoint < 0x5B) {\n\t\treturn codePoint - 0x41;\n\t}\n\tif (codePoint >= 0x61 && codePoint < 0x7B) {\n\t\treturn codePoint - 0x61;\n\t}\n\treturn base;\n};\n\n/**\n * Converts a digit/integer into a basic code point.\n * @see `basicToDigit()`\n * @private\n * @param {Number} digit The numeric value of a basic code point.\n * @returns {Number} The basic code point whose value (when used for\n * representing integers) is `digit`, which needs to be in the range\n * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is\n * used; else, the lowercase form is used. The behavior is undefined\n * if `flag` is non-zero and `digit` has no uppercase form.\n */\nconst digitToBasic = function(digit, flag) {\n\t// 0..25 map to ASCII a..z or A..Z\n\t// 26..35 map to ASCII 0..9\n\treturn digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n};\n\n/**\n * Bias adaptation function as per section 3.4 of RFC 3492.\n * https://tools.ietf.org/html/rfc3492#section-3.4\n * @private\n */\nconst adapt = function(delta, numPoints, firstTime) {\n\tlet k = 0;\n\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\tdelta += floor(delta / numPoints);\n\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\tdelta = floor(delta / baseMinusTMin);\n\t}\n\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n};\n\n/**\n * Converts a Punycode string of ASCII-only symbols to a string of Unicode\n * symbols.\n * @memberOf punycode\n * @param {String} input The Punycode string of ASCII-only symbols.\n * @returns {String} The resulting string of Unicode symbols.\n */\nconst decode = function(input) {\n\t// Don't use UCS-2.\n\tconst output = [];\n\tconst inputLength = input.length;\n\tlet i = 0;\n\tlet n = initialN;\n\tlet bias = initialBias;\n\n\t// Handle the basic code points: let `basic` be the number of input code\n\t// points before the last delimiter, or `0` if there is none, then copy\n\t// the first basic code points to the output.\n\n\tlet basic = input.lastIndexOf(delimiter);\n\tif (basic < 0) {\n\t\tbasic = 0;\n\t}\n\n\tfor (let j = 0; j < basic; ++j) {\n\t\t// if it's not a basic code point\n\t\tif (input.charCodeAt(j) >= 0x80) {\n\t\t\terror('not-basic');\n\t\t}\n\t\toutput.push(input.charCodeAt(j));\n\t}\n\n\t// Main decoding loop: start just after the last delimiter if any basic code\n\t// points were copied; start at the beginning otherwise.\n\n\tfor (let index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {\n\n\t\t// `index` is the index of the next character to be consumed.\n\t\t// Decode a generalized variable-length integer into `delta`,\n\t\t// which gets added to `i`. The overflow checking is easier\n\t\t// if we increase `i` as we go, then subtract off its starting\n\t\t// value at the end to obtain `delta`.\n\t\tconst oldi = i;\n\t\tfor (let w = 1, k = base; /* no condition */; k += base) {\n\n\t\t\tif (index >= inputLength) {\n\t\t\t\terror('invalid-input');\n\t\t\t}\n\n\t\t\tconst digit = basicToDigit(input.charCodeAt(index++));\n\n\t\t\tif (digit >= base) {\n\t\t\t\terror('invalid-input');\n\t\t\t}\n\t\t\tif (digit > floor((maxInt - i) / w)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\ti += digit * w;\n\t\t\tconst t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\n\t\t\tif (digit < t) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tconst baseMinusT = base - t;\n\t\t\tif (w > floor(maxInt / baseMinusT)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\tw *= baseMinusT;\n\n\t\t}\n\n\t\tconst out = output.length + 1;\n\t\tbias = adapt(i - oldi, out, oldi == 0);\n\n\t\t// `i` was supposed to wrap around from `out` to `0`,\n\t\t// incrementing `n` each time, so we'll fix that now:\n\t\tif (floor(i / out) > maxInt - n) {\n\t\t\terror('overflow');\n\t\t}\n\n\t\tn += floor(i / out);\n\t\ti %= out;\n\n\t\t// Insert `n` at position `i` of the output.\n\t\toutput.splice(i++, 0, n);\n\n\t}\n\n\treturn String.fromCodePoint(...output);\n};\n\n/**\n * Converts a string of Unicode symbols (e.g. a domain name label) to a\n * Punycode string of ASCII-only symbols.\n * @memberOf punycode\n * @param {String} input The string of Unicode symbols.\n * @returns {String} The resulting Punycode string of ASCII-only symbols.\n */\nconst encode = function(input) {\n\tconst output = [];\n\n\t// Convert the input in UCS-2 to an array of Unicode code points.\n\tinput = ucs2decode(input);\n\n\t// Cache the length.\n\tconst inputLength = input.length;\n\n\t// Initialize the state.\n\tlet n = initialN;\n\tlet delta = 0;\n\tlet bias = initialBias;\n\n\t// Handle the basic code points.\n\tfor (const currentValue of input) {\n\t\tif (currentValue < 0x80) {\n\t\t\toutput.push(stringFromCharCode(currentValue));\n\t\t}\n\t}\n\n\tconst basicLength = output.length;\n\tlet handledCPCount = basicLength;\n\n\t// `handledCPCount` is the number of code points that have been handled;\n\t// `basicLength` is the number of basic code points.\n\n\t// Finish the basic string with a delimiter unless it's empty.\n\tif (basicLength) {\n\t\toutput.push(delimiter);\n\t}\n\n\t// Main encoding loop:\n\twhile (handledCPCount < inputLength) {\n\n\t\t// All non-basic code points < n have been handled already. Find the next\n\t\t// larger one:\n\t\tlet m = maxInt;\n\t\tfor (const currentValue of input) {\n\t\t\tif (currentValue >= n && currentValue < m) {\n\t\t\t\tm = currentValue;\n\t\t\t}\n\t\t}\n\n\t\t// Increase `delta` enough to advance the decoder's <n,i> state to <m,0>,\n\t\t// but guard against overflow.\n\t\tconst handledCPCountPlusOne = handledCPCount + 1;\n\t\tif (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n\t\t\terror('overflow');\n\t\t}\n\n\t\tdelta += (m - n) * handledCPCountPlusOne;\n\t\tn = m;\n\n\t\tfor (const currentValue of input) {\n\t\t\tif (currentValue < n && ++delta > maxInt) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\t\t\tif (currentValue === n) {\n\t\t\t\t// Represent delta as a generalized variable-length integer.\n\t\t\t\tlet q = delta;\n\t\t\t\tfor (let k = base; /* no condition */; k += base) {\n\t\t\t\t\tconst t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\t\t\t\tif (q < t) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tconst qMinusT = q - t;\n\t\t\t\t\tconst baseMinusT = base - t;\n\t\t\t\t\toutput.push(\n\t\t\t\t\t\tstringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))\n\t\t\t\t\t);\n\t\t\t\t\tq = floor(qMinusT / baseMinusT);\n\t\t\t\t}\n\n\t\t\t\toutput.push(stringFromCharCode(digitToBasic(q, 0)));\n\t\t\t\tbias = adapt(delta, handledCPCountPlusOne, handledCPCount === basicLength);\n\t\t\t\tdelta = 0;\n\t\t\t\t++handledCPCount;\n\t\t\t}\n\t\t}\n\n\t\t++delta;\n\t\t++n;\n\n\t}\n\treturn output.join('');\n};\n\n/**\n * Converts a Punycode string representing a domain name or an email address\n * to Unicode. Only the Punycoded parts of the input will be converted, i.e.\n * it doesn't matter if you call it on a string that has already been\n * converted to Unicode.\n * @memberOf punycode\n * @param {String} input The Punycoded domain name or email address to\n * convert to Unicode.\n * @returns {String} The Unicode representation of the given Punycode\n * string.\n */\nconst toUnicode = function(input) {\n\treturn mapDomain(input, function(string) {\n\t\treturn regexPunycode.test(string)\n\t\t\t? decode(string.slice(4).toLowerCase())\n\t\t\t: string;\n\t});\n};\n\n/**\n * Converts a Unicode string representing a domain name or an email address to\n * Punycode. Only the non-ASCII parts of the domain name will be converted,\n * i.e. it doesn't matter if you call it with a domain that's already in\n * ASCII.\n * @memberOf punycode\n * @param {String} input The domain name or email address to convert, as a\n * Unicode string.\n * @returns {String} The Punycode representation of the given domain name or\n * email address.\n */\nconst toASCII = function(input) {\n\treturn mapDomain(input, function(string) {\n\t\treturn regexNonASCII.test(string)\n\t\t\t? 'xn--' + encode(string)\n\t\t\t: string;\n\t});\n};\n\n/*--------------------------------------------------------------------------*/\n\n/** Define the public API */\nconst punycode = {\n\t/**\n\t * A string representing the current Punycode.js version number.\n\t * @memberOf punycode\n\t * @type String\n\t */\n\t'version': '2.3.1',\n\t/**\n\t * An object of methods to convert from JavaScript's internal character\n\t * representation (UCS-2) to Unicode code points, and back.\n\t * @see <https://mathiasbynens.be/notes/javascript-encoding>\n\t * @memberOf punycode\n\t * @type Object\n\t */\n\t'ucs2': {\n\t\t'decode': ucs2decode,\n\t\t'encode': ucs2encode\n\t},\n\t'decode': decode,\n\t'encode': encode,\n\t'toASCII': toASCII,\n\t'toUnicode': toUnicode\n};\n\nexport { ucs2decode, ucs2encode, decode, encode, toASCII, toUnicode };\nexport default punycode;\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,5,6,7,8,9,10,60,61],"mappings":";;;;;;;;;GAEM,IAAc,CAAC;AAErB,SAAS,EAAgB,GAAS;CAChC,IAAI,IAAQ,EAAY;CACxB,IAAI,GAAS,OAAO;CAEpB,IAAQ,EAAY,KAAW,CAAC;CAEhC,KAAK,IAAI,IAAI,GAAG,IAAI,KAAK,KAAK;EAC5B,IAAM,IAAK,OAAO,aAAa,CAAC;EAChC,EAAM,KAAK,CAAE;CACf;CAEA,KAAK,IAAI,IAAI,GAAG,IAAI,EAAQ,QAAQ,KAAK;EACvC,IAAM,IAAK,EAAQ,WAAW,CAAC;EAC/B,EAAM,KAAM,OAAO,MAAM,EAAG,SAAS,EAAE,CAAC,CAAC,YAAY,EAAA,CAAG,MAAM,EAAE;CAClE;CAEA,OAAO;AACT;AAIA,SAASA,EAAQ,GAAQ,GAAS;CAChC,AAAI,OAAO,KAAY,aACrB,IAAUA,EAAO;CAGnB,IAAM,IAAQ,EAAe,CAAO;CAEpC,OAAO,EAAO,QAAQ,qBAAqB,SAAU,GAAK;EACxD,IAAI,IAAS;EAEb,KAAK,IAAI,IAAI,GAAG,IAAI,EAAI,QAAQ,IAAI,GAAG,KAAK,GAAG;GAC7C,IAAM,IAAK,SAAS,EAAI,MAAM,IAAI,GAAG,IAAI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EAChD,OAAO,KAAK,SAAS,OAAO,KAAK,YAAY,GAAK,CAAG,GAAG,KAAK,SAAS,CAAG;CAC3E;AAWF;AATS,EAAA,GAAA,SAAQ,CAAA,GACR,EAAA,GAAA,SAAQ,CAAA,GACR,EAAA,GAAA,YAAW,EAAA,GACX,EAAA,GAAA,cAAa,EAAA,GACb,EAAA,GAAA,aAAY,EAAA,GACZ,EAAA,GAAA,eAAc,EAAA,GACd,EAAA,GAAA,cAAa,EAAA,GACb,EAAA,GAAA,gBAAe,EAAA,GACf,EAAA,GAAA,eAAc,EAAA;;;AC3avB,IAAM,KAAqB,GAAS,CAAU"}
1
+ {"version":3,"file":"markdown-it.esm.min.mjs","names":["decode","encode"],"sources":["../../node_modules/mdurl/lib/decode.mjs","../../node_modules/mdurl/lib/encode.mjs","../../node_modules/mdurl/lib/format.mjs","../../node_modules/mdurl/lib/parse.mjs","../../node_modules/mdurl/index.mjs","../../node_modules/uc.micro/build/index.mjs","../../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","../../node_modules/linkify-it/build/index.mjs","../../node_modules/punycode.js/punycode.es6.js","../../src/presets/default.ts","../../src/presets/zero.ts","../../src/presets/commonmark.ts","../../src/markdownit.ts","../../src/index.ts"],"sourcesContent":["/* eslint-disable no-bitwise */\n\nconst decodeCache = {}\n\nfunction getDecodeCache (exclude) {\n let cache = decodeCache[exclude]\n if (cache) { return cache }\n\n cache = decodeCache[exclude] = []\n\n for (let i = 0; i < 128; i++) {\n const ch = String.fromCharCode(i)\n cache.push(ch)\n }\n\n for (let i = 0; i < exclude.length; i++) {\n const ch = exclude.charCodeAt(i)\n cache[ch] = '%' + ('0' + ch.toString(16).toUpperCase()).slice(-2)\n }\n\n return cache\n}\n\n// Decode percent-encoded string.\n//\nfunction decode (string, exclude) {\n if (typeof exclude !== 'string') {\n exclude = decode.defaultChars\n }\n\n const cache = getDecodeCache(exclude)\n\n return string.replace(/(%[a-f0-9]{2})+/gi, function (seq) {\n let result = ''\n\n for (let i = 0, l = seq.length; i < l; i += 3) {\n const b1 = parseInt(seq.slice(i + 1, i + 3), 16)\n\n if (b1 < 0x80) {\n result += cache[b1]\n continue\n }\n\n if ((b1 & 0xE0) === 0xC0 && (i + 3 < l)) {\n // 110xxxxx 10xxxxxx\n const b2 = parseInt(seq.slice(i + 4, i + 6), 16)\n\n if ((b2 & 0xC0) === 0x80) {\n const chr = ((b1 << 6) & 0x7C0) | (b2 & 0x3F)\n\n if (chr < 0x80) {\n result += '\\ufffd\\ufffd'\n } else {\n result += String.fromCharCode(chr)\n }\n\n i += 3\n continue\n }\n }\n\n if ((b1 & 0xF0) === 0xE0 && (i + 6 < l)) {\n // 1110xxxx 10xxxxxx 10xxxxxx\n const b2 = parseInt(seq.slice(i + 4, i + 6), 16)\n const b3 = parseInt(seq.slice(i + 7, i + 9), 16)\n\n if ((b2 & 0xC0) === 0x80 && (b3 & 0xC0) === 0x80) {\n const chr = ((b1 << 12) & 0xF000) | ((b2 << 6) & 0xFC0) | (b3 & 0x3F)\n\n if (chr < 0x800 || (chr >= 0xD800 && chr <= 0xDFFF)) {\n result += '\\ufffd\\ufffd\\ufffd'\n } else {\n result += String.fromCharCode(chr)\n }\n\n i += 6\n continue\n }\n }\n\n if ((b1 & 0xF8) === 0xF0 && (i + 9 < l)) {\n // 111110xx 10xxxxxx 10xxxxxx 10xxxxxx\n const b2 = parseInt(seq.slice(i + 4, i + 6), 16)\n const b3 = parseInt(seq.slice(i + 7, i + 9), 16)\n const b4 = parseInt(seq.slice(i + 10, i + 12), 16)\n\n if ((b2 & 0xC0) === 0x80 && (b3 & 0xC0) === 0x80 && (b4 & 0xC0) === 0x80) {\n let chr = ((b1 << 18) & 0x1C0000) | ((b2 << 12) & 0x3F000) | ((b3 << 6) & 0xFC0) | (b4 & 0x3F)\n\n if (chr < 0x10000 || chr > 0x10FFFF) {\n result += '\\ufffd\\ufffd\\ufffd\\ufffd'\n } else {\n chr -= 0x10000\n result += String.fromCharCode(0xD800 + (chr >> 10), 0xDC00 + (chr & 0x3FF))\n }\n\n i += 9\n continue\n }\n }\n\n result += '\\ufffd'\n }\n\n return result\n })\n}\n\ndecode.defaultChars = ';/?:@&=+$,#'\ndecode.componentChars = ''\n\nexport default decode\n","const encodeCache = {}\n\n// Create a lookup array where anything but characters in `chars` string\n// and alphanumeric chars is percent-encoded.\n//\nfunction getEncodeCache (exclude) {\n let cache = encodeCache[exclude]\n if (cache) { return cache }\n\n cache = encodeCache[exclude] = []\n\n for (let i = 0; i < 128; i++) {\n const ch = String.fromCharCode(i)\n\n if (/^[0-9a-z]$/i.test(ch)) {\n // always allow unencoded alphanumeric characters\n cache.push(ch)\n } else {\n cache.push('%' + ('0' + i.toString(16).toUpperCase()).slice(-2))\n }\n }\n\n for (let i = 0; i < exclude.length; i++) {\n cache[exclude.charCodeAt(i)] = exclude[i]\n }\n\n return cache\n}\n\n// Encode unsafe characters with percent-encoding, skipping already\n// encoded sequences.\n//\n// - string - string to encode\n// - exclude - list of characters to ignore (in addition to a-zA-Z0-9)\n// - keepEscaped - don't encode '%' in a correct escape sequence (default: true)\n//\nfunction encode (string, exclude, keepEscaped) {\n if (typeof exclude !== 'string') {\n // encode(string, keepEscaped)\n keepEscaped = exclude\n exclude = encode.defaultChars\n }\n\n if (typeof keepEscaped === 'undefined') {\n keepEscaped = true\n }\n\n const cache = getEncodeCache(exclude)\n let result = ''\n\n for (let i = 0, l = string.length; i < l; i++) {\n const code = string.charCodeAt(i)\n\n if (keepEscaped && code === 0x25 /* % */ && i + 2 < l) {\n if (/^[0-9a-f]{2}$/i.test(string.slice(i + 1, i + 3))) {\n result += string.slice(i, i + 3)\n i += 2\n continue\n }\n }\n\n if (code < 128) {\n result += cache[code]\n continue\n }\n\n if (code >= 0xD800 && code <= 0xDFFF) {\n if (code >= 0xD800 && code <= 0xDBFF && i + 1 < l) {\n const nextCode = string.charCodeAt(i + 1)\n if (nextCode >= 0xDC00 && nextCode <= 0xDFFF) {\n result += encodeURIComponent(string[i] + string[i + 1])\n i++\n continue\n }\n }\n result += '%EF%BF%BD'\n continue\n }\n\n result += encodeURIComponent(string[i])\n }\n\n return result\n}\n\nencode.defaultChars = \";/?:@&=+$,-_.!~*'()#\"\nencode.componentChars = \"-_.!~*'()\"\n\nexport default encode\n","export default function format (url) {\n let result = ''\n\n result += url.protocol || ''\n result += url.slashes ? '//' : ''\n result += url.auth ? url.auth + '@' : ''\n\n if (url.hostname && url.hostname.indexOf(':') !== -1) {\n // ipv6 address\n result += '[' + url.hostname + ']'\n } else {\n result += url.hostname || ''\n }\n\n result += url.port ? ':' + url.port : ''\n result += url.pathname || ''\n result += url.search || ''\n result += url.hash || ''\n\n return result\n};\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n//\n// Changes from joyent/node:\n//\n// 1. No leading slash in paths,\n// e.g. in `url.parse('http://foo?bar')` pathname is ``, not `/`\n//\n// 2. Backslashes are not replaced with slashes,\n// so `http:\\\\example.org\\` is treated like a relative path\n//\n// 3. Trailing colon is treated like a part of the path,\n// i.e. in `http://example.org:foo` pathname is `:foo`\n//\n// 4. Nothing is URL-encoded in the resulting object,\n// (in joyent/node some chars in auth and paths are encoded)\n//\n// 5. `url.parse()` does not have `parseQueryString` argument\n//\n// 6. Removed extraneous result properties: `host`, `path`, `query`, etc.,\n// which can be constructed using other parts of the url.\n//\n\nfunction Url () {\n this.protocol = null\n this.slashes = null\n this.auth = null\n this.port = null\n this.hostname = null\n this.hash = null\n this.search = null\n this.pathname = null\n}\n\n// Reference: RFC 3986, RFC 1808, RFC 2396\n\n// define these here so at least they only have to be\n// compiled once on the first module load.\nconst protocolPattern = /^([a-z0-9.+-]+:)/i\nconst portPattern = /:[0-9]*$/\n\n// Special case for a simple path URL\n/* eslint-disable-next-line no-useless-escape */\nconst simplePathPattern = /^(\\/\\/?(?!\\/)[^\\?\\s]*)(\\?[^\\s]*)?$/\n\n// RFC 2396: characters reserved for delimiting URLs.\n// We actually just auto-escape these.\nconst delims = ['<', '>', '\"', '`', ' ', '\\r', '\\n', '\\t']\n\n// RFC 2396: characters not allowed for various reasons.\nconst unwise = ['{', '}', '|', '\\\\', '^', '`'].concat(delims)\n\n// Allowed by RFCs, but cause of XSS attacks. Always escape these.\nconst autoEscape = ['\\''].concat(unwise)\n// Characters that are never ever allowed in a hostname.\n// Note that any invalid chars are also handled, but these\n// are the ones that are *expected* to be seen, so we fast-path\n// them.\nconst nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape)\nconst hostEndingChars = ['/', '?', '#']\nconst hostnameMaxLen = 255\nconst hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/\nconst hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/\n// protocols that can allow \"unsafe\" and \"unwise\" chars.\n// protocols that never have a hostname.\nconst hostlessProtocol = {\n javascript: true,\n 'javascript:': true\n}\n// protocols that always contain a // bit.\nconst slashedProtocol = {\n http: true,\n https: true,\n ftp: true,\n gopher: true,\n file: true,\n 'http:': true,\n 'https:': true,\n 'ftp:': true,\n 'gopher:': true,\n 'file:': true\n}\n\nfunction urlParse (url, slashesDenoteHost) {\n if (url && url instanceof Url) return url\n\n const u = new Url()\n u.parse(url, slashesDenoteHost)\n return u\n}\n\nUrl.prototype.parse = function (url, slashesDenoteHost) {\n let lowerProto, hec, slashes\n let rest = url\n\n // trim before proceeding.\n // This is to support parse stuff like \" http://foo.com \\n\"\n rest = rest.trim()\n\n if (!slashesDenoteHost && url.split('#').length === 1) {\n // Try fast path regexp\n const simplePath = simplePathPattern.exec(rest)\n if (simplePath) {\n this.pathname = simplePath[1]\n if (simplePath[2]) {\n this.search = simplePath[2]\n }\n return this\n }\n }\n\n let proto = protocolPattern.exec(rest)\n if (proto) {\n proto = proto[0]\n lowerProto = proto.toLowerCase()\n this.protocol = proto\n rest = rest.substr(proto.length)\n }\n\n // figure out if it's got a host\n // user@server is *always* interpreted as a hostname, and url\n // resolution will treat //foo/bar as host=foo,path=bar because that's\n // how the browser resolves relative URLs.\n /* eslint-disable-next-line no-useless-escape */\n if (slashesDenoteHost || proto || rest.match(/^\\/\\/[^@\\/]+@[^@\\/]+/)) {\n slashes = rest.substr(0, 2) === '//'\n if (slashes && !(proto && hostlessProtocol[proto])) {\n rest = rest.substr(2)\n this.slashes = true\n }\n }\n\n if (!hostlessProtocol[proto] &&\n (slashes || (proto && !slashedProtocol[proto]))) {\n // there's a hostname.\n // the first instance of /, ?, ;, or # ends the host.\n //\n // If there is an @ in the hostname, then non-host chars *are* allowed\n // to the left of the last @ sign, unless some host-ending character\n // comes *before* the @-sign.\n // URLs are obnoxious.\n //\n // ex:\n // http://a@b@c/ => user:a@b host:c\n // http://a@b?@c => user:a host:c path:/?@c\n\n // v0.12 TODO(isaacs): This is not quite how Chrome does things.\n // Review our test case against browsers more comprehensively.\n\n // find the first instance of any hostEndingChars\n let hostEnd = -1\n for (let i = 0; i < hostEndingChars.length; i++) {\n hec = rest.indexOf(hostEndingChars[i])\n if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) {\n hostEnd = hec\n }\n }\n\n // at this point, either we have an explicit point where the\n // auth portion cannot go past, or the last @ char is the decider.\n let auth, atSign\n if (hostEnd === -1) {\n // atSign can be anywhere.\n atSign = rest.lastIndexOf('@')\n } else {\n // atSign must be in auth portion.\n // http://a@b/c@d => host:b auth:a path:/c@d\n atSign = rest.lastIndexOf('@', hostEnd)\n }\n\n // Now we have a portion which is definitely the auth.\n // Pull that off.\n if (atSign !== -1) {\n auth = rest.slice(0, atSign)\n rest = rest.slice(atSign + 1)\n this.auth = auth\n }\n\n // the host is the remaining to the left of the first non-host char\n hostEnd = -1\n for (let i = 0; i < nonHostChars.length; i++) {\n hec = rest.indexOf(nonHostChars[i])\n if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) {\n hostEnd = hec\n }\n }\n // if we still have not hit it, then the entire thing is a host.\n if (hostEnd === -1) {\n hostEnd = rest.length\n }\n\n if (rest[hostEnd - 1] === ':') { hostEnd-- }\n const host = rest.slice(0, hostEnd)\n rest = rest.slice(hostEnd)\n\n // pull out port.\n this.parseHost(host)\n\n // we've indicated that there is a hostname,\n // so even if it's empty, it has to be present.\n this.hostname = this.hostname || ''\n\n // if hostname begins with [ and ends with ]\n // assume that it's an IPv6 address.\n const ipv6Hostname = this.hostname[0] === '[' &&\n this.hostname[this.hostname.length - 1] === ']'\n\n // validate a little.\n if (!ipv6Hostname) {\n const hostparts = this.hostname.split(/\\./)\n for (let i = 0, l = hostparts.length; i < l; i++) {\n const part = hostparts[i]\n if (!part) { continue }\n if (!part.match(hostnamePartPattern)) {\n let newpart = ''\n for (let j = 0, k = part.length; j < k; j++) {\n if (part.charCodeAt(j) > 127) {\n // we replace non-ASCII char with a temporary placeholder\n // we need this to make sure size of hostname is not\n // broken by replacing non-ASCII by nothing\n newpart += 'x'\n } else {\n newpart += part[j]\n }\n }\n // we test again with ASCII char only\n if (!newpart.match(hostnamePartPattern)) {\n const validParts = hostparts.slice(0, i)\n const notHost = hostparts.slice(i + 1)\n const bit = part.match(hostnamePartStart)\n if (bit) {\n validParts.push(bit[1])\n notHost.unshift(bit[2])\n }\n if (notHost.length) {\n rest = notHost.join('.') + rest\n }\n this.hostname = validParts.join('.')\n break\n }\n }\n }\n }\n\n if (this.hostname.length > hostnameMaxLen) {\n this.hostname = ''\n }\n\n // strip [ and ] from the hostname\n // the host field still retains them, though\n if (ipv6Hostname) {\n this.hostname = this.hostname.substr(1, this.hostname.length - 2)\n }\n }\n\n // chop off from the tail first.\n const hash = rest.indexOf('#')\n if (hash !== -1) {\n // got a fragment string.\n this.hash = rest.substr(hash)\n rest = rest.slice(0, hash)\n }\n const qm = rest.indexOf('?')\n if (qm !== -1) {\n this.search = rest.substr(qm)\n rest = rest.slice(0, qm)\n }\n if (rest) { this.pathname = rest }\n if (slashedProtocol[lowerProto] &&\n this.hostname && !this.pathname) {\n this.pathname = ''\n }\n\n return this\n}\n\nUrl.prototype.parseHost = function (host) {\n let port = portPattern.exec(host)\n if (port) {\n port = port[0]\n if (port !== ':') {\n this.port = port.substr(1)\n }\n host = host.substr(0, host.length - port.length)\n }\n if (host) { this.hostname = host }\n}\n\nexport default urlParse\n","import decode from './lib/decode.mjs'\nimport encode from './lib/encode.mjs'\nimport format from './lib/format.mjs'\nimport parse from './lib/parse.mjs'\n\nexport {\n decode,\n encode,\n format,\n parse\n}\n","const Any = /[\\0-\\uD7FF\\uE000-\\uFFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF]/;\nconst Cc = /[\\0-\\x1F\\x7F-\\x9F]/;\nconst Cf = /[\\xAD\\u0600-\\u0605\\u061C\\u06DD\\u070F\\u0890\\u0891\\u08E2\\u180E\\u200B-\\u200F\\u202A-\\u202E\\u2060-\\u2064\\u2066-\\u206F\\uFEFF\\uFFF9-\\uFFFB]|\\uD804[\\uDCBD\\uDCCD]|\\uD80D[\\uDC30-\\uDC3F]|\\uD82F[\\uDCA0-\\uDCA3]|\\uD834[\\uDD73-\\uDD7A]|\\uDB40[\\uDC01\\uDC20-\\uDC7F]/;\nconst P = /[!-#%-\\*,-\\/:;\\?@\\[-\\]_\\{\\}\\xA1\\xA7\\xAB\\xB6\\xB7\\xBB\\xBF\\u037E\\u0387\\u055A-\\u055F\\u0589\\u058A\\u05BE\\u05C0\\u05C3\\u05C6\\u05F3\\u05F4\\u0609\\u060A\\u060C\\u060D\\u061B\\u061D-\\u061F\\u066A-\\u066D\\u06D4\\u0700-\\u070D\\u07F7-\\u07F9\\u0830-\\u083E\\u085E\\u0964\\u0965\\u0970\\u09FD\\u0A76\\u0AF0\\u0C77\\u0C84\\u0DF4\\u0E4F\\u0E5A\\u0E5B\\u0F04-\\u0F12\\u0F14\\u0F3A-\\u0F3D\\u0F85\\u0FD0-\\u0FD4\\u0FD9\\u0FDA\\u104A-\\u104F\\u10FB\\u1360-\\u1368\\u1400\\u166E\\u169B\\u169C\\u16EB-\\u16ED\\u1735\\u1736\\u17D4-\\u17D6\\u17D8-\\u17DA\\u1800-\\u180A\\u1944\\u1945\\u1A1E\\u1A1F\\u1AA0-\\u1AA6\\u1AA8-\\u1AAD\\u1B4E\\u1B4F\\u1B5A-\\u1B60\\u1B7D-\\u1B7F\\u1BFC-\\u1BFF\\u1C3B-\\u1C3F\\u1C7E\\u1C7F\\u1CC0-\\u1CC7\\u1CD3\\u2010-\\u2027\\u2030-\\u2043\\u2045-\\u2051\\u2053-\\u205E\\u207D\\u207E\\u208D\\u208E\\u2308-\\u230B\\u2329\\u232A\\u2768-\\u2775\\u27C5\\u27C6\\u27E6-\\u27EF\\u2983-\\u2998\\u29D8-\\u29DB\\u29FC\\u29FD\\u2CF9-\\u2CFC\\u2CFE\\u2CFF\\u2D70\\u2E00-\\u2E2E\\u2E30-\\u2E4F\\u2E52-\\u2E5D\\u3001-\\u3003\\u3008-\\u3011\\u3014-\\u301F\\u3030\\u303D\\u30A0\\u30FB\\uA4FE\\uA4FF\\uA60D-\\uA60F\\uA673\\uA67E\\uA6F2-\\uA6F7\\uA874-\\uA877\\uA8CE\\uA8CF\\uA8F8-\\uA8FA\\uA8FC\\uA92E\\uA92F\\uA95F\\uA9C1-\\uA9CD\\uA9DE\\uA9DF\\uAA5C-\\uAA5F\\u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F|\\uD836[\\uDE87-\\uDE8B]|\\uD839\\uDDFF|\\uD83A[\\uDD5E\\uDD5F]/;\nconst S = /[\\$\\+<->\\^`\\|~\\xA2-\\xA6\\xA8\\xA9\\xAC\\xAE-\\xB1\\xB4\\xB8\\xD7\\xF7\\u02C2-\\u02C5\\u02D2-\\u02DF\\u02E5-\\u02EB\\u02ED\\u02EF-\\u02FF\\u0375\\u0384\\u0385\\u03F6\\u0482\\u058D-\\u058F\\u0606-\\u0608\\u060B\\u060E\\u060F\\u06DE\\u06E9\\u06FD\\u06FE\\u07F6\\u07FE\\u07FF\\u0888\\u09F2\\u09F3\\u09FA\\u09FB\\u0AF1\\u0B70\\u0BF3-\\u0BFA\\u0C7F\\u0D4F\\u0D79\\u0E3F\\u0F01-\\u0F03\\u0F13\\u0F15-\\u0F17\\u0F1A-\\u0F1F\\u0F34\\u0F36\\u0F38\\u0FBE-\\u0FC5\\u0FC7-\\u0FCC\\u0FCE\\u0FCF\\u0FD5-\\u0FD8\\u109E\\u109F\\u1390-\\u1399\\u166D\\u17DB\\u1940\\u19DE-\\u19FF\\u1B61-\\u1B6A\\u1B74-\\u1B7C\\u1FBD\\u1FBF-\\u1FC1\\u1FCD-\\u1FCF\\u1FDD-\\u1FDF\\u1FED-\\u1FEF\\u1FFD\\u1FFE\\u2044\\u2052\\u207A-\\u207C\\u208A-\\u208C\\u20A0-\\u20C1\\u2100\\u2101\\u2103-\\u2106\\u2108\\u2109\\u2114\\u2116-\\u2118\\u211E-\\u2123\\u2125\\u2127\\u2129\\u212E\\u213A\\u213B\\u2140-\\u2144\\u214A-\\u214D\\u214F\\u218A\\u218B\\u2190-\\u2307\\u230C-\\u2328\\u232B-\\u2429\\u2440-\\u244A\\u249C-\\u24E9\\u2500-\\u2767\\u2794-\\u27C4\\u27C7-\\u27E5\\u27F0-\\u2982\\u2999-\\u29D7\\u29DC-\\u29FB\\u29FE-\\u2B73\\u2B76-\\u2BFF\\u2CE5-\\u2CEA\\u2E50\\u2E51\\u2E80-\\u2E99\\u2E9B-\\u2EF3\\u2F00-\\u2FD5\\u2FF0-\\u2FFF\\u3004\\u3012\\u3013\\u3020\\u3036\\u3037\\u303E\\u303F\\u309B\\u309C\\u3190\\u3191\\u3196-\\u319F\\u31C0-\\u31E5\\u31EF\\u3200-\\u321E\\u322A-\\u3247\\u3250\\u3260-\\u327F\\u328A-\\u32B0\\u32C0-\\u33FF\\u4DC0-\\u4DFF\\uA490-\\uA4C6\\uA700-\\uA716\\uA720\\uA721\\uA789\\uA78A\\uA828-\\uA82B\\uA836-\\uA839\\uAA77-\\uAA79\\uAB5B\\uAB6A\\uAB6B\\uFB29\\uFBB2-\\uFBD2\\uFD40-\\uFD4F\\uFD90\\uFD91\\uFDC8-\\uFDCF\\uFDFC-\\uFDFF\\uFE62\\uFE64-\\uFE66\\uFE69\\uFF04\\uFF0B\\uFF1C-\\uFF1E\\uFF3E\\uFF40\\uFF5C\\uFF5E\\uFFE0-\\uFFE6\\uFFE8-\\uFFEE\\uFFFC\\uFFFD]|\\uD800[\\uDD37-\\uDD3F\\uDD79-\\uDD89\\uDD8C-\\uDD8E\\uDD90-\\uDD9C\\uDDA0\\uDDD0-\\uDDFC]|\\uD802[\\uDC77\\uDC78\\uDEC8]|\\uD803[\\uDD8E\\uDD8F\\uDED1-\\uDED8]|\\uD805\\uDF3F|\\uD807[\\uDFD5-\\uDFF1]|\\uD81A[\\uDF3C-\\uDF3F\\uDF45]|\\uD82F\\uDC9C|\\uD833[\\uDC00-\\uDCEF\\uDCFA-\\uDCFC\\uDD00-\\uDEB3\\uDEBA-\\uDED0\\uDEE0-\\uDEF0\\uDF50-\\uDFC3]|\\uD834[\\uDC00-\\uDCF5\\uDD00-\\uDD26\\uDD29-\\uDD64\\uDD6A-\\uDD6C\\uDD83\\uDD84\\uDD8C-\\uDDA9\\uDDAE-\\uDDEA\\uDE00-\\uDE41\\uDE45\\uDF00-\\uDF56]|\\uD835[\\uDEC1\\uDEDB\\uDEFB\\uDF15\\uDF35\\uDF4F\\uDF6F\\uDF89\\uDFA9\\uDFC3]|\\uD836[\\uDC00-\\uDDFF\\uDE37-\\uDE3A\\uDE6D-\\uDE74\\uDE76-\\uDE83\\uDE85\\uDE86]|\\uD838[\\uDD4F\\uDEFF]|\\uD83B[\\uDCAC\\uDCB0\\uDD2E\\uDEF0\\uDEF1]|\\uD83C[\\uDC00-\\uDC2B\\uDC30-\\uDC93\\uDCA0-\\uDCAE\\uDCB1-\\uDCBF\\uDCC1-\\uDCCF\\uDCD1-\\uDCF5\\uDD0D-\\uDDAD\\uDDE6-\\uDE02\\uDE10-\\uDE3B\\uDE40-\\uDE48\\uDE50\\uDE51\\uDE60-\\uDE65\\uDF00-\\uDFFF]|\\uD83D[\\uDC00-\\uDED8\\uDEDC-\\uDEEC\\uDEF0-\\uDEFC\\uDF00-\\uDFD9\\uDFE0-\\uDFEB\\uDFF0]|\\uD83E[\\uDC00-\\uDC0B\\uDC10-\\uDC47\\uDC50-\\uDC59\\uDC60-\\uDC87\\uDC90-\\uDCAD\\uDCB0-\\uDCBB\\uDCC0\\uDCC1\\uDCD0-\\uDCD8\\uDD00-\\uDE57\\uDE60-\\uDE6D\\uDE70-\\uDE7C\\uDE80-\\uDE8A\\uDE8E-\\uDEC6\\uDEC8\\uDECD-\\uDEDC\\uDEDF-\\uDEEA\\uDEEF-\\uDEF8\\uDF00-\\uDF92\\uDF94-\\uDFEF\\uDFFA]/;\nconst Z = /[ \\xA0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]/;\n\nexport { Any, Cc, Cf, P, S, Z };\n","// 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/IPAAAAAAAAAAAAAAAAKhBMEY8TmxUWF2EYLBkxGuAa3RsJHDscWR8YIC8jSCSIJcMl6ie3Ku8rEC0CLjoupS7kLgAIRU1hYmNmZ2xtbm9wcnN0dVQAWgBeAGUAaQBzAHcAfgCBAIQAhwCSAJoAoACsALMAbABpAGcAO4DGAMZAUAA7gCYAJkBjAHUAdABlADuAwQDBQHIiZXZlAAJhAAFpeW0AcgByAGMAO4DCAMJAEGRyAADgNdgE3XIAYQ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S6DLgABZmx9LoAuAOA12GnddQDzAP8RaQBtAOUABBIAAUFhiy6OLnIA8gDuAnIA8gCaBwABY3GVLgoScgAA4DXYzdwAAXB0nS6hLmwAdQDzACUScgDpACASAARhY2VmaW9zdbEuvC7ELsguzC7PLtQu2S5jAAABdXm2LrsudABlADuA/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","import { Any, Cc, P, Z } from \"uc.micro\";\n//#region src/rebuilder.ts\nvar REBuilder = class {\n\tsrc_Any = Any.source;\n\tsrc_Cc = Cc.source;\n\tsrc_Z = Z.source;\n\tsrc_P = P.source;\n\tsrc_ZPCc = [\n\t\tthis.src_Z,\n\t\tthis.src_P,\n\t\tthis.src_Cc\n\t].join(\"|\");\n\tsrc_ZCc = [this.src_Z, this.src_Cc].join(\"|\");\n\tcache = {};\n\topts = {\n\t\tmaxLength: 1e4,\n\t\turlAuth: false,\n\t\tschema_names: []\n\t};\n\tconstructor(opts = {}) {\n\t\tthis.opts = {\n\t\t\t...this.opts,\n\t\t\t...opts\n\t\t};\n\t}\n\tset(opts = {}) {\n\t\tthis.opts = {\n\t\t\t...this.opts,\n\t\t\t...opts\n\t\t};\n\t\tthis.cache = {};\n\t\treturn this;\n\t}\n\tescapeRE(str) {\n\t\treturn str.replace(/[.?*+^$[\\]\\\\(){}|-]/g, \"\\\\$&\");\n\t}\n\tnestedPairRE(open, close, depth = 4) {\n\t\tconst openRE = this.escapeRE(open);\n\t\tconst closeRE = this.escapeRE(close);\n\t\tconst atom = `(?:(?!${this.src_ZCc}|${openRE}|${closeRE}).)`;\n\t\tlet pair = `${openRE}${atom}{0,1000}${closeRE}`;\n\t\tfor (let level = 2; level <= depth; level++) pair = `${openRE}(?:${atom}|${pair}){0,1000}${closeRE}`;\n\t\treturn pair;\n\t}\n\tget_text_separators() {\n\t\treturn this.cache.text_separators ??= /[><\\uff5c]/;\n\t}\n\tget_pseudo_letter() {\n\t\treturn this.cache.src_pseudo_letter ??= new RegExp(`(?:(?!${this.get_text_separators().source}|${this.src_ZPCc})${this.src_Any})`);\n\t}\n\tget_ipv4_addr() {\n\t\treturn this.cache.src_ip4 ??= /* @__PURE__ */ new RegExp(\"(?:(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])[.]){3}(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\");\n\t}\n\tget_ipv6_addr() {\n\t\tconst h16 = \"[0-9A-Fa-f]{1,4}\";\n\t\tconst ls32 = `(?:(?:${h16}:${h16})|${this.get_ipv4_addr().source})`;\n\t\treturn this.cache.src_ip6_addr ??= new RegExp(`(?:(?:${h16}:){6}${ls32}|::(?:${h16}:){5}${ls32}|(?:${h16})?::(?:${h16}:){4}${ls32}|(?:(?:${h16}:){0,1}${h16})?::(?:${h16}:){3}${ls32}|(?:(?:${h16}:){0,2}${h16})?::(?:${h16}:){2}${ls32}|(?:(?:${h16}:){0,3}${h16})?::${h16}:${ls32}|(?:(?:${h16}:){0,4}${h16})?::${ls32}|(?:(?:${h16}:){0,5}${h16})?::${h16}|(?:(?:${h16}:){0,6}${h16})?::)`);\n\t}\n\tget_ipv6_url_host() {\n\t\treturn this.cache.src_ip6_host ??= new RegExp(`\\\\[${this.get_ipv6_addr().source}\\\\]`);\n\t}\n\tget_ipv6_mail_host() {\n\t\treturn this.cache.src_ipv6_mail_host ??= new RegExp(`\\\\[IPv6:${this.get_ipv6_addr().source}\\\\]`);\n\t}\n\tget_auth() {\n\t\treturn this.cache.src_auth ??= new RegExp(`(?:(?:(?!${this.src_ZCc}|[@/\\\\[\\\\]()]).){1,50}@)?`);\n\t}\n\tget_port() {\n\t\treturn this.cache.src_port ??= /* @__PURE__ */ new RegExp(\"(?::(?:6(?:[0-4]\\\\d{3}|5(?:[0-4]\\\\d{2}|5(?:[0-2]\\\\d|3[0-5])))|[1-5]?\\\\d{1,4}))?\");\n\t}\n\tget_host_terminator() {\n\t\treturn this.cache.src_host_terminator ??= new RegExp(`(?=$|${this.get_text_separators().source}|${this.src_ZPCc})(?!${this.opts[\"---\"] ? \"-(?!--)|\" : \"-|\"}_|:\\\\d|\\\\.-|\\\\.(?!$|${this.src_ZPCc}))`);\n\t}\n\tget_path_terminator() {\n\t\treturn this.cache.src_path_terminator ??= new RegExp(`${this.src_ZPCc}|${this.get_text_separators().source}`);\n\t}\n\tget_path() {\n\t\treturn this.cache.src_path ??= new RegExp(`(?:[/?#](?:${this.nestedPairRE(\"[\", \"]\")}|${this.nestedPairRE(\"(\", \")\")}|${this.nestedPairRE(\"{\", \"}\")}|\\\\\"(?:(?!${this.src_ZCc}|[\"]).){1,100}\\\\\"|\\\\'(?:(?!${this.src_ZCc}|[']).){1,100}\\\\'|\\\\'(?=${this.get_pseudo_letter().source}|[-])|\\\\.{2,20}[:]?[a-zA-Z0-9%/&]|\\\\.(?!${this.src_ZCc}|[.]|$)|` + (this.opts[\"---\"] ? \"\\\\-(?!--(?:[^-]|$))(?:-{0,19})|\" : \"\\\\-{1,20}|\") + `,(?!${this.src_ZCc}|$)|;(?!${this.src_ZCc}|$)|\\\\!{1,20}(?!${this.src_ZCc}|[!]|$)|\\\\?(?!${this.src_ZCc}|[?]|$)|` + this.get_path_extra().source + `[\\\\\\\\/:%@#&=_~*]|(?!${this.get_path_terminator().source}).){1,${this.opts.maxLength}}|\\\\/)?`);\n\t}\n\tget_mail_name() {\n\t\treturn this.cache.src_mail_name ??= /* @__PURE__ */ new RegExp(\"[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9](?:[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9]|[.](?=[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9])){0,63}\");\n\t}\n\tget_xn() {\n\t\treturn this.cache.src_xn ??= /* @__PURE__ */ new RegExp(\"xn--[a-z0-9\\\\-]{1,59}\");\n\t}\n\tget_tld() {\n\t\tif (this.cache.tld) return this.cache.tld;\n\t\tconst tlds_src = [...new Set(this.opts.tlds || [])].sort().reverse().join(\"|\");\n\t\tthis.cache.tld = new RegExp(`${tlds_src || \"$#none#$\"}|${this.get_xn().source}`);\n\t\treturn this.cache.tld;\n\t}\n\tget_domain_root() {\n\t\treturn this.cache.src_domain_root ??= new RegExp(\"(?:\" + this.get_xn().source + `|${this.get_pseudo_letter().source}{1,63})`);\n\t}\n\tget_domain() {\n\t\treturn this.cache.src_domain ??= new RegExp(\"(?:\" + this.get_xn().source + `|(?:${this.get_pseudo_letter().source})|(?:${this.get_pseudo_letter().source}(?:-|${this.get_pseudo_letter().source}){0,61}${this.get_pseudo_letter().source}))`);\n\t}\n\tget_url_host_port() {\n\t\treturn this.cache.url_host_port ??= new RegExp(\"(?:\" + this.get_ipv6_url_host().source + `|(?:(?:(?:${this.get_domain().source})\\\\.){0,10}${this.get_domain().source}))` + this.get_port().source + this.get_host_terminator().source);\n\t}\n\tget_fuzzy_url_host_port() {\n\t\treturn this.cache.fuzzy_url_host_port ??= new RegExp(\"(?:\" + (this.opts.fuzzyIP ? this.get_ipv4_addr().source + \"|\" : \"\") + `(?:(?:(?:${this.get_domain().source})\\\\.){1,10}(?:${this.get_tld().source})))` + this.get_host_terminator().source);\n\t}\n\tget_mail_host() {\n\t\treturn this.cache.src_mail_host ??= new RegExp(\"(?:\" + this.get_ipv6_mail_host().source + `|(?:(?:(?:${this.get_domain().source})\\\\.){0,4}${this.get_domain().source}))` + this.get_host_terminator().source);\n\t}\n\tget_fuzzy_mail_host() {\n\t\treturn this.cache.src_fuzzy_mail_host ??= new RegExp(\"(?:\" + this.get_ipv6_mail_host().source + `|(?:(?:(?:${this.get_domain().source})[.]){1,4}${this.get_domain_root().source}))` + this.get_host_terminator().source);\n\t}\n\tget_path_extra() {\n\t\treturn this.cache.src_path_extra ??= /* @__PURE__ */ new RegExp(\"\");\n\t}\n\tget_fuzzy_mail_host_search() {\n\t\treturn this.cache.mail_fuzzy_host_search ??= new RegExp(`@${this.get_fuzzy_mail_host().source}`, \"ig\");\n\t}\n\tget_fuzzy_link_search() {\n\t\treturn this.cache.link_fuzzy_search ??= new RegExp(`(^|(?![.:/\\\\-_@])(?:[$+<=>^\\`|\\uff5c]|${this.src_ZPCc}))(?:(?![$+<=>^\\`|\\uff5c])${this.get_fuzzy_url_host_port().source}${this.get_path().source})`, \"ig\");\n\t}\n\tget_http_validator() {\n\t\treturn this.cache.http_validator ??= new RegExp(\"\\\\/\\\\/\" + (this.opts.urlAuth ? this.get_auth().source : \"\") + this.get_url_host_port().source + this.get_path().source, \"iy\");\n\t}\n\tget_relative_proto_validator() {\n\t\treturn this.cache.relative_proto_validator ??= new RegExp((this.opts.urlAuth ? this.get_auth().source : \"\") + `(?:localhost|${this.get_ipv6_url_host().source}|(?:(?:${this.get_domain().source})[.]){1,10}${this.get_domain_root().source})` + this.get_port().source + this.get_host_terminator().source + this.get_path().source, \"iy\");\n\t}\n\tget_mail_name_validator() {\n\t\treturn this.cache.mail_name_validator ??= new RegExp(`(?:^|${this.get_text_separators().source}|\"|\\\\(|${this.src_ZCc})(${this.get_mail_name().source})$`);\n\t}\n\tget_mailto_validator() {\n\t\treturn this.cache.mailto_validator ??= new RegExp(`${this.get_mail_name().source}@${this.get_mail_host().source}`, \"iy\");\n\t}\n\tget_schema_names() {\n\t\treturn this.cache.schema_names ??= new RegExp((this.opts.schema_names || []).map((name) => this.escapeRE(name)).join(\"|\"));\n\t}\n\tget_schema_search() {\n\t\treturn this.cache.schema_search ??= new RegExp(`(^|(?!_)(?:[><\\uff5c]|${this.src_ZPCc}))(${this.get_schema_names().source})`, \"ig\");\n\t}\n\tget_schema_at_start() {\n\t\treturn this.cache.schema_at_start ??= new RegExp(`^${this.get_schema_search().source}`, \"i\");\n\t}\n};\n//#endregion\n//#region src/linkifyit.ts\nvar web_schema = {\n\tvalidate: (text, pos, self) => {\n\t\tconst re = self.re.get_http_validator();\n\t\tre.lastIndex = pos;\n\t\tconst m = re.exec(text);\n\t\treturn m ? m[0].length : 0;\n\t},\n\tnormalize: (match, self) => self.normalize(match)\n};\nvar defaultSchemas = {\n\t\"http:\": web_schema,\n\t\"https:\": web_schema,\n\t\"ftp:\": web_schema,\n\t\"//\": {\n\t\tvalidate: function(text, pos, self) {\n\t\t\tconst re = self.re.get_relative_proto_validator();\n\t\t\tre.lastIndex = pos;\n\t\t\tconst m = re.exec(text);\n\t\t\tif (m) {\n\t\t\t\tif (pos >= 3 && text[pos - 3] === \":\") return 0;\n\t\t\t\tif (pos >= 3 && text[pos - 3] === \"/\") return 0;\n\t\t\t\treturn m[0].length;\n\t\t\t}\n\t\t\treturn 0;\n\t\t},\n\t\tnormalize: (match, self) => self.normalize(match)\n\t},\n\t\"mailto:\": {\n\t\tvalidate: function(text, pos, self) {\n\t\t\tconst re = self.re.get_mailto_validator();\n\t\t\tre.lastIndex = pos;\n\t\t\tconst m = re.exec(text);\n\t\t\treturn m ? m[0].length : 0;\n\t\t},\n\t\tnormalize: (match, self) => self.normalize(match)\n\t}\n};\nvar tlds_2ch = \"a:cdefgilmnoqrstuwxz|b:abdefghijmnorstvwyz|c:acdfghiklmnoruvwxyz|d:ejkmoz|e:cegrstu|f:ijkmor|g:abdefghilmnpqrstuwy|h:kmnrtu|i:delmnoqrst|j:emop|k:eghimnprwyz|l:abcikrstuvy|m:acdeghklmnopqrstuvwxyz|n:acefgilopruz|o:m|p:aefghklmnrstwy|q:a|r:eosuw|s:abcdeghijklmnortuvxyz|t:cdfghjklmnortvwz|u:agksyz|v:aceginu|w:fs|y:et|z:amw\";\nvar tlds_default = \"biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф\";\nfunction unpackTlds() {\n\tconst result = tlds_default.split(\"|\");\n\ttlds_2ch.split(\"|\").forEach((item) => {\n\t\tconst sep = item.indexOf(\":\");\n\t\tconst prefix = item.slice(0, sep);\n\t\tfor (const suffix of item.slice(sep + 1)) result.push(prefix + suffix);\n\t});\n\treturn result;\n}\nvar defaultOptions = {\n\tfuzzyLink: false,\n\tfuzzyEmail: true,\n\tfuzzyIP: false,\n\t\"---\": false,\n\ttlds: unpackTlds(),\n\turlAuth: false,\n\tmaxLength: 1e4\n};\n/**\n* Match result returned by {@link LinkifyIt.match} and\n* {@link LinkifyIt.matchAtStart}.\n*\n* @category types\n*/\nvar Match = class {\n\t/** Prefix (protocol) for matched string. Empty for fuzzy links. */\n\tschema;\n\t/** First position of matched string. */\n\tindex;\n\t/** Next position after matched string. */\n\tlastIndex;\n\t/** Matched string. */\n\traw;\n\t/** Normalized text of matched string. */\n\ttext;\n\t/** Normalized URL of matched string. */\n\turl;\n\tconstructor(text, schema, index, lastIndex) {\n\t\tconst raw = text.slice(index, lastIndex);\n\t\tthis.schema = schema.toLowerCase();\n\t\tthis.index = index;\n\t\tthis.lastIndex = lastIndex;\n\t\tthis.raw = raw;\n\t\tthis.text = raw;\n\t\tthis.url = raw;\n\t}\n};\n/** Linkifier instance. */\nvar LinkifyIt = class {\n\t__opts__;\n\t__schemas__;\n\tre;\n\t/**\n\t* Creates new linkifier instance.\n\t*\n\t* By default understands:\n\t*\n\t* - `http(s)://...` , `ftp://...`, `mailto:...` & `//...` links\n\t* - \"fuzzy\" emails (foo@bar.com).\n\t*\n\t* See {@link LinkifyConstructorOptions} for available options.\n\t*\n\t* @param options Recognition options.\n\t*\n\t* @example\n\t* ```javascript\n\t* import { LinkifyIt } from 'linkify-it'\n\t*\n\t* const linkify = new LinkifyIt({ fuzzyLink: true })\n\t*\n\t* linkify\n\t* .tlds(require('tlds')) // Reload with full TLD list\n\t* .tlds('onion', true) // Add unofficial `.onion` domain\n\t* .add('ftp:', null) // Disable `ftp:` protocol\n\t* .set({ fuzzyIP: true }) // Enable IPs in fuzzy links\n\t*\n\t* console.log(linkify.test('Site github.com!')) // true\n\t* console.log(linkify.match('Site github.com!'))\n\t* ```\n\t*/\n\tconstructor(options = {}) {\n\t\tconst { rebuilder, ...linkifyOptions } = options;\n\t\tthis.__opts__ = {\n\t\t\t...defaultOptions,\n\t\t\t...linkifyOptions\n\t\t};\n\t\tthis.__schemas__ = { ...defaultSchemas };\n\t\tthis.re = rebuilder || new REBuilder();\n\t\tthis.re.set({\n\t\t\t...this.__opts__,\n\t\t\tschema_names: Object.keys(this.__schemas__)\n\t\t});\n\t}\n\t/**\n\t* Add new rule definition.\n\t*\n\t* `schema` is a link prefix (usually, protocol name with `:` at the end,\n\t* `skype:` for example). `linkify-it` makes sure that prefix is not\n\t* preceded with alphanumeric char and symbols. Only whitespaces and\n\t* punctuation allowed.\n\t*\n\t* `definition` is a rule to check tail after link prefix. To disable an\n\t* existing rule, pass `null`.\n\t*\n\t* @param schema Rule name (fixed pattern prefix).\n\t* @param definition Schema definition, or `null` to disable the rule.\n\t*\n\t* See [twitter mentions example](https://github.com/markdown-it/linkify-it/blob/master/examples/twitter.mjs).\n\t*/\n\tadd(schema, definition = null) {\n\t\tif (!definition) delete this.__schemas__[schema];\n\t\telse {\n\t\t\tconst def = {\n\t\t\t\tnormalize: (match, self) => self.normalize(match),\n\t\t\t\t...definition\n\t\t\t};\n\t\t\tthis.__schemas__[schema] = def;\n\t\t}\n\t\tthis.re.set({\n\t\t\t...this.__opts__,\n\t\t\tschema_names: Object.keys(this.__schemas__)\n\t\t});\n\t\treturn this;\n\t}\n\t/**\n\t* Set recognition options for links without schema.\n\t*\n\t* @param options Recognition options.\n\t*/\n\tset(options = {}) {\n\t\tthis.__opts__ = {\n\t\t\t...this.__opts__,\n\t\t\t...options\n\t\t};\n\t\tthis.re.set({\n\t\t\t...this.__opts__,\n\t\t\tschema_names: Object.keys(this.__schemas__)\n\t\t});\n\t\treturn this;\n\t}\n\t/**\n\t* Searches linkifiable pattern and returns `true` on success or `false` on fail.\n\t*\n\t* @param text Text to scan.\n\t*/\n\ttest(text) {\n\t\tif (!text.length) return false;\n\t\tlet m, re;\n\t\tre = this.re.get_schema_search();\n\t\tre.lastIndex = 0;\n\t\twhile ((m = re.exec(text)) !== null) if (this.testSchemaAt(text, m[2], re.lastIndex)) return true;\n\t\tif (this.__opts__.fuzzyLink && this.__schemas__[\"http:\"]) {\n\t\t\tre = this.re.get_fuzzy_link_search();\n\t\t\tre.lastIndex = 0;\n\t\t\tif (re.exec(text) !== null) return true;\n\t\t}\n\t\tif (this.__opts__.fuzzyEmail && this.__schemas__[\"mailto:\"]) {\n\t\t\tif (text.indexOf(\"@\") >= 0) {\n\t\t\t\tconst mailHostRe = this.re.get_fuzzy_mail_host_search();\n\t\t\t\tconst mailNameRe = this.re.get_mail_name_validator();\n\t\t\t\tmailHostRe.lastIndex = 0;\n\t\t\t\twhile ((m = mailHostRe.exec(text)) !== null) {\n\t\t\t\t\tconst name = text.slice(Math.max(0, m.index - 65), m.index);\n\t\t\t\t\tif (mailNameRe.test(name)) return true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\t/**\n\t* Similar to {@link LinkifyIt.test} but checks only specific protocol tail exactly\n\t* at given position. Returns length of found pattern (0 on fail).\n\t*\n\t* @param text Text to scan.\n\t* @param schema Rule (schema) name.\n\t* @param pos Text offset to check from.\n\t*/\n\ttestSchemaAt(text, schema, pos) {\n\t\tif (!this.__schemas__[schema.toLowerCase()]) return 0;\n\t\treturn this.__schemas__[schema.toLowerCase()].validate(text.slice(0, pos + this.__opts__.maxLength), pos, this);\n\t}\n\t/**\n\t* Returns array of found link descriptions or `null` on fail. We strongly\n\t* recommend to use {@link LinkifyIt.test} first, for best speed.\n\t*\n\t* @param text Text to scan.\n\t*/\n\tmatch(text) {\n\t\tconst result = [];\n\t\tconst schemaRe = this.re.get_schema_search();\n\t\tlet fuzzyLinkRe;\n\t\tlet mailHostRe;\n\t\tlet mailNameRe;\n\t\tlet fuzzyLinkCandidate;\n\t\tlet fuzzyEmailCandidate;\n\t\tlet schemaPrefix;\n\t\tlet schemaDone = false;\n\t\tlet fuzzyLinkDone = false;\n\t\tlet fuzzyEmailDone = false;\n\t\tlet pos = 0;\n\t\tif (!text.length) return null;\n\t\tschemaRe.lastIndex = 0;\n\t\tif (this.__opts__.fuzzyLink && this.__schemas__[\"http:\"]) {\n\t\t\tfuzzyLinkRe = this.re.get_fuzzy_link_search();\n\t\t\tfuzzyLinkRe.lastIndex = 0;\n\t\t}\n\t\tif (this.__opts__.fuzzyEmail && this.__schemas__[\"mailto:\"]) {\n\t\t\tmailHostRe = this.re.get_fuzzy_mail_host_search();\n\t\t\tmailHostRe.lastIndex = 0;\n\t\t\tmailNameRe = this.re.get_mail_name_validator();\n\t\t}\n\t\tfor (;;) {\n\t\t\tconst scanFrom = Math.max(pos - 1, 0);\n\t\t\tif (mailHostRe && mailNameRe && !fuzzyEmailDone && (!fuzzyEmailCandidate || fuzzyEmailCandidate.index < pos)) {\n\t\t\t\tif (mailHostRe.lastIndex < scanFrom) mailHostRe.lastIndex = scanFrom;\n\t\t\t\tfor (;;) {\n\t\t\t\t\tconst m = mailHostRe.exec(text);\n\t\t\t\t\tif (!m) {\n\t\t\t\t\t\tfuzzyEmailDone = true;\n\t\t\t\t\t\tfuzzyEmailCandidate = void 0;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tconst name = mailNameRe.exec(text.slice(Math.max(0, m.index - 65), m.index));\n\t\t\t\t\tif (!name) continue;\n\t\t\t\t\tfuzzyEmailCandidate = {\n\t\t\t\t\t\tschema: \"mailto:\",\n\t\t\t\t\t\tindex: m.index - name[1].length,\n\t\t\t\t\t\tlastIndex: m.index + m[0].length\n\t\t\t\t\t};\n\t\t\t\t\tif (fuzzyEmailCandidate.index >= pos) break;\n\t\t\t\t\tif (mailHostRe.lastIndex < scanFrom) mailHostRe.lastIndex = scanFrom;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (fuzzyLinkRe && !fuzzyLinkDone && (!fuzzyLinkCandidate || fuzzyLinkCandidate.index < pos)) {\n\t\t\t\tif (fuzzyLinkRe.lastIndex < scanFrom) fuzzyLinkRe.lastIndex = scanFrom;\n\t\t\t\tfor (;;) {\n\t\t\t\t\tconst m = fuzzyLinkRe.exec(text);\n\t\t\t\t\tif (!m) {\n\t\t\t\t\t\tfuzzyLinkDone = true;\n\t\t\t\t\t\tfuzzyLinkCandidate = void 0;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tfuzzyLinkCandidate = {\n\t\t\t\t\t\tschema: \"\",\n\t\t\t\t\t\tindex: m.index + m[1].length,\n\t\t\t\t\t\tlastIndex: m.index + m[0].length\n\t\t\t\t\t};\n\t\t\t\t\tif (fuzzyLinkCandidate.index >= pos) break;\n\t\t\t\t\tif (fuzzyLinkRe.lastIndex < scanFrom) fuzzyLinkRe.lastIndex = scanFrom;\n\t\t\t\t}\n\t\t\t}\n\t\t\tlet fuzzyCandidate = fuzzyEmailCandidate;\n\t\t\tif (!fuzzyCandidate || fuzzyLinkCandidate && (fuzzyLinkCandidate.index < fuzzyCandidate.index || fuzzyLinkCandidate.index === fuzzyCandidate.index && fuzzyLinkCandidate.lastIndex > fuzzyCandidate.lastIndex)) fuzzyCandidate = fuzzyLinkCandidate;\n\t\t\tlet schemaCandidate;\n\t\t\tif (!schemaDone) for (;;) {\n\t\t\t\tif (!schemaPrefix) {\n\t\t\t\t\tif (schemaRe.lastIndex < scanFrom) schemaRe.lastIndex = scanFrom;\n\t\t\t\t\tconst m = schemaRe.exec(text);\n\t\t\t\t\tif (!m) {\n\t\t\t\t\t\tschemaDone = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tschemaPrefix = {\n\t\t\t\t\t\tschema: m[2],\n\t\t\t\t\t\tindex: m.index + m[1].length,\n\t\t\t\t\t\tlastIndex: m.index + m[0].length\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tif (schemaPrefix.index < pos) {\n\t\t\t\t\tschemaPrefix = void 0;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (fuzzyCandidate && schemaPrefix.index > fuzzyCandidate.index) break;\n\t\t\t\tconst prefix = schemaPrefix;\n\t\t\t\tschemaPrefix = void 0;\n\t\t\t\tconst len = this.testSchemaAt(text, prefix.schema, prefix.lastIndex);\n\t\t\t\tif (len) {\n\t\t\t\t\tschemaCandidate = {\n\t\t\t\t\t\tschema: prefix.schema,\n\t\t\t\t\t\tindex: prefix.index,\n\t\t\t\t\t\tlastIndex: prefix.lastIndex + len\n\t\t\t\t\t};\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tlet candidate = schemaCandidate;\n\t\t\tif (!candidate || fuzzyEmailCandidate && (fuzzyEmailCandidate.index < candidate.index || fuzzyEmailCandidate.index === candidate.index && fuzzyEmailCandidate.lastIndex > candidate.lastIndex)) candidate = fuzzyEmailCandidate;\n\t\t\tif (!candidate || fuzzyLinkCandidate && (fuzzyLinkCandidate.index < candidate.index || fuzzyLinkCandidate.index === candidate.index && fuzzyLinkCandidate.lastIndex > candidate.lastIndex)) candidate = fuzzyLinkCandidate;\n\t\t\tif (!candidate) break;\n\t\t\tif (candidate === fuzzyEmailCandidate) fuzzyEmailCandidate = void 0;\n\t\t\telse if (candidate === fuzzyLinkCandidate) fuzzyLinkCandidate = void 0;\n\t\t\tconst match = new Match(text, candidate.schema, candidate.index, candidate.lastIndex);\n\t\t\tif (match.schema) this.__schemas__[match.schema].normalize(match, this);\n\t\t\telse this.normalize(match);\n\t\t\tresult.push(match);\n\t\t\tpos = candidate.lastIndex;\n\t\t}\n\t\tif (result.length) return result;\n\t\treturn null;\n\t}\n\t/**\n\t* Returns fully-formed (not fuzzy) link if it starts at the beginning\n\t* of the string, and null otherwise.\n\t*\n\t* @param text Text to scan.\n\t*/\n\tmatchAtStart(text) {\n\t\tif (!text.length) return null;\n\t\tconst m = this.re.get_schema_at_start().exec(text);\n\t\tif (!m) return null;\n\t\tconst len = this.testSchemaAt(text, m[2], m[0].length);\n\t\tif (!len) return null;\n\t\tconst match = new Match(text, m[2], m.index + m[1].length, m.index + m[0].length + len);\n\t\tthis.__schemas__[match.schema].normalize(match, this);\n\t\treturn match;\n\t}\n\t/**\n\t* Load (or merge) new TLDs list. Those are used for fuzzy links (without\n\t* prefix) to avoid false positives. By default this algorithm is used:\n\t*\n\t* - hostname with any 2-letter root zones are ok.\n\t* - biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф\n\t* are ok.\n\t* - encoded (`xn--...`) root zones are ok.\n\t*\n\t* If list is replaced, then exact match for 2-chars root zones will be checked.\n\t*\n\t* @param list List of TLDs.\n\t* @param keepOld Merge with current list if `true` (`false` by default).\n\t*/\n\ttlds(list, keepOld = false) {\n\t\tlist = Array.isArray(list) ? list : [list];\n\t\tif (!keepOld) this.__opts__.tlds = list;\n\t\telse this.__opts__.tlds = this.__opts__.tlds.concat(list);\n\t\tthis.re.set({\n\t\t\t...this.__opts__,\n\t\t\tschema_names: Object.keys(this.__schemas__)\n\t\t});\n\t\treturn this;\n\t}\n\t/**\n\t* Default normalizer (if schema does not define its own).\n\t*\n\t* @param match Match to normalize.\n\t*/\n\tnormalize(match) {\n\t\tif (!match.schema) match.url = `http://${match.url}`;\n\t\tif (match.schema === \"mailto:\" && !/^mailto:/i.test(match.url)) match.url = `mailto:${match.url}`;\n\t}\n};\nfunction linkifyit(options = {}) {\n\treturn new LinkifyIt(options);\n}\n//#endregion\nexport { LinkifyIt, REBuilder, linkifyit };\n\n//# sourceMappingURL=index.mjs.map","'use strict';\n\n/** Highest positive signed 32-bit float value */\nconst maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1\n\n/** Bootstring parameters */\nconst base = 36;\nconst tMin = 1;\nconst tMax = 26;\nconst skew = 38;\nconst damp = 700;\nconst initialBias = 72;\nconst initialN = 128; // 0x80\nconst delimiter = '-'; // '\\x2D'\n\n/** Regular expressions */\nconst regexPunycode = /^xn--/;\nconst regexNonASCII = /[^\\0-\\x7F]/; // Note: U+007F DEL is excluded too.\nconst regexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g; // RFC 3490 separators\n\n/** Error messages */\nconst errors = {\n\t'overflow': 'Overflow: input needs wider integers to process',\n\t'not-basic': 'Illegal input >= 0x80 (not a basic code point)',\n\t'invalid-input': 'Invalid input'\n};\n\n/** Convenience shortcuts */\nconst baseMinusTMin = base - tMin;\nconst floor = Math.floor;\nconst stringFromCharCode = String.fromCharCode;\n\n/*--------------------------------------------------------------------------*/\n\n/**\n * A generic error utility function.\n * @private\n * @param {String} type The error type.\n * @returns {Error} Throws a `RangeError` with the applicable error message.\n */\nfunction error(type) {\n\tthrow new RangeError(errors[type]);\n}\n\n/**\n * A generic `Array#map` utility function.\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} callback The function that gets called for every array\n * item.\n * @returns {Array} A new array of values returned by the callback function.\n */\nfunction map(array, callback) {\n\tconst result = [];\n\tlet length = array.length;\n\twhile (length--) {\n\t\tresult[length] = callback(array[length]);\n\t}\n\treturn result;\n}\n\n/**\n * A simple `Array#map`-like wrapper to work with domain name strings or email\n * addresses.\n * @private\n * @param {String} domain The domain name or email address.\n * @param {Function} callback The function that gets called for every\n * character.\n * @returns {String} A new string of characters returned by the callback\n * function.\n */\nfunction mapDomain(domain, callback) {\n\tconst parts = domain.split('@');\n\tlet result = '';\n\tif (parts.length > 1) {\n\t\t// In email addresses, only the domain name should be punycoded. Leave\n\t\t// the local part (i.e. everything up to `@`) intact.\n\t\tresult = parts[0] + '@';\n\t\tdomain = parts[1];\n\t}\n\t// Avoid `split(regex)` for IE8 compatibility. See #17.\n\tdomain = domain.replace(regexSeparators, '\\x2E');\n\tconst labels = domain.split('.');\n\tconst encoded = map(labels, callback).join('.');\n\treturn result + encoded;\n}\n\n/**\n * Creates an array containing the numeric code points of each Unicode\n * character in the string. While JavaScript uses UCS-2 internally,\n * this function will convert a pair of surrogate halves (each of which\n * UCS-2 exposes as separate characters) into a single code point,\n * matching UTF-16.\n * @see `punycode.ucs2.encode`\n * @see <https://mathiasbynens.be/notes/javascript-encoding>\n * @memberOf punycode.ucs2\n * @name decode\n * @param {String} string The Unicode input string (UCS-2).\n * @returns {Array} The new array of code points.\n */\nfunction ucs2decode(string) {\n\tconst output = [];\n\tlet counter = 0;\n\tconst length = string.length;\n\twhile (counter < length) {\n\t\tconst value = string.charCodeAt(counter++);\n\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t// It's a high surrogate, and there is a next character.\n\t\t\tconst extra = string.charCodeAt(counter++);\n\t\t\tif ((extra & 0xFC00) == 0xDC00) { // Low surrogate.\n\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t} else {\n\t\t\t\t// It's an unmatched surrogate; only append this code unit, in case the\n\t\t\t\t// next code unit is the high surrogate of a surrogate pair.\n\t\t\t\toutput.push(value);\n\t\t\t\tcounter--;\n\t\t\t}\n\t\t} else {\n\t\t\toutput.push(value);\n\t\t}\n\t}\n\treturn output;\n}\n\n/**\n * Creates a string based on an array of numeric code points.\n * @see `punycode.ucs2.decode`\n * @memberOf punycode.ucs2\n * @name encode\n * @param {Array} codePoints The array of numeric code points.\n * @returns {String} The new Unicode string (UCS-2).\n */\nconst ucs2encode = codePoints => String.fromCodePoint(...codePoints);\n\n/**\n * Converts a basic code point into a digit/integer.\n * @see `digitToBasic()`\n * @private\n * @param {Number} codePoint The basic numeric code point value.\n * @returns {Number} The numeric value of a basic code point (for use in\n * representing integers) in the range `0` to `base - 1`, or `base` if\n * the code point does not represent a value.\n */\nconst basicToDigit = function(codePoint) {\n\tif (codePoint >= 0x30 && codePoint < 0x3A) {\n\t\treturn 26 + (codePoint - 0x30);\n\t}\n\tif (codePoint >= 0x41 && codePoint < 0x5B) {\n\t\treturn codePoint - 0x41;\n\t}\n\tif (codePoint >= 0x61 && codePoint < 0x7B) {\n\t\treturn codePoint - 0x61;\n\t}\n\treturn base;\n};\n\n/**\n * Converts a digit/integer into a basic code point.\n * @see `basicToDigit()`\n * @private\n * @param {Number} digit The numeric value of a basic code point.\n * @returns {Number} The basic code point whose value (when used for\n * representing integers) is `digit`, which needs to be in the range\n * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is\n * used; else, the lowercase form is used. The behavior is undefined\n * if `flag` is non-zero and `digit` has no uppercase form.\n */\nconst digitToBasic = function(digit, flag) {\n\t// 0..25 map to ASCII a..z or A..Z\n\t// 26..35 map to ASCII 0..9\n\treturn digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n};\n\n/**\n * Bias adaptation function as per section 3.4 of RFC 3492.\n * https://tools.ietf.org/html/rfc3492#section-3.4\n * @private\n */\nconst adapt = function(delta, numPoints, firstTime) {\n\tlet k = 0;\n\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\tdelta += floor(delta / numPoints);\n\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\tdelta = floor(delta / baseMinusTMin);\n\t}\n\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n};\n\n/**\n * Converts a Punycode string of ASCII-only symbols to a string of Unicode\n * symbols.\n * @memberOf punycode\n * @param {String} input The Punycode string of ASCII-only symbols.\n * @returns {String} The resulting string of Unicode symbols.\n */\nconst decode = function(input) {\n\t// Don't use UCS-2.\n\tconst output = [];\n\tconst inputLength = input.length;\n\tlet i = 0;\n\tlet n = initialN;\n\tlet bias = initialBias;\n\n\t// Handle the basic code points: let `basic` be the number of input code\n\t// points before the last delimiter, or `0` if there is none, then copy\n\t// the first basic code points to the output.\n\n\tlet basic = input.lastIndexOf(delimiter);\n\tif (basic < 0) {\n\t\tbasic = 0;\n\t}\n\n\tfor (let j = 0; j < basic; ++j) {\n\t\t// if it's not a basic code point\n\t\tif (input.charCodeAt(j) >= 0x80) {\n\t\t\terror('not-basic');\n\t\t}\n\t\toutput.push(input.charCodeAt(j));\n\t}\n\n\t// Main decoding loop: start just after the last delimiter if any basic code\n\t// points were copied; start at the beginning otherwise.\n\n\tfor (let index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {\n\n\t\t// `index` is the index of the next character to be consumed.\n\t\t// Decode a generalized variable-length integer into `delta`,\n\t\t// which gets added to `i`. The overflow checking is easier\n\t\t// if we increase `i` as we go, then subtract off its starting\n\t\t// value at the end to obtain `delta`.\n\t\tconst oldi = i;\n\t\tfor (let w = 1, k = base; /* no condition */; k += base) {\n\n\t\t\tif (index >= inputLength) {\n\t\t\t\terror('invalid-input');\n\t\t\t}\n\n\t\t\tconst digit = basicToDigit(input.charCodeAt(index++));\n\n\t\t\tif (digit >= base) {\n\t\t\t\terror('invalid-input');\n\t\t\t}\n\t\t\tif (digit > floor((maxInt - i) / w)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\ti += digit * w;\n\t\t\tconst t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\n\t\t\tif (digit < t) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tconst baseMinusT = base - t;\n\t\t\tif (w > floor(maxInt / baseMinusT)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\tw *= baseMinusT;\n\n\t\t}\n\n\t\tconst out = output.length + 1;\n\t\tbias = adapt(i - oldi, out, oldi == 0);\n\n\t\t// `i` was supposed to wrap around from `out` to `0`,\n\t\t// incrementing `n` each time, so we'll fix that now:\n\t\tif (floor(i / out) > maxInt - n) {\n\t\t\terror('overflow');\n\t\t}\n\n\t\tn += floor(i / out);\n\t\ti %= out;\n\n\t\t// Insert `n` at position `i` of the output.\n\t\toutput.splice(i++, 0, n);\n\n\t}\n\n\treturn String.fromCodePoint(...output);\n};\n\n/**\n * Converts a string of Unicode symbols (e.g. a domain name label) to a\n * Punycode string of ASCII-only symbols.\n * @memberOf punycode\n * @param {String} input The string of Unicode symbols.\n * @returns {String} The resulting Punycode string of ASCII-only symbols.\n */\nconst encode = function(input) {\n\tconst output = [];\n\n\t// Convert the input in UCS-2 to an array of Unicode code points.\n\tinput = ucs2decode(input);\n\n\t// Cache the length.\n\tconst inputLength = input.length;\n\n\t// Initialize the state.\n\tlet n = initialN;\n\tlet delta = 0;\n\tlet bias = initialBias;\n\n\t// Handle the basic code points.\n\tfor (const currentValue of input) {\n\t\tif (currentValue < 0x80) {\n\t\t\toutput.push(stringFromCharCode(currentValue));\n\t\t}\n\t}\n\n\tconst basicLength = output.length;\n\tlet handledCPCount = basicLength;\n\n\t// `handledCPCount` is the number of code points that have been handled;\n\t// `basicLength` is the number of basic code points.\n\n\t// Finish the basic string with a delimiter unless it's empty.\n\tif (basicLength) {\n\t\toutput.push(delimiter);\n\t}\n\n\t// Main encoding loop:\n\twhile (handledCPCount < inputLength) {\n\n\t\t// All non-basic code points < n have been handled already. Find the next\n\t\t// larger one:\n\t\tlet m = maxInt;\n\t\tfor (const currentValue of input) {\n\t\t\tif (currentValue >= n && currentValue < m) {\n\t\t\t\tm = currentValue;\n\t\t\t}\n\t\t}\n\n\t\t// Increase `delta` enough to advance the decoder's <n,i> state to <m,0>,\n\t\t// but guard against overflow.\n\t\tconst handledCPCountPlusOne = handledCPCount + 1;\n\t\tif (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n\t\t\terror('overflow');\n\t\t}\n\n\t\tdelta += (m - n) * handledCPCountPlusOne;\n\t\tn = m;\n\n\t\tfor (const currentValue of input) {\n\t\t\tif (currentValue < n && ++delta > maxInt) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\t\t\tif (currentValue === n) {\n\t\t\t\t// Represent delta as a generalized variable-length integer.\n\t\t\t\tlet q = delta;\n\t\t\t\tfor (let k = base; /* no condition */; k += base) {\n\t\t\t\t\tconst t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\t\t\t\tif (q < t) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tconst qMinusT = q - t;\n\t\t\t\t\tconst baseMinusT = base - t;\n\t\t\t\t\toutput.push(\n\t\t\t\t\t\tstringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))\n\t\t\t\t\t);\n\t\t\t\t\tq = floor(qMinusT / baseMinusT);\n\t\t\t\t}\n\n\t\t\t\toutput.push(stringFromCharCode(digitToBasic(q, 0)));\n\t\t\t\tbias = adapt(delta, handledCPCountPlusOne, handledCPCount === basicLength);\n\t\t\t\tdelta = 0;\n\t\t\t\t++handledCPCount;\n\t\t\t}\n\t\t}\n\n\t\t++delta;\n\t\t++n;\n\n\t}\n\treturn output.join('');\n};\n\n/**\n * Converts a Punycode string representing a domain name or an email address\n * to Unicode. Only the Punycoded parts of the input will be converted, i.e.\n * it doesn't matter if you call it on a string that has already been\n * converted to Unicode.\n * @memberOf punycode\n * @param {String} input The Punycoded domain name or email address to\n * convert to Unicode.\n * @returns {String} The Unicode representation of the given Punycode\n * string.\n */\nconst toUnicode = function(input) {\n\treturn mapDomain(input, function(string) {\n\t\treturn regexPunycode.test(string)\n\t\t\t? decode(string.slice(4).toLowerCase())\n\t\t\t: string;\n\t});\n};\n\n/**\n * Converts a Unicode string representing a domain name or an email address to\n * Punycode. Only the non-ASCII parts of the domain name will be converted,\n * i.e. it doesn't matter if you call it with a domain that's already in\n * ASCII.\n * @memberOf punycode\n * @param {String} input The domain name or email address to convert, as a\n * Unicode string.\n * @returns {String} The Punycode representation of the given domain name or\n * email address.\n */\nconst toASCII = function(input) {\n\treturn mapDomain(input, function(string) {\n\t\treturn regexNonASCII.test(string)\n\t\t\t? 'xn--' + encode(string)\n\t\t\t: string;\n\t});\n};\n\n/*--------------------------------------------------------------------------*/\n\n/** Define the public API */\nconst punycode = {\n\t/**\n\t * A string representing the current Punycode.js version number.\n\t * @memberOf punycode\n\t * @type String\n\t */\n\t'version': '2.3.1',\n\t/**\n\t * An object of methods to convert from JavaScript's internal character\n\t * representation (UCS-2) to Unicode code points, and back.\n\t * @see <https://mathiasbynens.be/notes/javascript-encoding>\n\t * @memberOf punycode\n\t * @type Object\n\t */\n\t'ucs2': {\n\t\t'decode': ucs2decode,\n\t\t'encode': ucs2encode\n\t},\n\t'decode': decode,\n\t'encode': encode,\n\t'toASCII': toASCII,\n\t'toUnicode': toUnicode\n};\n\nexport { ucs2decode, ucs2encode, decode, encode, toASCII, toUnicode };\nexport default punycode;\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":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