{"version":3,"sources":["jsdelivr-header.js","/npm/marked@18.2.0/src/marked.ts","/npm/marked@18.2.0/src/defaults.ts","/npm/marked@18.2.0/src/rules.ts","/npm/marked@18.2.0/src/helpers.ts","/npm/marked@18.2.0/src/Tokenizer.ts","/npm/marked@18.2.0/src/Lexer.ts","/npm/marked@18.2.0/src/Renderer.ts","/npm/marked@18.2.0/src/TextRenderer.ts","/npm/marked@18.2.0/src/Parser.ts","/npm/marked@18.2.0/src/Hooks.ts","/npm/marked@18.2.0/src/Instance.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,iXCNA,EAAA,GCKO,SAAS,IACd,MAAO,CACL,OAAO,EACP,QAAQ,EACR,WAAY,KACZ,KAAK,EACL,MAAO,KACP,UAAU,EACV,SAAU,KACV,QAAQ,EACR,UAAW,KACX,WAAY,KAEhB,C,yDDlBA,CAAA,EAAA,CAAA,MAAA,IAAA,GAAA,MAAA,IAAA,GAAA,OAAA,IAAA,GAAA,OAAA,IAAA,GAAA,SAAA,IAAA,GAAA,aAAA,IAAA,GAAA,UAAA,IAAA,GAAA,SAAA,IAAA,EAAA,YAAA,IAAA,EAAA,MAAA,IAAA,GAAA,OAAA,IAAA,GAAA,QAAA,IAAA,GAAA,MAAA,IAAA,GAAA,YAAA,IAAA,GAAA,OAAA,IAAA,GAAA,WAAA,IAAA,GAAA,IAAA,IAAA,GAAA,WAAA,IAAA,KAAA,EAAA,S,EAAA,E,2MCoBO,IAAI,EAdF,CACL,OAAO,EACP,QAAQ,EACR,WAAY,KACZ,KAAK,EACL,MAAO,KACP,UAAU,EACV,SAAU,KACV,QAAQ,EACR,UAAW,KACX,WAAY,MAMT,SAAS,EAA+D,GAC7E,EAAY,CACd,CCxBA,IAAM,EAAW,CAAE,KAAM,IAAM,MAE/B,SAAS,EAAkB,GACzB,IAAM,EAAkB,GACxB,OAAQ,IACN,IAAM,EAAa,KAAK,IAAI,EAAG,KAAK,IAAI,EAAG,EAAS,IAChD,EAAQ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B,GAAa,GAAO,WACpB,GAAa,GAAO,WAOpB,GAAc,GAAO,YACrB,GAAQ,GACR,GAAS,GAAQ,MACjB,GAAQ,GAAO,I","file":"/npm/marked@18.2.0/lib/marked.umd.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.48.0.\n * Original file: /npm/marked@18.2.0/lib/marked.umd.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","import { _Lexer } from './Lexer.ts';\nimport { _Parser } from './Parser.ts';\nimport { _Tokenizer } from './Tokenizer.ts';\nimport { _Renderer } from './Renderer.ts';\nimport { _TextRenderer } from './TextRenderer.ts';\nimport { _Hooks } from './Hooks.ts';\nimport { Marked } from './Instance.ts';\nimport {\n  _getDefaults,\n  changeDefaults,\n  _defaults,\n} from './defaults.ts';\nimport type { MarkedExtension, MarkedOptions } from './MarkedOptions.ts';\nimport type { Token, TokensList } from './Tokens.ts';\nimport type { MaybePromise } from './Instance.ts';\n\nconst markedInstance = new Marked();\n\n/**\n * Compiles markdown to HTML asynchronously.\n *\n * To configure hooks, a renderer, or a tokenizer, create a `Marked` instance\n * and use `Marked#use` instead of passing them as options on each call.\n *\n * @param src String of markdown source to be compiled\n * @param options Hash of options, having async: true\n * @return Promise of string of compiled HTML\n */\nexport function marked(src: string, options: MarkedOptions & { async: true }): Promise<string>;\n\n/**\n * Compiles markdown to HTML.\n *\n * To configure hooks, a renderer, or a tokenizer, create a `Marked` instance\n * and use `Marked#use` instead of passing them as options on each call.\n *\n * @param src String of markdown source to be compiled\n * @param options Optional hash of options\n * @return String of compiled HTML. Will be a Promise of string if async is set to true by any extensions.\n */\nexport function marked(src: string, options: MarkedOptions & { async: false }): string;\nexport function marked(src: string, options: MarkedOptions & { async: true }): Promise<string>;\nexport function marked(src: string, options?: MarkedOptions | null): string | Promise<string>;\nexport function marked(src: string, opt?: MarkedOptions | null): string | Promise<string> {\n  return markedInstance.parse(src, opt);\n}\n\nexport declare namespace marked {\n  /**\n   * Compiles inline markdown to HTML.\n   *\n   * To configure hooks, a renderer, or a tokenizer, create a `Marked` instance\n   * and use `Marked#use` instead of passing them as options on each call.\n   */\n  let parseInline: typeof markedInstance.parseInline;\n\n  /**\n   * Registers extensions with the default Marked instance.\n   *\n   * The `renderer`, `tokenizer`, and `hooks` objects may each contain only the\n   * methods that should be overridden. Their methods are merged with built-in\n   * behavior and extensions registered by earlier calls.\n   *\n   * Use this function when supplying only some hook methods.\n   */\n  let use: (...args: MarkedExtension[]) => typeof marked;\n}\n\n/**\n * Sets the default options.\n *\n * @param options Hash of options\n */\nmarked.options =\n  marked.setOptions = function(options: MarkedOptions) {\n    markedInstance.setOptions(options);\n    marked.defaults = markedInstance.defaults;\n    changeDefaults(marked.defaults);\n    return marked;\n  };\n\n/**\n * Gets the original marked default options.\n */\nmarked.getDefaults = _getDefaults;\n\nmarked.defaults = _defaults;\n\n/**\n * Registers extensions with the default Marked instance.\n *\n * The `renderer`, `tokenizer`, and `hooks` objects may each contain only the\n * methods that should be overridden. Their methods are merged with built-in\n * behavior and extensions registered by earlier calls.\n *\n * Use this function when supplying only some hook methods.\n *\n * @param args Extensions to register\n * @return The `marked` function\n */\nfunction useExtension(...args: MarkedExtension[]) {\n  markedInstance.use(...args);\n  marked.defaults = markedInstance.defaults;\n  changeDefaults(marked.defaults);\n  return marked;\n}\n\nmarked.use = useExtension;\n\n/**\n * Run callback for every token\n */\n\nmarked.walkTokens = function(tokens: Token[] | TokensList, callback: (token: Token) => MaybePromise | MaybePromise[]) {\n  return markedInstance.walkTokens(tokens, callback);\n};\n\n/**\n * Compiles markdown to HTML without enclosing `p` tag.\n *\n * To configure hooks, a renderer, or a tokenizer, create a `Marked` instance\n * and use `Marked#use` instead of passing them as options on each call.\n *\n * @param src String of markdown source to be compiled\n * @param options Hash of options\n * @return String of compiled HTML\n */\nmarked.parseInline = markedInstance.parseInline;\n\n/**\n * Expose\n */\nmarked.Parser = _Parser;\nmarked.parser = _Parser.parse;\nmarked.Renderer = _Renderer;\nmarked.TextRenderer = _TextRenderer;\nmarked.Lexer = _Lexer;\nmarked.lexer = _Lexer.lex;\nmarked.Tokenizer = _Tokenizer;\nmarked.Hooks = _Hooks;\nmarked.parse = marked;\n\nexport const options = marked.options;\nexport const setOptions = marked.setOptions;\nexport const walkTokens = marked.walkTokens;\n/**\n * Compiles inline markdown to HTML.\n *\n * To configure hooks, a renderer, or a tokenizer, create a `Marked` instance\n * and use `Marked#use` instead of passing them as options on each call.\n */\nexport const parseInline = marked.parseInline;\nexport const parse = marked;\nexport const parser = _Parser.parse;\nexport const lexer = _Lexer.lex;\nexport { _defaults as defaults, _getDefaults as getDefaults } from './defaults.ts';\nexport { _Lexer as Lexer } from './Lexer.ts';\nexport { _Parser as Parser } from './Parser.ts';\nexport { _Tokenizer as Tokenizer } from './Tokenizer.ts';\nexport { _Renderer as Renderer } from './Renderer.ts';\nexport { _TextRenderer as TextRenderer } from './TextRenderer.ts';\nexport { _Hooks as Hooks } from './Hooks.ts';\nexport { Marked } from './Instance.ts';\nexport { useExtension as use };\nexport type * from './MarkedOptions.ts';\nexport type * from './Tokens.ts';\n","import type { MarkedOptions } from './MarkedOptions.ts';\n\n/**\n * Gets the original marked default options.\n */\nexport function _getDefaults<ParserOutput = string, RendererOutput = string>(): MarkedOptions<ParserOutput, RendererOutput> {\n  return {\n    async: false,\n    breaks: false,\n    extensions: null,\n    gfm: true,\n    hooks: null,\n    pedantic: false,\n    renderer: null,\n    silent: false,\n    tokenizer: null,\n    walkTokens: null,\n  };\n}\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport let _defaults: MarkedOptions<any, any> = _getDefaults();\n\nexport function changeDefaults<ParserOutput = string, RendererOutput = string>(newDefaults: MarkedOptions<ParserOutput, RendererOutput>) {\n  _defaults = newDefaults;\n}\n","const noopTest = { exec: () => null } as unknown as RegExp;\n\nfunction cachedIndentRegex(createRegex: (indent: number) => RegExp) {\n  const cache: RegExp[] = [];\n  return (indent: number) => {\n    const cacheIndex = Math.max(0, Math.min(3, indent - 1));\n    let regex = cache[cacheIndex];\n    if (!regex) {\n      regex = createRegex(cacheIndex);\n      cache[cacheIndex] = regex;\n    }\n    return regex;\n  };\n}\n\nfunction edit(regex: string | RegExp, opt = '') {\n  let source = typeof regex === 'string' ? regex : regex.source;\n  const obj = {\n    replace: (name: string | RegExp, val: string | RegExp) => {\n      let valSource = typeof val === 'string' ? val : val.source;\n      valSource = valSource.replace(other.caret, '$1');\n      source = source.replace(name, valSource);\n      return obj;\n    },\n    getRegex: () => {\n      return new RegExp(source, opt);\n    },\n  };\n  return obj;\n}\n\n// use a default variable to ensure the regex is evaluated on client an not removed by minifiers\nconst supportsLookbehind = ((a = '') => {\ntry {\n  return !!new RegExp('(?<=1)(?<!1)' + a);\n} catch {\n  // See browser support here:\n  // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Regular_expressions/Lookbehind_assertion\n  return false;\n}\n})();\n\nexport const other = {\n  codeRemoveIndent: /^(?: {0,3}\\t| {1,4})/gm,\n  listInterruptsParagraph: /^ {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]/,\n  outputLinkReplace: /\\\\([\\[\\]])/g,\n  indentCodeCompensation: /^(\\s+)(?:```)/,\n  beginningSpace: /^\\s+/,\n  endingHash: /#$/,\n  startingSpaceChar: /^ /,\n  endingSpaceChar: / $/,\n  endingSpaceTabChar: /[ \\t]$/,\n  nonSpaceChar: /[^ ]/,\n  newLineCharGlobal: /\\n/g,\n  tabCharGlobal: /\\t/g,\n  leadingSpaceTab: /^[ \\t]+/,\n  multipleSpaceGlobal: /\\s+/g,\n  blankLine: /^[ \\t]*$/,\n  doubleBlankLine: /\\n[ \\t]*\\n[ \\t]*$/,\n  blockquoteStart: /^ {0,3}>/,\n  // Neutralize a lazy setext underline, including one with trailing tabs.\n  // CommonMark §4.3 allows those tabs on a real underline, so the same class\n  // has to be recognized here or a lazy `===\\t` becomes a heading.\n  blockquoteSetextReplace: /\\n {0,3}((?:=+|-+)[ \\t]*)(?=\\n|$)/g,\n  blockquoteSetextReplace2: /^ {0,3}>[ \\t]?/gm,\n  blockquoteMarkerWhitespace: /^( {0,3}>)([ \\t]+)/gm,\n  listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g,\n  listIsTask: /^\\[[ xX]\\][ \\t]+\\S/,\n  listReplaceTask: /^\\[[ xX]\\][ \\t]+/,\n  listTaskCheckbox: /\\[[ xX]\\]/,\n  anyLine: /\\n.*\\n/,\n  hrefBrackets: /^<(.*)>$/,\n  tableDelimiter: /[:|]/,\n  tableAlignChars: /^\\||\\| *$/g,\n  tableRowBlankLine: /\\n[ \\t]*$/,\n  tableAlignRight: /^ *-+: *$/,\n  tableAlignCenter: /^ *:-+: *$/,\n  tableAlignLeft: /^ *:-+ *$/,\n  startATag: /^<a /i,\n  endATag: /^<\\/a>/i,\n  startPreScriptTag: /^<(pre|code|kbd|script)(\\s|>)/i,\n  endPreScriptTag: /^<\\/(pre|code|kbd|script)(\\s|>)/i,\n  startAngleBracket: /^</,\n  endAngleBracket: />$/,\n  pedanticHrefTitle: /^([^'\"]*[^\\s])\\s+(['\"])(.*)\\2/,\n  unicodeAlphaNumeric: /[\\p{L}\\p{N}]/u,\n  numericCharacterReference: /&#(?:(\\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/,\n  numericCharacterReferenceOrAmpersand: /&#(?:(\\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));|&(?!(#\\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\\w+);)/g,\n  escapeTest: /[&<>\"']/,\n  escapeReplace: /[&<>\"']/g,\n  escapeTestNoEncode: /[<>\"']|&(?!(#\\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\\w+);)/,\n  escapeReplaceNoEncode: /[<>\"']|&(?!(#\\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\\w+);)/g,\n  caret: /(^|[^\\[])\\^/g,\n  percentDecode: /%25/g,\n  findPipe: /\\|/g,\n  splitPipe: / \\|/,\n  slashPipe: /\\\\\\|/g,\n  carriageReturn: /\\r\\n|\\r/g,\n  spaceLine: /^ +$/gm,\n  notSpaceStart: /^\\S*/,\n  endingNewline: /\\n$/,\n  listItemRegex: (bull: string) => new RegExp(`^( {0,3}${bull})((?:[\\t ][^\\\\n]*)?(?:\\\\n|$))`),\n  nextBulletRegex: cachedIndentRegex((indent: number) => new RegExp(`^ {0,${indent}}(?:[*+-]|\\\\d{1,9}[.)])((?:[ \\t][^\\\\n]*)?(?:\\\\n|$))`)),\n  hrRegex: cachedIndentRegex((indent: number) => new RegExp(`^ {0,${indent}}((?:-[ \\t]*){3,}|(?:_[ \\t]*){3,}|(?:\\\\*[ \\t]*){3,})(?:\\\\n+|$)`)),\n  fencesBeginRegex: cachedIndentRegex((indent: number) => new RegExp(`^ {0,${indent}}(?:\\`\\`\\`|~~~)`)),\n  // an ATX heading needs a space (or the end of the line) after the hashes, so a line\n  // like `#tag` does not end a list item; pedantic mode accepts it as a heading\n  headingBeginRegex: cachedIndentRegex((indent: number) => new RegExp(`^ {0,${indent}}#{1,6}(?:\\\\s|$)`)),\n  pedanticHeadingBeginRegex: cachedIndentRegex((indent: number) => new RegExp(`^ {0,${indent}}#`)),\n  // a list item ends where a paragraph would be interrupted, so this mirrors the\n  // html start conditions in the paragraph rule below; type 7 is excluded there\n  htmlBeginRegex: cachedIndentRegex((indent: number) => new RegExp(`^ {0,${indent}}(?:</?(?:${_tag})(?: +|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\\\s>]|$)|!--)|<\\\\?|<![A-Za-z]|<!\\\\[CDATA\\\\[)`, 'i')),\n  blockquoteBeginRegex: cachedIndentRegex((indent: number) => new RegExp(`^ {0,${indent}}>`)),\n  // list item and blockquote markers that open nested blocks at the start of a line, as in `- > # heading`\n  nestedContainerMarkers: /^(?: {0,3}(?:(?:[*+-]|\\d{1,9}[.)])[ \\t]+|>[ \\t]?))+/,\n};\n\n/**\n * Block-Level Grammar\n */\n\nconst newline = /^(?:[ \\t]*(?:\\n|$))+/;\nconst blockCode = /^((?: {4}| {0,3}\\t)[^\\n]+(?:\\n(?:[ \\t]*(?:\\n|$))*)?)+/;\nconst fences = /^ {0,3}(`{3,}(?=[^`\\n]*(?:\\n|$))|~{3,})([^\\n]*)(?:\\n|$)(?:|([\\s\\S]*?)(?:\\n|$))(?: {0,3}(?:(?=`)\\1`*|(?=~)\\1~*) *(?=\\n|$)|$)/;\nconst hr = /^ {0,3}((?:-[\\t ]*){3,}|(?:_[ \\t]*){3,}|(?:\\*[ \\t]*){3,})(?:\\n+|$)/;\nconst heading = /^ {0,3}(#{1,6})(?=\\s|$)(.*)(?:\\n+|$)/;\nconst bullet = / {0,3}(?:[*+-]|\\d{1,9}[.)])/;\n// The underline may end with spaces or tabs (CommonMark §4.3). Internal\n// spaces or tabs still fail to match, and more than three spaces of indent\n// still do not.\nconst lheadingCore = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\\n(?!\\s*?\\n|bull |fences|blockquote|heading|hr|html|table))+?)\\n {0,3}(=+|-+)[ \\t]*(?:\\n+|$)/;\nconst lheading = edit(lheadingCore)\n  .replace(/bull/g, bullet) // lists can interrupt\n  .replace(/blockCode/g, /(?: {4}| {0,3}\\t)/) // indented code can start a block but cannot interrupt a paragraph\n  .replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/) // fenced code blocks can interrupt\n  .replace(/blockquote/g, / {0,3}>/) // blockquote can interrupt\n  .replace(/heading/g, / {0,3}#{1,6}(?:\\s|$)/) // ATX heading can interrupt\n  .replace(/hr/g, / {0,3}(?:(?:-[\\t ]*){3,}|(?:_[ \\t]*){3,}|(?:\\*[ \\t]*){3,})(?:\\n+|$)/) // thematic break can interrupt\n  .replace(/html/g, / {0,3}<[^\\n>]+>\\n/) // block html can interrupt\n  .replace(/\\|table/g, '') // table not in commonmark\n  .getRegex();\nconst lheadingGfm = edit(lheadingCore)\n  .replace(/bull/g, bullet) // lists can interrupt\n  .replace(/blockCode/g, /(?: {4}| {0,3}\\t)/) // indented code can start a block but cannot interrupt a paragraph\n  .replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/) // fenced code blocks can interrupt\n  .replace(/blockquote/g, / {0,3}>/) // blockquote can interrupt\n  .replace(/heading/g, / {0,3}#{1,6}(?:\\s|$)/) // ATX heading can interrupt\n  .replace(/hr/g, / {0,3}(?:(?:-[\\t ]*){3,}|(?:_[ \\t]*){3,}|(?:\\*[ \\t]*){3,})(?:\\n+|$)/) // thematic break can interrupt\n  .replace(/html/g, / {0,3}<[^\\n>]+>\\n/) // block html can interrupt\n  .replace(/table/g, / {0,3}\\|?(?:[:\\- ]*\\|)+[\\:\\- ]*\\n/) // table can interrupt\n  .getRegex();\nconst _paragraph = /^([^\\n]+(?:\\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \\t]+\\n)[^\\n]+)*)/;\nconst blockText = /^[^\\n]+/;\nconst _blockLabel = /(?!\\s*\\])(?:\\\\[\\s\\S]|[^\\[\\]\\\\\\n]|\\n(?![ \\t]*\\n))+/;\nconst def = edit(/^ {0,3}\\[(label)\\]: *(?:\\n[ \\t]*)?([^<\\s][^\\s]*|<.*?>)(?:(?: +(?:\\n[ \\t]*)?| *\\n[ \\t]*)(title))? *(?:\\n+|$)/)\n  .replace('label', _blockLabel)\n  // An escaped delimiter is part of the title, so a backslash must consume the\n  // next character. An optional closer (`\\\"?`) lets that character backtrack\n  // into the closing quote (`[foo]: /url \"t\\\"` is not a title).\n  .replace('title', /(?:\"(?:\\\\[\\s\\S]|[^\"\\\\])*\"|'(?:\\\\[\\s\\S]|[^'\\\\\\n]|\\n(?!\\n))*'|\\((?:\\\\[\\s\\S]|[^()\\\\])*\\))/)\n  .getRegex();\n\nconst list = edit(/^(bull)([ \\t][^\\n]*?)?(?:\\n|$)/)\n  .replace(/bull/g, bullet)\n  .getRegex();\n\nconst _tag = 'address|article|aside|base|basefont|blockquote|body|caption'\n  + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption'\n  + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe'\n  + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option'\n  + '|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title'\n  + '|tr|track|ul';\nconst _comment = /<!--(?:-?>|[\\s\\S]*?(?:-->|$))/;\nconst html = edit(\n  '^ {0,3}(?:' // optional indentation\n+ '<(script|pre|style|textarea)[\\\\s>][\\\\s\\\\S]*?(?:</\\\\1>[^\\\\n]*\\\\n*|$)' // (1)\n+ '|comment[^\\\\n]*(\\\\n+|$)' // (2)\n+ '|<\\\\?[\\\\s\\\\S]*?(?:\\\\?>[^\\\\n]*\\\\n*|$)' // (3)\n+ '|<![A-Z][\\\\s\\\\S]*?(?:>[^\\\\n]*\\\\n*|$)' // (4)\n+ '|<!\\\\[CDATA\\\\[[\\\\s\\\\S]*?(?:\\\\]\\\\]>[^\\\\n]*\\\\n*|$)' // (5)\n+ '|</?(tag)(?:[ \\\\t]+|\\\\n|/?>|$)[\\\\s\\\\S]*?(?:(?:\\\\n[ \\t]*)+\\\\n|$)' // (6)\n+ '|<(?!(?:script|pre|style|textarea)(?![a-z0-9-]))([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n[ \\t]*)+\\\\n|$)' // (7) open tag\n+ '|</[a-z][a-z0-9-]*\\\\s*>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n[ \\t]*)+\\\\n|$)' // (7) closing tag\n+ ')', 'i')\n  .replace('comment', _comment)\n  .replace('tag', _tag)\n  .replace('attribute', / +[a-zA-Z:_][\\w.:-]*(?: *= *\"[^\"\\n]*\"| *= *'[^'\\n]*'| *= *[^\\s\"'=<>`]+)?/)\n  .getRegex();\n\nconst createParagraph = (listInterrupt: RegExp) => edit(_paragraph)\n  .replace('hr', hr)\n  .replace('heading', ' {0,3}#{1,6}(?:\\\\s|$)')\n  .replace('|lheading', '') // setext headings don't interrupt commonmark paragraphs\n  .replace('|table', '')\n  .replace('blockquote', ' {0,3}>')\n  .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*(?:\\\\n|$))|~~~)[^\\\\n]*(?:\\\\n|$)')\n  .replace('list', listInterrupt)\n  .replace('html', ' {0,3}(?:</?(?:tag)(?: +|\\\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\\\s>]|$)|!--)|<\\\\?|<![A-Za-z]|<!\\\\[CDATA\\\\[)')\n  .replace('tag', _tag) // pars can be interrupted by html blocks of types (1) to (6)\n  .getRegex();\n\n// only non-empty lists starting from 1 can interrupt paragraphs\nconst paragraph = createParagraph(/ {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]/);\n// inside a blockquote a bare list marker (any number) starts a sibling list,\n// so it must not be lazily continued as paragraph text (unlike a top level\n// paragraph, where an empty list cannot interrupt)\nconst blockquoteParagraph = createParagraph(/ {0,3}(?:[*+-]|\\d{1,9}[.)])(?:[ \\t]|\\n|$)/);\n\n// a line with only whitespace after the marker is blank, so it must not start a\n// paragraph that lazily continues onto the next line\nconst blockquote = edit(/^( {0,3}> ?(?:(?![ \\t]*(?:\\n|$))(paragraph)|[^\\n]*)(?:\\n|$))+/)\n  .replace('paragraph', blockquoteParagraph)\n  .getRegex();\n\n/**\n * Normal Block Grammar\n */\n\nconst blockNormal = {\n  blockquote,\n  code: blockCode,\n  def,\n  fences,\n  heading,\n  hr,\n  html,\n  lheading,\n  list,\n  newline,\n  paragraph,\n  table: noopTest,\n  text: blockText,\n};\n\ntype BlockKeys = keyof typeof blockNormal;\n\n/**\n * GFM Block Grammar\n */\n\nconst gfmTable = edit(\n  '^ *([^\\\\n ].*)\\\\n' // Header\n+ ' {0,3}((?:\\\\| *)?:?-+:? *(?:\\\\| *:?-+:? *)*(?:\\\\| *)?)' // Align\n+ '(?:\\\\n((?:(?! *\\\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\\\n|$))*)\\\\n*|$)') // Cells\n  .replace('hr', hr)\n  .replace('heading', ' {0,3}#{1,6}(?:\\\\s|$)')\n  .replace('blockquote', ' {0,3}>')\n  .replace('code', '(?: {4}| {0,3}\\t)[^\\\\n]')\n  .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*(?:\\\\n|$))|~~~)[^\\\\n]*(?:\\\\n|$)')\n  .replace('list', ' {0,3}(?:[*+-]|1[.)])[ \\\\t]') // any bullet ends the table rows\n  .replace('html', ' {0,3}(?:</?(?:tag)(?: +|\\\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\\\s>]|$)|!--)|<\\\\?|<![A-Za-z]|<!\\\\[CDATA\\\\[)')\n  .replace('tag', _tag) // tables can be interrupted by html blocks of types (1) to (6)\n  .getRegex();\n\nconst blockGfm: Record<BlockKeys, RegExp> = {\n  ...blockNormal,\n  lheading: lheadingGfm,\n  table: gfmTable,\n  paragraph: edit(_paragraph)\n    .replace('hr', hr)\n    .replace('heading', ' {0,3}#{1,6}(?:\\\\s|$)')\n    .replace('|lheading', '') // setext headings don't interrupt commonmark paragraphs\n    .replace('table', gfmTable) // interrupt paragraphs with table\n    .replace('blockquote', ' {0,3}>')\n    .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*(?:\\\\n|$))|~~~)[^\\\\n]*(?:\\\\n|$)')\n    .replace('list', ' {0,3}(?:[*+-]|1[.)])[ \\\\t]+[^ \\\\t\\\\n]') // only non-empty lists starting from 1 can interrupt\n    .replace('html', ' {0,3}(?:</?(?:tag)(?: +|\\\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\\\s>]|$)|!--)|<\\\\?|<![A-Za-z]|<!\\\\[CDATA\\\\[)')\n    .replace('tag', _tag) // pars can be interrupted by html blocks of types (1) to (6)\n    .getRegex(),\n};\n\n/**\n * Pedantic grammar (original John Gruber's loose markdown specification)\n */\n\nconst blockPedantic: Record<BlockKeys, RegExp> = {\n  ...blockNormal,\n  html: edit(\n    '^ *(?:comment(?: *\\\\n|\\\\s*$)'\n    + '|<(tag)[\\\\s\\\\S]+?</\\\\1>(?: *\\\\n{2,}|\\\\s*$)' // closed tag\n    + '|<tag(?:\"[^\"]*\"|\\'[^\\']*\\'|\\\\s[^\\'\"/>\\\\s]*)*?/?>(?: *\\\\n{2,}|\\\\s*$))')\n    .replace('comment', _comment)\n    .replace(/tag/g, '(?!(?:'\n      + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub'\n      + '|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)'\n      + '\\\\b)\\\\w+(?!:|[^\\\\w\\\\s@]*@)\\\\b')\n    .getRegex(),\n  def: /^ *\\[([^\\]]+)\\]: *<?([^\\s>]+)>?(?: +([\"(][^\\n]+[\")]))? *(?:\\n+|$)/,\n  heading: /^(#{1,6})(.*)(?:\\n+|$)/,\n  fences: noopTest, // fences not supported\n  lheading: /^(.+?)\\n {0,3}(=+|-+) *(?:\\n+|$)/,\n  paragraph: edit(_paragraph)\n    .replace('hr', hr)\n    .replace('heading', ' *#{1,6} *[^\\n]')\n    .replace('lheading', lheading)\n    .replace('|table', '')\n    .replace('blockquote', ' {0,3}>')\n    .replace('|fences', '')\n    .replace('|list', '')\n    .replace('|html', '')\n    .replace('|tag', '')\n    .getRegex(),\n};\n\n/**\n * Inline-Level Grammar\n */\n\nconst escape = /^\\\\([!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~])/;\nconst inlineCode = /^(`+)([^`]|[^`][\\s\\S]*?[^`])\\1(?!`)/;\nconst br = /^( {2,}|\\\\)\\n(?!\\s*$)[ \\t]*/;\nconst inlineText = /^(`+|[^`])(?:(?= {2,}\\n)|[\\s\\S]*?(?:(?=[\\\\<!\\[`*_]|\\b_|$)|[^ ](?= {2,}\\n)))/;\n\n// list of unicode punctuation marks, plus any missing characters from CommonMark spec\nconst _punctuation = /[\\p{P}\\p{S}]/u;\nconst _punctuationOrSpace = /[\\s\\p{P}\\p{S}]/u;\nconst _notPunctuationOrSpace = /[^\\s\\p{P}\\p{S}]/u;\nconst punctuation = edit(/^((?![*_])punctSpace)/, 'u')\n  .replace(/punctSpace/g, _punctuationOrSpace).getRegex();\n\n/**\n * Opening punct/quotes excluded from pedantic LDelim nextChar so\n * `aa**\"A\"**bb` / `aa**(A)**bb` can start strong (Pi + Ps + ASCII straight quotes).\n */\nconst _openQuote = /[\\p{Pi}\\p{Ps}\"']/u;\n\n// GFM allows ~ inside strong and em for strikethrough\nconst _punctuationGfmStrongEm = /(?!~)[\\p{P}\\p{S}]/u;\nconst _punctuationOrSpaceGfmStrongEm = /(?!~)[\\s\\p{P}\\p{S}]/u;\nconst _notPunctuationOrSpaceGfmStrongEm = /(?:[^\\s\\p{P}\\p{S}]|~)/u;\n\n// sequences em should skip over [title](link), `code`, <html>\nconst blockSkip = edit(/link|precode-code|html/, 'g')\n  .replace('link', /\\[(?:[^\\[\\]`]|(?<a>`+)[^`]+\\k<a>(?!`))*?\\]\\((?:\\\\[\\s\\S]|[^\\\\\\(\\)]|\\((?:\\\\[\\s\\S]|[^\\\\\\(\\)])*\\))*\\)/)\n  .replace('precode-', supportsLookbehind ? '(?<!`)()' : '(^^|[^`])')\n  .replace('code', /(?<b>`+)[^`]+\\k<b>(?!`)/)\n  .replace('html', /<(?! )[^<>]*?>/)\n  .getRegex();\n\nconst emStrongLDelimCore = /^(?:\\*+(?:((?!\\*)punct)|([^\\s*]))?)|^_+(?:((?!_)punct)|([^\\s_]))?/;\n\nconst emStrongLDelim = edit(emStrongLDelimCore, 'u')\n  .replace(/punct/g, _punctuation)\n  .getRegex();\n\nconst emStrongLDelimGfm = edit(emStrongLDelimCore, 'u')\n  .replace(/punct/g, _punctuationGfmStrongEm)\n  .getRegex();\n\n// Pedantic: do not treat opening punct/quotes as left-delim punct (e.g. **( / **\").\nconst emStrongLDelimPedanticCore = /^(?:\\*+(?:((?!\\*)(?!openQuote)punct)|([^\\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\\s_]))?/;\n\nconst emStrongLDelimPedantic = edit(emStrongLDelimPedanticCore, 'u')\n  .replace(/openQuote/g, _openQuote)\n  .replace(/punct/g, _punctuation)\n  .getRegex();\n\nconst emStrongRDelimAstCore =\n  '^[^_*]*?__[^_*]*?\\\\*[^_*]*?(?=__)' // Skip orphan inside strong\n+ '|[^*]+(?=[^*])' // Consume to delim\n+ '|(?!\\\\*)punct(\\\\*+)(?=[\\\\s]|$)' // (1) #*** can only be a Right Delimiter\n+ '|notPunctSpace(\\\\*+)(?!\\\\*)(?=punctSpace|$)' // (2) a***#, a*** can only be a Right Delimiter\n+ '|(?!\\\\*)punctSpace(\\\\*+)(?=notPunctSpace)' // (3) #***a, ***a can only be Left Delimiter\n+ '|[\\\\s](\\\\*+)(?!\\\\*)(?=punct)' // (4) ***# can only be Left Delimiter\n+ '|(?!\\\\*)punct(\\\\*+)(?!\\\\*)(?=punct)' // (5) #***# can be either Left or Right Delimiter\n+ '|notPunctSpace(\\\\*+)(?=notPunctSpace)'; // (6) a***a can be either Left or Right Delimiter\n\nconst emStrongRDelimAst = edit(emStrongRDelimAstCore, 'gu')\n  .replace(/notPunctSpace/g, _notPunctuationOrSpace)\n  .replace(/punctSpace/g, _punctuationOrSpace)\n  .replace(/punct/g, _punctuation)\n  .getRegex();\n\nconst emStrongRDelimAstGfm = edit(emStrongRDelimAstCore, 'gu')\n  .replace(/notPunctSpace/g, _notPunctuationOrSpaceGfmStrongEm)\n  .replace(/punctSpace/g, _punctuationOrSpaceGfmStrongEm)\n  .replace(/punct/g, _punctuationGfmStrongEm)\n  .getRegex();\n\n// Pedantic: rule 3 requires whitespace before left delim; rule 6 allows punct before close (e.g. `:**bar`).\nconst emStrongRDelimAstPedanticCore =\n  '^[^_*]*?__[^_*]*?\\\\*[^_*]*?(?=__)' // Skip orphan inside strong\n+ '|[^*]+(?=[^*])' // Consume to delim\n+ '|(?!\\\\*)punct(\\\\*+)(?=[\\\\s]|$)' // (1) #*** can only be a Right Delimiter\n+ '|notPunctSpace(\\\\*+)(?!\\\\*)(?=punctSpace|$)' // (2) a***#, a*** can only be a Right Delimiter\n+ '|(?!\\\\*)[\\\\s](\\\\*+)(?=notPunctSpace)' // (3) ***a can only be Left Delimiter (whitespace required; not #***a)\n+ '|[\\\\s](\\\\*+)(?!\\\\*)(?=punct)' // (4) ***# can only be Left Delimiter\n+ '|(?!\\\\*)punct(\\\\*+)(?!\\\\*)(?=punct)' // (5) #***# can be either Left or Right Delimiter\n+ '|(?:(?!\\\\*)punct|notPunctSpace)(\\\\*+)(?!\\\\*)(?=notPunctSpace)'; // (6) a***a, #***a, and :** (e.g. **foo:**bar)\n\nconst emStrongRDelimAstPedantic = edit(emStrongRDelimAstPedanticCore, 'gu')\n  .replace(/notPunctSpace/g, _notPunctuationOrSpace)\n  .replace(/punctSpace/g, _punctuationOrSpace)\n  .replace(/punct/g, _punctuation)\n  .getRegex();\n\n// Normal: no rule 6 for _ (a___a cannot close as emphasis).\nconst emStrongRDelimUnd = edit(\n  '^[^_*]*?\\\\*\\\\*[^_*]*?_[^_*]*?(?=\\\\*\\\\*)' // Skip orphan inside strong\n+ '|[^_]+(?=[^_])' // Consume to delim\n+ '|(?!_)punct(_+)(?=[\\\\s]|$)' // (1) #___ can only be a Right Delimiter\n+ '|notPunctSpace(_+)(?!_)(?=punctSpace|$)' // (2) a___#, a___ can only be a Right Delimiter\n+ '|(?!_)punctSpace(_+)(?=notPunctSpace)' // (3) #___a, ___a can only be Left Delimiter\n+ '|[\\\\s](_+)(?!_)(?=punct)' // (4) ___# can only be Left Delimiter\n+ '|(?!_)punct(_+)(?!_)(?=punct)', 'gu') // (5) #___# can be either Left or Right Delimiter\n  .replace(/notPunctSpace/g, _notPunctuationOrSpace)\n  .replace(/punctSpace/g, _punctuationOrSpace)\n  .replace(/punct/g, _punctuation)\n  .getRegex();\n\n// Pedantic: same rule 3/6 adjustments as emStrongRDelimAstPedantic (e.g. `_foo:_bar`).\nconst emStrongRDelimUndPedanticCore =\n  '^[^_*]*?\\\\*\\\\*[^_*]*?_[^_*]*?(?=\\\\*\\\\*)' // Skip orphan inside strong\n+ '|[^_]+(?=[^_])' // Consume to delim\n+ '|(?!_)punct(_+)(?=[\\\\s]|$)' // (1) #___ can only be a Right Delimiter\n+ '|notPunctSpace(_+)(?!_)(?=punctSpace|$)' // (2) a___#, a___ can only be a Right Delimiter\n+ '|(?!_)[\\\\s](_+)(?=notPunctSpace)' // (3) ___a can only be Left Delimiter (whitespace required; not #___a)\n+ '|[\\\\s](_+)(?!_)(?=punct)' // (4) ___# can only be Left Delimiter\n+ '|(?!_)punct(_+)(?!_)(?=punct)' // (5) #___# can be either Left or Right Delimiter\n+ '|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)'; // (6) a___a, #___a, and :__ (e.g. _foo:_bar)\n\nconst emStrongRDelimUndPedantic = edit(emStrongRDelimUndPedanticCore, 'gu')\n  .replace(/notPunctSpace/g, _notPunctuationOrSpace)\n  .replace(/punctSpace/g, _punctuationOrSpace)\n  .replace(/punct/g, _punctuation)\n  .getRegex();\n\n// Tilde left delimiter for strikethrough (similar to emStrongLDelim for asterisk)\nconst delLDelim = edit(/^~~?(?:((?!~)punct)|[^\\s~])/, 'u')\n  .replace(/punct/g, _punctuation)\n  .getRegex();\n\n// Tilde delimiter patterns for strikethrough (similar to asterisk)\nconst delRDelimCore =\n  '^[^~]+(?=[^~])' // Consume to delim\n+ '|(?!~)punct(~~?)(?=[\\\\s]|$)' // (1) #~~ can only be a Right Delimiter\n+ '|notPunctSpace(~~?)(?!~)(?=punctSpace|$)' // (2) a~~#, a~~ can only be a Right Delimiter\n+ '|(?!~)punctSpace(~~?)(?=notPunctSpace)' // (3) #~~a, ~~a can only be Left Delimiter\n+ '|[\\\\s](~~?)(?!~)(?=punct)' // (4) ~~# can only be Left Delimiter\n+ '|(?!~)punct(~~?)(?!~)(?=punct)' // (5) #~~# can be either Left or Right Delimiter\n+ '|notPunctSpace(~~?)(?=notPunctSpace)'; // (6) a~~a can be either Left or Right Delimiter\n\nconst delRDelim = edit(delRDelimCore, 'gu')\n  .replace(/notPunctSpace/g, _notPunctuationOrSpace)\n  .replace(/punctSpace/g, _punctuationOrSpace)\n  .replace(/punct/g, _punctuation)\n  .getRegex();\n\nconst anyPunctuation = edit(/\\\\(punct)/, 'gu')\n  .replace(/punct/g, _punctuation)\n  .getRegex();\n\n// `anyPunctuation` for the em/strong mask. A backslash is literal inside a code\n// span, so a code span (matched like `inline.code`), or a backtick run that\n// opens none, is matched whole and kept; only the escapes outside code spans\n// are masked.\nconst anyPunctuationOutsideCode = edit(/(`+)(?:[^`]|[^`][\\s\\S]*?[^`])\\1(?!`)|`+|\\\\(punct)/, 'gu')\n  .replace(/punct/g, _punctuation)\n  .getRegex();\n\nconst autolink = edit(/^<(scheme:[^\\s\\x00-\\x1f<>]*|email)>/)\n  .replace('scheme', /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/)\n  .replace('email', /[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  .getRegex();\n\nconst _inlineComment = edit(_comment).replace('(?:-->|$)', '-->').getRegex();\nconst tag = edit(\n  '^comment'\n    + '|^</[a-zA-Z][a-zA-Z0-9-]*\\\\s*>' // self-closing tag\n    + '|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\\\s*/?>' // open tag\n    + '|^<\\\\?[\\\\s\\\\S]*?\\\\?>' // processing instruction, e.g. <?php ?>\n    + '|^<![a-zA-Z]+\\\\s[\\\\s\\\\S]*?>' // declaration, e.g. <!DOCTYPE html>\n    + '|^<!\\\\[CDATA\\\\[[\\\\s\\\\S]*?\\\\]\\\\]>') // CDATA section\n  .replace('comment', _inlineComment)\n  .replace('attribute', /\\s+[a-zA-Z:_][\\w.:-]*(?:\\s*=\\s*\"[^\"]*\"|\\s*=\\s*'[^']*'|\\s*=\\s*[^\\s\"'=<>`]+)?/)\n  .getRegex();\n\n// One matched pair of brackets, holding no bracket of its own.\nconst _inlineLabelBrackets = /\\[(?:\\\\[\\s\\S]|[^\\[\\]\\\\])*\\]/;\n// CommonMark lets the brackets in a link label nest to any depth, which a regex\n// cannot follow, so it stops at a fixed one. Two levels is what the spec suite\n// asks for: a third and a fourth flip no further example.\nconst _inlineLabel = edit(/(?:\\[(?:brackets|\\\\[\\s\\S]|[^\\[\\]\\\\])*\\]|\\\\[\\s\\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\\])|[^\\[\\]\\\\`])*?/)\n  .replace('brackets', _inlineLabelBrackets)\n  .getRegex();\n\nconst link = edit(/^!?\\[(label)\\]\\([ \\t\\n]*(href)(?:(?:[ \\t]+(?:\\n[ \\t]*)?|\\n[ \\t]*)(title))?[ \\t\\n]*\\)/)\n  .replace('label', _inlineLabel)\n  .replace('href', /<(?:\\\\.|[^\\n<>\\\\])+>|[^ \\t\\n\\x00-\\x1f]+|(?=\\))/)\n  // Same as the definition title: the escaped character is not the closer.\n  .replace('title', /\"(?:\\\\[\\s\\S]|[^\"\\\\])*\"|'(?:\\\\[\\s\\S]|[^'\\\\])*'|\\((?:\\\\[\\s\\S]|[^)\\\\])*\\)/)\n  .getRegex();\n\nconst reflink = edit(/^!?\\[(label)\\]\\[(ref)\\]/)\n  .replace('label', _inlineLabel)\n  .replace('ref', _blockLabel)\n  .getRegex();\n\nconst nolink = edit(/^!?\\[(ref)\\](?:\\[\\])?/)\n  .replace('ref', _blockLabel)\n  .getRegex();\n\n// `reflink` and `nolink` are anchored, so the tokenizer tries each of them at a\n// single position. `reflinkSearch` drops the anchors and runs with the global\n// flag, which makes every '[' in the source a start position. A label crosses a\n// bracket only by escaping it, and nothing caps how often it does, so a\n// candidate that can never match still scans to the end of the source and the\n// whole pass costs O(n^2).\n//\n// The labels below bound that scan. `_boundedInlineLabel` limits how many\n// escapes, code spans and nested brackets a link text may hold, leaving runs of\n// ordinary characters unbounded so link text of any length is still found.\n// `_boundedBlockLabel` limits the label itself to 999 items, which is every\n// label CommonMark allows: \"A link label can have at most 999 characters\n// inside the square brackets.\"\nconst _boundedBlockLabel = /(?!\\s*\\])(?:\\\\[\\s\\S]|[^\\[\\]\\\\]){1,999}/;\nconst _boundedInlineLabel = edit(/(?:[^\\[\\]\\\\`]*(?:\\[(?:brackets|\\\\[\\s\\S]|[^\\[\\]\\\\])*\\]|\\\\[\\s\\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\\]))){0,999}?[^\\[\\]\\\\`]*?/)\n  .replace('brackets', _inlineLabelBrackets)\n  .getRegex();\n\nconst reflinkSearch = edit('reflink|nolink(?!\\\\()', 'g')\n  .replace('reflink', edit(/^!?\\[(label)\\]\\[(ref)\\]/)\n    .replace('label', _boundedInlineLabel)\n    .replace('ref', _boundedBlockLabel)\n    .getRegex())\n  .replace('nolink', edit(/^!?\\[(ref)\\](?:\\[\\])?/)\n    .replace('ref', _boundedBlockLabel)\n    .getRegex())\n  .getRegex();\n\nconst _caseInsensitiveProtocol = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/;\nconst _extendedEmail = /[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\\w-])/;\nconst _extendedEmailProtocol = edit(/(?:mailto:email|xmpp:email(?:\\/[A-Za-z0-9@.]+)?)/)\n  .replace(/email/g, _extendedEmail)\n  .getRegex();\n\n/**\n * Normal Inline Grammar\n */\n\nconst inlineNormal = {\n  _backpedal: noopTest, // only used for GFM url\n  anyPunctuation,\n  anyPunctuationOutsideCode,\n  autolink,\n  blockSkip,\n  br,\n  code: inlineCode,\n  del: noopTest,\n  delLDelim: noopTest,\n  delRDelim: noopTest,\n  emStrongLDelim,\n  emStrongRDelimAst,\n  emStrongRDelimUnd,\n  escape,\n  link,\n  nolink,\n  punctuation,\n  reflink,\n  reflinkSearch,\n  tag,\n  text: inlineText,\n  url: noopTest,\n};\n\ntype InlineKeys = keyof typeof inlineNormal;\n\n/**\n * Pedantic Inline Grammar\n */\n\nconst inlinePedantic: Record<InlineKeys, RegExp> = {\n  ...inlineNormal,\n  emStrongLDelim: emStrongLDelimPedantic,\n  emStrongRDelimAst: emStrongRDelimAstPedantic,\n  emStrongRDelimUnd: emStrongRDelimUndPedantic,\n  link: edit(/^!?\\[(label)\\]\\((.*?)\\)/)\n    .replace('label', _inlineLabel)\n    .getRegex(),\n  reflink: edit(/^!?\\[(label)\\]\\s*\\[([^\\]]*)\\]/)\n    .replace('label', _inlineLabel)\n    .getRegex(),\n};\n\n/**\n * GFM Inline Grammar\n */\n\nconst inlineGfm: Record<InlineKeys, RegExp> = {\n  ...inlineNormal,\n  emStrongRDelimAst: emStrongRDelimAstGfm,\n  emStrongLDelim: emStrongLDelimGfm,\n  delLDelim,\n  delRDelim,\n  url: edit(/^emailProtocol|^((?:protocol):\\/\\/|www\\.)(?:[a-zA-Z0-9\\-]+\\.?)+[^\\s<]*|^email/)\n    .replace('emailProtocol', _extendedEmailProtocol)\n    .replace('protocol', _caseInsensitiveProtocol)\n    .replace('email', /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\\w-])/)\n    .getRegex(),\n  _backpedal: /(?:[^?!.,:;*_'\"~()&]+|\\([^)]*\\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'\"~)]+(?!$))+/,\n  del: /^(~~?)(?=[^\\s~])((?:\\\\[\\s\\S]|[^\\\\])*?(?:\\\\[\\s\\S]|[^\\s~\\\\]))\\1(?=[^~]|$)/,\n  text: edit(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\\n)|(?=[a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-]+@)|[\\s\\S]*?(?:(?=[\\\\<!\\[`*~_]|\\b_|protocol:\\/\\/|wwwStart|$)|[^ ](?= {2,}\\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-](?=[a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-]+@))))/)\n    .replace('protocol', _caseInsensitiveProtocol)\n    .replace(/emailProtocol/g, /(?:mailto|xmpp):/)\n    // GFM: a www autolink starts only at the beginning of a line, after whitespace or after\n    // `*`, `_`, `~` or `(`. Without lookbehind support, keep stopping at every `www.`.\n    .replace('wwwStart', supportsLookbehind ? '(?<![^\\\\s*_~(])www\\\\.' : 'www\\\\.')\n    .getRegex(),\n};\n\n/**\n * GFM + Line Breaks Inline Grammar\n */\n\nconst inlineBreaks: Record<InlineKeys, RegExp> = {\n  ...inlineGfm,\n  br: edit(br).replace('{2,}', '*').getRegex(),\n  text: edit(inlineGfm.text)\n    .replace('\\\\b_', '\\\\b_| {2,}\\\\n')\n    .replace(/\\{2,\\}/g, '*')\n    .getRegex(),\n};\n\n/**\n * exports\n */\n\nexport const block = {\n  normal: blockNormal,\n  gfm: blockGfm,\n  pedantic: blockPedantic,\n};\n\nexport const inline = {\n  normal: inlineNormal,\n  gfm: inlineGfm,\n  breaks: inlineBreaks,\n  pedantic: inlinePedantic,\n};\n\nexport interface Rules {\n  other: typeof other\n  block: Record<BlockKeys, RegExp>\n  inline: Record<InlineKeys, RegExp>\n}\n","import { other } from './rules.ts';\n\n/**\n * Helpers\n */\nconst escapeReplacements: { [index: string]: string } = {\n  '&': '&amp;',\n  '<': '&lt;',\n  '>': '&gt;',\n  '\"': '&quot;',\n  \"'\": '&#39;',\n};\nconst getEscapeReplacement = (ch: string) => escapeReplacements[ch];\n\nexport function escapeHtmlEntities(html: string, encode?: boolean) {\n  if (encode) {\n    if (other.escapeTest.test(html)) {\n      return html.replace(other.escapeReplace, getEscapeReplacement);\n    }\n  } else {\n    if (other.escapeTestNoEncode.test(html)) {\n      return html.replace(other.escapeReplaceNoEncode, getEscapeReplacement);\n    }\n  }\n\n  return html;\n}\n\n/**\n * Numeric character references are recognized outside code and are equivalent to the\n * character they name. Values that are zero, out of range, or a surrogate become the\n * replacement character.\n */\nexport function decodeNumericCharacterReferences(text: string) {\n  if (!other.numericCharacterReference.test(text)) {\n    return text;\n  }\n  // A decoded character must not join its neighbours into a new reference,\n  // so every `&` that is not already one is escaped here.\n  return text.replace(other.numericCharacterReferenceOrAmpersand, (ref: string, dec?: string, hex?: string) => {\n    if (dec === undefined && hex === undefined) {\n      return '&amp;';\n    }\n    const code = dec === undefined ? Number.parseInt(hex!, 16) : Number.parseInt(dec, 10);\n    if (code === 0 || code > 0x10ffff || (code >= 0xd800 && code <= 0xdfff)) {\n      return '�';\n    }\n    return code === 38 ? '&amp;' : String.fromCodePoint(code);\n  });\n}\n\nexport function cleanUrl(href: string) {\n  try {\n    href = encodeURI(href).replace(other.percentDecode, '%');\n  } catch {\n    return null;\n  }\n  return href;\n}\n\nexport function splitCells(tableRow: string, count?: number) {\n  // ensure that every cell-delimiting pipe has a space\n  // before it to distinguish it from an escaped pipe\n  const row = tableRow.replace(other.findPipe, (match, offset, str) => {\n      let escaped = false;\n      let curr = offset;\n      while (--curr >= 0 && str[curr] === '\\\\') escaped = !escaped;\n      if (escaped) {\n        // odd number of slashes means | is escaped\n        // so we leave it alone\n        return '|';\n      } else {\n        // add space before unescaped |\n        return ' |';\n      }\n    }),\n    cells = row.split(other.splitPipe);\n  let i = 0;\n\n  // First/last cell in a row cannot be empty if it has no leading/trailing pipe\n  if (!cells[0].trim()) {\n    cells.shift();\n  }\n  if (cells.length > 0 && !cells.at(-1)?.trim()) {\n    cells.pop();\n  }\n\n  if (count) {\n    if (cells.length > count) {\n      cells.splice(count);\n    } else {\n      while (cells.length < count) cells.push('');\n    }\n  }\n\n  for (; i < cells.length; i++) {\n    // leading or trailing whitespace is ignored per the gfm spec\n    cells[i] = cells[i].trim().replace(other.slashPipe, '|');\n  }\n  return cells;\n}\n\n/**\n * Remove trailing 'c's. Equivalent to str.replace(/c*$/, '').\n * /c*$/ is vulnerable to REDOS.\n *\n * @param str\n * @param c\n * @param invert Remove suffix of non-c chars instead. Default falsey.\n */\nexport function rtrim(str: string, c: string, invert?: boolean) {\n  const l = str.length;\n  if (l === 0) {\n    return '';\n  }\n\n  // Length of suffix matching the invert condition.\n  let suffLen = 0;\n\n  // Step left until we fail to match the invert condition.\n  while (suffLen < l) {\n    const currChar = str.charAt(l - suffLen - 1);\n    if (currChar === c && !invert) {\n      suffLen++;\n    } else if (currChar !== c && invert) {\n      suffLen++;\n    } else {\n      break;\n    }\n  }\n\n  return str.slice(0, l - suffLen);\n}\n\nexport function trimTrailingBlankLines(str: string) {\n  const lines = str.split('\\n');\n  let end = lines.length - 1;\n  while (end >= 0 && other.blankLine.test(lines[end])) {\n    end--;\n  }\n  if (lines.length - end <= 2) {\n    // we want to keep single trailing blank lines\n    return str;\n  }\n\n  return lines.slice(0, end + 1).join('\\n');\n}\n\n/**\n * Normalizes a link label so definitions and references can be matched.\n * CommonMark asks for a Unicode case fold, which `toLowerCase()` does not\n * reach: `ẞ` lowercases to `ß` and so never meets `SS`. Round-tripping\n * through upper case does, as in commonmark.js; the final `toLowerCase()`\n * keeps the folded label lower case, the form `def.tag` has always used.\n */\nexport function normalizeLabel(label: string) {\n  // The spec also asks for leading and trailing spaces, tabs and line endings\n  // to be stripped, and for internal runs of them to collapse to one space.\n  // Doing it here keeps every call site in agreement: the definition and the\n  // reference have to normalize to the same key.\n  return label.trim().replace(other.multipleSpaceGlobal, ' ').toLowerCase().toUpperCase().toLowerCase();\n}\n\nexport function findClosingBracket(str: string, b: string) {\n  // an opening bracket on its own is still unbalanced, so both have to be absent\n  if (str.indexOf(b[0]) === -1 && str.indexOf(b[1]) === -1) {\n    return -1;\n  }\n\n  let level = 0;\n  for (let i = 0; i < str.length; i++) {\n    if (str[i] === '\\\\') {\n      i++;\n    } else if (str[i] === b[0]) {\n      level++;\n    } else if (str[i] === b[1]) {\n      level--;\n      if (level < 0) {\n        return i;\n      }\n    }\n  }\n  if (level > 0) {\n    return -2;\n  }\n\n  return -1;\n}\n\ninterface LastPossibleEmStrongCloserIndex {\n  /** Last `*` run that can close emphasis or strong. `-1` if none. */\n  '*': number;\n  /** Last `_` run that can close emphasis or strong. `-1` if none. */\n  _: number;\n}\n\n/**\n * Closer hints for one inline `maskedSrc`. Held only while that pass runs.\n */\ninterface EmStrongDelCloserHintFrame {\n  maskedSrc: string;\n  lastPossibleEmStrongCloserIndex: LastPossibleEmStrongCloserIndex;\n  /** Last `~` run that can close strikethrough. `-1` if none. */\n  lastPossibleDelCloserIndex: number;\n}\n\n/**\n * Hint stacks for inline passes currently running. Keyed by the tokenizer\n * instance so parses do not share frames. Nested `inlineTokens` calls push\n * a frame. The entry is removed when the outermost pass ends, so\n * `maskedSrc` is not retained once parsing returns (#4099).\n */\nconst emStrongDelCloserHintStacks = new WeakMap<object, EmStrongDelCloserHintFrame[]>();\n\n/**\n * Last indexes of `*` / `_` runs that can close emphasis or strong, and of\n * a `~` run that can close strikethrough.\n *\n * A run can close only when it is not preceded by ASCII whitespace or the\n * start of the string. The right-delim regexes accept a closer only in\n * groups 1, 2, 5, and 6, and each of those requires that predecessor. When\n * the opener's window has no such run, the regex scan cannot succeed.\n * Finding one only means \"keep looking\": CommonMark rules 9–10 and mid-run\n * openers are still applied in the loop (#4099).\n */\nfunction scanLastPossibleEmStrongDelClosers(src: string): EmStrongDelCloserHintFrame {\n  const lastPossibleEmStrongCloserIndex: LastPossibleEmStrongCloserIndex = { '*': -1, _: -1 };\n  let lastPossibleDelCloserIndex = -1;\n  const len = src.length;\n  for (let i = 0; i < len; i++) {\n    const ch = src[i];\n    if (ch !== '*' && ch !== '_' && ch !== '~') {\n      continue;\n    }\n    // A leading run has no predecessor, same as one after a line break.\n    const prev = i === 0 ? '\\n' : src[i - 1];\n    let j = i + 1;\n    while (j < len && src[j] === ch) {\n      j++;\n    }\n    if (prev !== ' ' && prev !== '\\t' && prev !== '\\n' && prev !== '\\r' && prev !== '\\f') {\n      if (ch === '~') {\n        lastPossibleDelCloserIndex = i;\n      } else {\n        lastPossibleEmStrongCloserIndex[ch] = i;\n      }\n    }\n    i = j - 1;\n  }\n  return {\n    maskedSrc: src,\n    lastPossibleEmStrongCloserIndex,\n    lastPossibleDelCloserIndex,\n  };\n}\n\n/**\n * Scan `maskedSrc` once for the last `*` / `_` run that can close emphasis\n * or strong and the last `~` run that can close strikethrough.\n * `endEmStrongDelCloserScan` drops this frame when the inline pass ends.\n */\nexport function beginEmStrongDelCloserScan(tokenizer: object, maskedSrc: string): void {\n  const frame = scanLastPossibleEmStrongDelClosers(maskedSrc);\n  const stack = emStrongDelCloserHintStacks.get(tokenizer);\n  if (stack) {\n    stack.push(frame);\n  } else {\n    emStrongDelCloserHintStacks.set(tokenizer, [frame]);\n  }\n}\n\n/**\n * Drop the closer-hint frame for the inline pass that just finished.\n * Removing the last frame drops the tokenizer's `maskedSrc` reference.\n */\nexport function endEmStrongDelCloserScan(tokenizer: object): void {\n  const stack = emStrongDelCloserHintStacks.get(tokenizer);\n  if (!stack) {\n    return;\n  }\n  stack.pop();\n  if (stack.length === 0) {\n    emStrongDelCloserHintStacks.delete(tokenizer);\n  }\n}\n\n/**\n * Index in `maskedSrc` of the last `*` or `_` run that can close emphasis\n * or strong. Uses the active inline-pass scan when `maskedSrc` is that\n * pass's source; otherwise scans this string and discards the result.\n */\nexport function cachedLastPossibleEmStrongCloserIndex(tokenizer: object, maskedSrc: string, delim: '*' | '_'): number {\n  const frame = emStrongDelCloserHintStacks.get(tokenizer)?.at(-1);\n  if (frame && frame.maskedSrc === maskedSrc) {\n    return frame.lastPossibleEmStrongCloserIndex[delim];\n  }\n  return scanLastPossibleEmStrongDelClosers(maskedSrc).lastPossibleEmStrongCloserIndex[delim];\n}\n\n/**\n * Index in `maskedSrc` of the last `~` run that can close strikethrough.\n * Uses the active inline-pass scan when `maskedSrc` is that pass's\n * source; otherwise scans this string and discards the result.\n */\nexport function cachedLastPossibleDelCloserIndex(tokenizer: object, maskedSrc: string): number {\n  const frame = emStrongDelCloserHintStacks.get(tokenizer)?.at(-1);\n  if (frame && frame.maskedSrc === maskedSrc) {\n    return frame.lastPossibleDelCloserIndex;\n  }\n  return scanLastPossibleEmStrongDelClosers(maskedSrc).lastPossibleDelCloserIndex;\n}\n\nexport function expandTabs(line: string, indent = 0) {\n  let col = indent;\n  let expanded = '';\n  for (const char of line) {\n    if (char === '\\t') {\n      const added = 4 - (col % 4);\n      expanded += ' '.repeat(added);\n      col += added;\n    } else {\n      expanded += char;\n      col++;\n    }\n  }\n\n  return expanded;\n}\n","import { _defaults } from './defaults.ts';\nimport {\n  rtrim,\n  splitCells,\n  findClosingBracket,\n  expandTabs,\n  normalizeLabel,\n  decodeNumericCharacterReferences,\n  trimTrailingBlankLines,\n  cachedLastPossibleEmStrongCloserIndex,\n  cachedLastPossibleDelCloserIndex,\n} from './helpers.ts';\nimport type { Rules } from './rules.ts';\nimport type { _Lexer } from './Lexer.ts';\nimport type { Links, Tokens, Token } from './Tokens.ts';\nimport type { MarkedOptions } from './MarkedOptions.ts';\n\nfunction outputLink(cap: string[], link: Pick<Tokens.Link, 'href' | 'title'>, raw: string, lexer: _Lexer, rules: Rules): Tokens.Link | Tokens.Image | undefined {\n  const href = link.href;\n  const title = link.title || null;\n  const text = cap[1].replace(rules.other.outputLinkReplace, '$1');\n  const isImage = cap[0].charAt(0) === '!';\n\n  const outerInLink = lexer.state.inLink;\n  const outerLinkEmitted = lexer.state.linkEmitted;\n  const outerInRawBlock = lexer.state.inRawBlock;\n  lexer.state.inLink = true;\n  lexer.state.linkEmitted = false;\n  const tokens = lexer.inlineTokens(text);\n  const textHasLink = lexer.state.linkEmitted;\n  lexer.state.linkEmitted = outerLinkEmitted;\n  lexer.state.inLink = outerInLink;\n\n  if (!isImage) {\n    // CommonMark: \"Links may not contain other links, at any level of nesting.\"\n    // Bail so the caller falls through to text and the inner link is the one kept.\n    // Images are exempt: their text is flattened into an alt attribute.\n    if (textHasLink) {\n      // these tokens are discarded, so undo the raw-block state they opened;\n      // leaving it set would suppress escaping for the text that is re-scanned\n      lexer.state.inRawBlock = outerInRawBlock;\n      return;\n    }\n    lexer.state.linkEmitted = true;\n  }\n\n  return {\n    type: isImage ? 'image' : 'link',\n    raw,\n    href,\n    title,\n    text,\n    tokens,\n  };\n}\n\nfunction indentCodeCompensation(raw: string, text: string, rules: Rules) {\n  const matchIndentToCode = raw.match(rules.other.indentCodeCompensation);\n\n  if (matchIndentToCode === null) {\n    return text;\n  }\n\n  const indentToCode = matchIndentToCode[1];\n\n  return text\n    .split('\\n')\n    .map(node => {\n      const matchIndentInNode = node.match(rules.other.beginningSpace);\n      if (matchIndentInNode === null) {\n        return node;\n      }\n\n      const [indentInNode] = matchIndentInNode;\n\n      // Up to the fence's own indentation is removed from each line, so a line\n      // indented less than the fence loses whatever indentation it has.\n      return node.slice(Math.min(indentInNode.length, indentToCode.length));\n    })\n    .join('\\n');\n}\n\nfunction isLabelEndInsideToken(src: string, label: string, labelStart: number, rules: Rules) {\n  if (!label.includes('<')) {\n    return false;\n  }\n\n  for (let i = 0; i < label.length; i++) {\n    if (label[i] === '\\\\') {\n      i++;\n      continue;\n    }\n\n    if (label[i] === '`') {\n      const code = rules.inline.code.exec(label.slice(i));\n      if (code) {\n        i += code[0].length - 1;\n        continue;\n      }\n    }\n\n    if (label[i] !== '<') {\n      continue;\n    }\n\n    const tokenSrc = src.slice(labelStart + i);\n    const token = rules.inline.tag.exec(tokenSrc) || rules.inline.autolink.exec(tokenSrc);\n    if (!token) {\n      continue;\n    }\n\n    if (token[0].length > label.length - i) {\n      return true;\n    }\n    i += token[0].length - 1;\n  }\n  return false;\n}\n\n/**\n * Tokenizer\n */\nexport class _Tokenizer<ParserOutput = string, RendererOutput = string> {\n  options: MarkedOptions<ParserOutput, RendererOutput>;\n  rules!: Rules; // set by the lexer\n  lexer!: _Lexer<ParserOutput, RendererOutput>; // set by the lexer\n\n  constructor(options?: MarkedOptions<ParserOutput, RendererOutput>) {\n    this.options = options || _defaults;\n  }\n\n  space(src: string): Tokens.Space | undefined {\n    const cap = this.rules.block.newline.exec(src);\n    if (cap && cap[0].length > 0) {\n      return {\n        type: 'space',\n        raw: cap[0],\n      };\n    }\n  }\n\n  code(src: string): Tokens.Code | undefined {\n    const cap = this.rules.block.code.exec(src);\n    if (cap) {\n      const raw = this.options.pedantic\n        ? cap[0]\n        : trimTrailingBlankLines(cap[0]);\n      const text = raw.replace(this.rules.other.codeRemoveIndent, '');\n      return {\n        type: 'code',\n        raw,\n        codeBlockStyle: 'indented',\n        text,\n      };\n    }\n  }\n\n  fences(src: string): Tokens.Code | undefined {\n    const cap = this.rules.block.fences.exec(src);\n    if (cap) {\n      const raw = cap[0];\n      const text = indentCodeCompensation(raw, cap[3] || '', this.rules);\n\n      return {\n        type: 'code',\n        raw,\n        lang: cap[2] ? cap[2].trim().replace(this.rules.inline.anyPunctuation, '$1') : cap[2],\n        text,\n      };\n    }\n  }\n\n  heading(src: string): Tokens.Heading | undefined {\n    const cap = this.rules.block.heading.exec(src);\n    if (cap) {\n      let text = cap[2].trim();\n\n      // remove trailing #s\n      if (this.rules.other.endingHash.test(text)) {\n        const trimmed = rtrim(text, '#');\n        if (this.options.pedantic) {\n          text = trimmed.trim();\n        } else if (!trimmed || this.rules.other.endingSpaceTabChar.test(trimmed)) {\n          // CommonMark requires a space or tab before trailing #s\n          text = trimmed.trim();\n        }\n      }\n\n      return {\n        type: 'heading',\n        raw: rtrim(cap[0], '\\n'),\n        depth: cap[1].length,\n        text,\n        tokens: this.lexer.inline(text),\n      };\n    }\n  }\n\n  hr(src: string): Tokens.Hr | undefined {\n    const cap = this.rules.block.hr.exec(src);\n    if (cap) {\n      return {\n        type: 'hr',\n        raw: rtrim(cap[0], '\\n'),\n      };\n    }\n  }\n\n  blockquote(src: string): Tokens.Blockquote | undefined {\n    const cap = this.rules.block.blockquote.exec(src);\n    if (cap) {\n      let lines = rtrim(cap[0], '\\n').split('\\n');\n      let raw = '';\n      let text = '';\n      const tokens: Token[] = [];\n\n      while (lines.length > 0) {\n        let inBlockquote = false;\n        const currentLines = [];\n\n        let i;\n        for (i = 0; i < lines.length; i++) {\n          // get lines up to a continuation\n          if (this.rules.other.blockquoteStart.test(lines[i])) {\n            currentLines.push(lines[i]);\n            inBlockquote = true;\n          } else if (!inBlockquote) {\n            currentLines.push(lines[i]);\n          } else {\n            break;\n          }\n        }\n        lines = lines.slice(i);\n\n        const currentRaw = currentLines.join('\\n');\n        const currentText = currentRaw\n          // a tab after the block quote marker runs to the next tab stop, and\n          // the marker only consumes one space of it; the rest is content\n          .replace(\n            this.rules.other.blockquoteMarkerWhitespace,\n            (_, marker: string, whitespace: string) => marker + expandTabs(whitespace, marker.length),\n          )\n          // precede setext continuation with 4 spaces so it isn't a setext\n          .replace(this.rules.other.blockquoteSetextReplace, '\\n    $1')\n          .replace(this.rules.other.blockquoteSetextReplace2, '');\n        raw = raw ? `${raw}\\n${currentRaw}` : currentRaw;\n        text = text ? `${text}\\n${currentText}` : currentText;\n\n        // parse blockquote lines as top level tokens\n        // merge paragraphs if this is a continuation\n        const top = this.lexer.state.top;\n        this.lexer.state.top = true;\n        this.lexer.blockTokens(currentText, tokens, true);\n        this.lexer.state.top = top;\n\n        // if there is no continuation then we are done\n        if (lines.length === 0) {\n          break;\n        }\n\n        const lastToken = tokens.at(-1);\n\n        if (lastToken?.type === 'code' || lastToken?.type === 'heading' || lastToken?.type === 'hr' || lastToken?.type === 'html' || lastToken?.type === 'table') {\n          // blockquote continuation cannot be preceded by a code block, heading, hr, html block or table\n          break;\n        } else if (lastToken?.type === 'blockquote') {\n          // include continuation in nested blockquote\n          const oldToken = lastToken as Tokens.Blockquote;\n          // The continuation lines belong to the same nesting frame as the\n          // nested blockquote, which already had one '>' marker stripped, so\n          // strip one marker from them too. Otherwise a restated marker after a\n          // lazy line is re-parsed as a spurious deeper blockquote.\n          const continuation = lines.join('\\n');\n          const newText = oldToken.raw + '\\n' + continuation.replace(this.rules.other.blockquoteSetextReplace2, '');\n          const newToken = this.blockquote(newText)!;\n          tokens[tokens.length - 1] = newToken;\n\n          // Only include continuation lines the nested blockquote actually\n          // consumed. Unconsumed trailing lines must stay out of `raw` so the\n          // lexer can still tokenize them (paragraph, next blockquote, etc.).\n          const leftover = newText.substring(newToken.raw.length).replace(/^\\n/, '');\n          const leftoverCount = leftover ? leftover.split('\\n').length : 0;\n          const consumed = leftoverCount ? lines.slice(0, -leftoverCount) : lines;\n          if (consumed.length > 0) {\n            raw = `${raw}\\n${consumed.join('\\n')}`;\n          }\n          text = text.substring(0, text.length - oldToken.text.length) + newToken.text;\n\n          // A leftover line that starts with '>' still belongs to this\n          // blockquote; any other leftover line ends it.\n          lines = lines.slice(consumed.length);\n          if (lines.length > 0 && this.rules.other.blockquoteStart.test(lines[0])) {\n            continue;\n          }\n          break;\n        } else if (lastToken?.type === 'list') {\n          // include continuation in nested list\n          const oldToken = lastToken as Tokens.List;\n          const newText = oldToken.raw + '\\n' + lines.join('\\n');\n          const newToken = this.list(newText)!;\n          tokens[tokens.length - 1] = newToken;\n\n          // The list raw has no '>' markers, so it cannot be cut out of `raw`.\n          // Count the continuation lines the list took and add those lines instead.\n          const consumedCount = newToken.raw.length > oldToken.raw.length\n            ? newText.slice(oldToken.raw.length + 1, newToken.raw.length).split('\\n').length\n            : 0;\n          if (consumedCount > 0) {\n            const consumed = lines.slice(0, consumedCount).join('\\n');\n            raw = `${raw}\\n${consumed}`;\n            text = `${text}\\n${consumed}`;\n          }\n          lines = lines.slice(consumedCount);\n          continue;\n        }\n      }\n\n      return {\n        type: 'blockquote',\n        raw,\n        tokens,\n        text,\n      };\n    }\n  }\n\n  list(src: string): Tokens.List | undefined {\n    let cap = this.rules.block.list.exec(src);\n    if (cap) {\n      // Inside a list item, paragraph lines are lexed as text tokens, so a list after one would\n      // interrupt the paragraph. Only a non-empty list starting with a bullet or 1 can do that\n      if (!this.options.pedantic && this.lexer.state.lastToken?.type === 'text'\n        && !this.rules.other.listInterruptsParagraph.test(src)) {\n        return;\n      }\n\n      // src is only consumed from the front, so every raw below is a slice of\n      // listSrc rather than a string built up line by line\n      const listSrc = src;\n      const taken = () => listSrc.length - src.length;\n      let bull = cap[1].trim();\n      const isordered = bull.length > 1;\n\n      const list: Tokens.List = {\n        type: 'list',\n        raw: '',\n        ordered: isordered,\n        start: isordered ? +bull.slice(0, -1) : '',\n        loose: false,\n        items: [],\n      };\n\n      bull = isordered ? `\\\\d{1,9}\\\\${bull.slice(-1)}` : `\\\\${bull}`;\n\n      if (this.options.pedantic) {\n        bull = isordered ? bull : '[*+-]';\n      }\n\n      // Get next list item\n      const itemRegex = this.rules.other.listItemRegex(bull);\n      let endsWithBlankLine = false;\n      // Check if current bullet point can start a new List Item\n      while (src) {\n        let endEarly = false;\n        let itemContents = '';\n        if (!(cap = itemRegex.exec(src))) {\n          break;\n        }\n\n        if (this.rules.block.hr.test(src)) { // End list if bullet was actually HR (possibly move into itemRegex?)\n          break;\n        }\n\n        const itemStart = taken();\n        src = src.substring(cap[0].length);\n\n        const firstLine = cap[2].split('\\n', 1)[0];\n        const bulletIndent = cap[1].length;\n        let line = this.options.pedantic\n          ? expandTabs(firstLine, bulletIndent)\n          : firstLine.replace(this.rules.other.leadingSpaceTab, whitespace => expandTabs(whitespace, bulletIndent));\n        let nextLine = src.split('\\n', 1)[0];\n        let blankLine = !line.trim();\n\n        let indent = 0;\n        if (this.options.pedantic) {\n          indent = 2;\n          itemContents = line.trimStart();\n        } else if (blankLine) {\n          indent = bulletIndent + 1;\n        } else {\n          indent = line.search(this.rules.other.nonSpaceChar); // Find first non-space char\n          indent = indent > 4 ? 1 : indent; // Treat indented code blocks (> 4 spaces) as having only 1 indent\n          itemContents = line.slice(indent);\n          indent += bulletIndent;\n        }\n\n        if (blankLine && this.rules.other.blankLine.test(nextLine)) { // Items begin with at most one blank line\n          src = src.substring(nextLine.length + 1);\n          endEarly = true;\n        }\n\n        if (!endEarly) {\n          const nextBulletRegex = this.rules.other.nextBulletRegex(indent);\n          const hrRegex = this.rules.other.hrRegex(indent);\n          const fencesBeginRegex = this.rules.other.fencesBeginRegex(indent);\n          const headingBeginRegex = this.options.pedantic\n            ? this.rules.other.pedanticHeadingBeginRegex(indent)\n            : this.rules.other.headingBeginRegex(indent);\n          const htmlBeginRegex = this.rules.other.htmlBeginRegex(indent);\n          const blockquoteBeginRegex = this.rules.other.blockquoteBeginRegex(indent);\n\n          // A lazy line continues a paragraph, so it is not checked for the start of a block\n          let lineIsLazy = false;\n\n          // Check if following lines should be included in List Item\n          while (src) {\n            const rawLine = src.split('\\n', 1)[0];\n            let nextLineWithoutTabs;\n            nextLine = rawLine;\n\n            // Re-align to follow commonmark nesting rules\n            if (this.options.pedantic) {\n              nextLine = nextLine.replace(this.rules.other.listReplaceNesting, '  ');\n              nextLineWithoutTabs = nextLine;\n            } else {\n              nextLineWithoutTabs = nextLine.replace(this.rules.other.leadingSpaceTab, whitespace => expandTabs(whitespace));\n            }\n\n            // End list item if found code fences\n            if (fencesBeginRegex.test(nextLine)) {\n              break;\n            }\n\n            // End list item if found start of new heading\n            if (headingBeginRegex.test(nextLine)) {\n              break;\n            }\n\n            // End list item if found start of html block\n            if (htmlBeginRegex.test(nextLine)) {\n              break;\n            }\n\n            // End list item if found start of blockquote\n            if (blockquoteBeginRegex.test(nextLine)) {\n              break;\n            }\n\n            // End list item if found start of new bullet\n            if (nextBulletRegex.test(nextLine)) {\n              break;\n            }\n\n            // Horizontal rule found\n            if (hrRegex.test(nextLine)) {\n              break;\n            }\n\n            if (nextLineWithoutTabs.search(this.rules.other.nonSpaceChar) >= indent || !nextLine.trim()) { // Dedent if possible\n              itemContents += '\\n' + nextLineWithoutTabs.slice(indent);\n              lineIsLazy = false;\n            } else {\n              // not enough indentation\n              if (blankLine) {\n                break;\n              }\n\n              // paragraph continuation unless last line was a different block level element\n              if (line.replace(this.rules.other.tabCharGlobal, '    ').search(this.rules.other.nonSpaceChar) >= 4) { // indented code block\n                break;\n              }\n              if (fencesBeginRegex.test(line)) {\n                break;\n              }\n              if (headingBeginRegex.test(line)) {\n                break;\n              }\n              if (htmlBeginRegex.test(line)) {\n                break;\n              }\n              if (hrRegex.test(line)) {\n                break;\n              }\n              if (!this.options.pedantic && !lineIsLazy) {\n                // `line` is relative to the item content, so a block on it can be indented up to 3 spaces whatever\n                // the item indent is. A nested list item or blockquote on it, as in `- # heading` or `> ---`, holds\n                // a block that a lazy line cannot continue either, so check what follows those markers too.\n                const lastBlockLine = line.replace(this.rules.other.nestedContainerMarkers, '');\n                if (this.rules.block.fences.test(lastBlockLine) || this.rules.block.heading.test(lastBlockLine) || this.rules.block.hr.test(lastBlockLine)) {\n                  break;\n                }\n              }\n\n              // A lazy continuation can look like a setext underline after\n              // list indentation is removed. Keep it in the paragraph.\n              const setextContinuation = !this.options.pedantic\n                && /^ {0,3}(?:=+|-+) *$/.test(nextLine)\n                && this.rules.block.lheading.test(`${line}\\n${nextLine}`);\n              const continuation = setextContinuation\n                ? `    ${nextLineWithoutTabs.replace(/^ {0,3}/, '')}`\n                : nextLine;\n              itemContents += '\\n' + continuation;\n              lineIsLazy = true;\n            }\n\n            blankLine = !nextLine.trim();\n\n            src = src.substring(rawLine.length + 1);\n            line = nextLineWithoutTabs.slice(indent);\n          }\n        }\n\n        // The loops above appended a '\\n' the source may not have had. It could\n        // only land on the item that exhausts src, whose raw is trimmed below,\n        // and after which nothing reads endsWithBlankLine\n        const raw = listSrc.slice(itemStart, taken());\n\n        if (!list.loose) {\n          // If the previous item ended with a blank line, the list is loose\n          if (endsWithBlankLine) {\n            list.loose = true;\n          } else if (this.rules.other.doubleBlankLine.test(raw)) {\n            endsWithBlankLine = true;\n          }\n        }\n\n        list.items.push({\n          type: 'list_item',\n          raw,\n          task: !!this.options.gfm && this.rules.other.listIsTask.test(itemContents),\n          loose: false,\n          text: itemContents,\n          tokens: [],\n        });\n      }\n\n      // Do not consume newlines at end of final item. Alternatively, make itemRegex *start* with any newlines to simplify/speed up endsWithBlankLine logic\n      const lastItem = list.items.at(-1);\n      if (lastItem) {\n        lastItem.raw = lastItem.raw.trimEnd();\n        lastItem.text = lastItem.text.trimEnd();\n      } else {\n        // not a list since there were no items\n        return;\n      }\n      list.raw = listSrc.slice(0, taken()).trimEnd();\n\n      // Item child tokens handled here at end because we needed to have the final item to trim it first\n      // First pass: tokenize items and finalize list.loose from spacers before placing checkboxes\n      for (const item of list.items) {\n        this.lexer.state.top = false;\n        item.tokens = this.lexer.blockTokens(item.text, []);\n\n        if (!list.loose) {\n          // Check if list should be loose\n          const spacers = item.tokens.filter(t => t.type === 'space');\n          const hasMultipleLineBreaks = spacers.length > 0 && spacers.some(t => this.rules.other.anyLine.test(t.raw));\n\n          list.loose = hasMultipleLineBreaks;\n        }\n      }\n\n      // Second pass: place task checkboxes using the final list.loose\n      for (const item of list.items) {\n        const itemToken = item.tokens[0];\n        if (item.task && (itemToken?.type === 'text' || itemToken?.type === 'paragraph')) {\n          // Remove checkbox markdown from item tokens\n          item.text = item.text.replace(this.rules.other.listReplaceTask, '');\n          itemToken.raw = itemToken.raw.replace(this.rules.other.listReplaceTask, '');\n          itemToken.text = itemToken.text.replace(this.rules.other.listReplaceTask, '');\n          for (let i = this.lexer.inlineQueue.length - 1; i >= 0; i--) {\n            if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[i].src)) {\n              this.lexer.inlineQueue[i].src = this.lexer.inlineQueue[i].src.replace(this.rules.other.listReplaceTask, '');\n              break;\n            }\n          }\n\n          const taskRaw = this.rules.other.listTaskCheckbox.exec(item.raw);\n          if (taskRaw) {\n            const checkboxToken: Tokens.Checkbox = {\n              type: 'checkbox',\n              raw: taskRaw[0] + ' ',\n              checked: taskRaw[0] !== '[ ]',\n            };\n            item.checked = checkboxToken.checked;\n            if (list.loose) {\n              if (item.tokens[0] && ['paragraph', 'text'].includes(item.tokens[0].type) && 'tokens' in item.tokens[0] && item.tokens[0].tokens) {\n                item.tokens[0].raw = checkboxToken.raw + item.tokens[0].raw;\n                item.tokens[0].text = checkboxToken.raw + item.tokens[0].text;\n                item.tokens[0].tokens.unshift(checkboxToken);\n              } else {\n                item.tokens.unshift({\n                  type: 'paragraph',\n                  raw: checkboxToken.raw,\n                  text: checkboxToken.raw,\n                  tokens: [checkboxToken],\n                });\n              }\n            } else {\n              item.tokens.unshift(checkboxToken);\n            }\n          }\n        } else if (item.task) {\n          item.task = false;\n        }\n      }\n\n      // Set all items to loose if list is loose\n      if (list.loose) {\n        for (const item of list.items) {\n          item.loose = true;\n          for (const token of item.tokens) {\n            if (token.type === 'text') {\n              token.type = 'paragraph';\n            }\n          }\n        }\n      }\n\n      return list;\n    }\n  }\n\n  html(src: string): Tokens.HTML | undefined {\n    const cap = this.rules.block.html.exec(src);\n    if (cap) {\n      const raw = trimTrailingBlankLines(cap[0]);\n      const token: Tokens.HTML = {\n        type: 'html',\n        block: true,\n        raw,\n        pre: cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style',\n        text: raw,\n      };\n      return token;\n    }\n  }\n\n  def(src: string): Tokens.Def | undefined {\n    const cap = this.rules.block.def.exec(src);\n    if (cap) {\n      // outside angle brackets a link destination holds only balanced parentheses\n      if (!this.rules.other.startAngleBracket.test(cap[2]) && findClosingBracket(cap[2], '()') !== -1) {\n        return;\n      }\n\n      const tag = normalizeLabel(cap[1]);\n      const href = cap[2] ? cap[2].replace(this.rules.other.hrefBrackets, '$1').replace(this.rules.inline.anyPunctuation, '$1') : '';\n      const title = cap[3] ? cap[3].substring(1, cap[3].length - 1).replace(this.rules.inline.anyPunctuation, '$1') : cap[3];\n      return {\n        type: 'def',\n        tag,\n        raw: rtrim(cap[0], '\\n'),\n        href,\n        title,\n      };\n    }\n  }\n\n  table(src: string): Tokens.Table | undefined {\n    const cap = this.rules.block.table.exec(src);\n    if (!cap) {\n      return;\n    }\n\n    if (!this.rules.other.tableDelimiter.test(cap[2])) {\n      // delimiter row must have a pipe (|) or colon (:) otherwise it is a setext heading\n      return;\n    }\n\n    const headers = splitCells(cap[1]);\n    const aligns = cap[2].replace(this.rules.other.tableAlignChars, '').split('|');\n    const rows = cap[3]?.trim() ? cap[3].replace(this.rules.other.tableRowBlankLine, '').split('\\n') : [];\n\n    const item: Tokens.Table = {\n      type: 'table',\n      raw: rtrim(cap[0], '\\n'),\n      header: [],\n      align: [],\n      rows: [],\n    };\n\n    if (headers.length !== aligns.length) {\n      // header and align columns must be equal, rows can be different.\n      return;\n    }\n\n    for (const align of aligns) {\n      if (this.rules.other.tableAlignRight.test(align)) {\n        item.align.push('right');\n      } else if (this.rules.other.tableAlignCenter.test(align)) {\n        item.align.push('center');\n      } else if (this.rules.other.tableAlignLeft.test(align)) {\n        item.align.push('left');\n      } else {\n        item.align.push(null);\n      }\n    }\n\n    for (let i = 0; i < headers.length; i++) {\n      item.header.push({\n        text: headers[i],\n        tokens: this.lexer.inline(headers[i]),\n        header: true,\n        align: item.align[i],\n      });\n    }\n\n    for (const row of rows) {\n      item.rows.push(splitCells(row, item.header.length).map((cell, i) => {\n        return {\n          text: cell,\n          tokens: this.lexer.inline(cell),\n          header: false,\n          align: item.align[i],\n        };\n      }));\n    }\n\n    return item;\n  }\n\n  lheading(src: string): Tokens.Heading | undefined {\n    const cap = this.rules.block.lheading.exec(src);\n    if (cap) {\n      const text = cap[1].trim();\n      return {\n        type: 'heading',\n        raw: rtrim(cap[0], '\\n'),\n        depth: cap[2].charAt(0) === '=' ? 1 : 2,\n        text,\n        tokens: this.lexer.inline(text),\n      };\n    }\n  }\n\n  paragraph(src: string): Tokens.Paragraph | undefined {\n    const cap = this.rules.block.paragraph.exec(src);\n    if (cap) {\n      const text = cap[1].charAt(cap[1].length - 1) === '\\n'\n        ? cap[1].slice(0, -1)\n        : cap[1];\n      return {\n        type: 'paragraph',\n        raw: cap[0],\n        text,\n        tokens: this.lexer.inline(text),\n      };\n    }\n  }\n\n  text(src: string): Tokens.Text | undefined {\n    const cap = this.rules.block.text.exec(src);\n    if (cap) {\n      return {\n        type: 'text',\n        raw: cap[0],\n        text: cap[0],\n        tokens: this.lexer.inline(cap[0]),\n      };\n    }\n  }\n\n  escape(src: string): Tokens.Escape | undefined {\n    const cap = this.rules.inline.escape.exec(src);\n    if (cap) {\n      return {\n        type: 'escape',\n        raw: cap[0],\n        text: cap[1],\n      };\n    }\n  }\n\n  tag(src: string): Tokens.Tag | undefined {\n    const cap = this.rules.inline.tag.exec(src);\n    if (cap) {\n      if (!this.lexer.state.inLink && this.rules.other.startATag.test(cap[0])) {\n        this.lexer.state.inLink = true;\n      } else if (this.lexer.state.inLink && this.rules.other.endATag.test(cap[0])) {\n        this.lexer.state.inLink = false;\n      }\n      if (!this.lexer.state.inRawBlock && this.rules.other.startPreScriptTag.test(cap[0])) {\n        this.lexer.state.inRawBlock = true;\n      } else if (this.lexer.state.inRawBlock && this.rules.other.endPreScriptTag.test(cap[0])) {\n        this.lexer.state.inRawBlock = false;\n      }\n\n      return {\n        type: 'html',\n        raw: cap[0],\n        inLink: this.lexer.state.inLink,\n        inRawBlock: this.lexer.state.inRawBlock,\n        block: false,\n        text: cap[0],\n      };\n    }\n  }\n\n  link(src: string): Tokens.Link | Tokens.Image | undefined {\n    // The link regex backtracks quadratically over unterminated-link inputs\n    // like '[a](b'.repeat(n): at every '[' its greedy unquoted-href run\n    // re-partitions the whole remainder while hunting for a ')' that never\n    // comes. inlineTokens anchors one paren scan per run in\n    // state.linkParenPossible; when it is false the regex cannot match, so\n    // bail out before running it.\n    if (this.lexer.state.linkParenPossible === false) {\n      return undefined;\n    }\n    const cap = this.rules.inline.link.exec(src);\n    if (cap) {\n      const labelStart = cap[0].charAt(0) === '!' ? 2 : 1;\n      if (!this.options.pedantic && isLabelEndInsideToken(src, cap[1], labelStart, this.rules)) {\n        return;\n      }\n\n      const trimmedUrl = cap[2].trim();\n      if (!this.options.pedantic && this.rules.other.startAngleBracket.test(trimmedUrl)) {\n        // commonmark requires matching angle brackets\n        if (!(this.rules.other.endAngleBracket.test(trimmedUrl))) {\n          return;\n        }\n\n        // ending angle bracket cannot be escaped\n        const rtrimSlash = rtrim(trimmedUrl.slice(0, -1), '\\\\');\n        if ((trimmedUrl.length - rtrimSlash.length) % 2 === 0) {\n          return;\n        }\n      } else {\n        // find closing parenthesis\n        const lastParenIndex = findClosingBracket(cap[2], '()');\n        if (lastParenIndex === -2) {\n          // more open parens than closed\n          return;\n        }\n\n        if (lastParenIndex > -1) {\n          const start = cap[0].indexOf('!') === 0 ? 5 : 4;\n          const linkLen = start + cap[1].length + lastParenIndex;\n          cap[2] = cap[2].substring(0, lastParenIndex);\n          cap[0] = cap[0].substring(0, linkLen).trim();\n          cap[3] = '';\n        }\n      }\n      // The ')' that ends the match is the link closer only when it is not\n      // escaped. `[foo](/url\\)` has no closer; that paren is destination text.\n      const unescaped = rtrim(cap[0].slice(0, -1), '\\\\');\n      if ((cap[0].length - unescaped.length) % 2 === 0) {\n        return;\n      }\n      let href = cap[2];\n      let title = '';\n      if (this.options.pedantic) {\n        // split pedantic href and title\n        const link = this.rules.other.pedanticHrefTitle.exec(href);\n\n        if (link) {\n          href = link[1];\n          title = link[3];\n        }\n      } else {\n        title = cap[3] ? cap[3].slice(1, -1) : '';\n      }\n\n      href = href.trim();\n      if (this.rules.other.startAngleBracket.test(href)) {\n        if (this.options.pedantic && !(this.rules.other.endAngleBracket.test(trimmedUrl))) {\n          // pedantic allows starting angle bracket without ending angle bracket\n          href = href.slice(1);\n        } else {\n          href = href.slice(1, -1);\n        }\n      }\n      return outputLink(cap, {\n        href: href ? href.replace(this.rules.inline.anyPunctuation, '$1') : href,\n        title: title ? title.replace(this.rules.inline.anyPunctuation, '$1') : title,\n      }, cap[0], this.lexer, this.rules);\n    }\n  }\n\n  reflink(src: string, links: Links): Tokens.Link | Tokens.Image | Tokens.Text | undefined {\n    let cap;\n    if ((cap = this.rules.inline.reflink.exec(src))\n      || (cap = this.rules.inline.nolink.exec(src))) {\n      const labelStart = cap[0].charAt(0) === '!' ? 2 : 1;\n      if (!this.options.pedantic && isLabelEndInsideToken(src, cap[1], labelStart, this.rules)) {\n        return;\n      }\n\n      const link = links[normalizeLabel(cap[2] || cap[1])];\n      if (!link) {\n        const text = cap[0].charAt(0);\n        return {\n          type: 'text',\n          raw: text,\n          text,\n        };\n      }\n      return outputLink(cap, link, cap[0], this.lexer, this.rules);\n    }\n  }\n\n  emStrong(src: string, maskedSrc: string, prevChar = ''): Tokens.Em | Tokens.Strong | undefined {\n    let match = this.rules.inline.emStrongLDelim.exec(src);\n    if (!match) return;\n    if (!match[1] && !match[2] && !match[3] && !match[4]) return;\n\n    const delimChar = match[0][0];\n    // A mid-run opener (for example the second star of an unmatched `**`) must\n    // only pair with a delimiter that can only close, otherwise it steals the\n    // opener of a later span (`**a*b*c` must be `**a<em>b</em>c`).\n    const midRun = prevChar === delimChar;\n\n    // The start of this delimiter run may already be behind src, either taken\n    // as text after the whole run failed to match or used to close an earlier\n    // span. Flanking and rules 9-10 are about the whole run, so find its start.\n    // Pedantic follows markdown.pl, which has no such rules.\n    const srcStart = maskedSrc.length - src.length;\n    let runStart = srcStart;\n    while (!this.options.pedantic && runStart > 0 && maskedSrc[runStart - 1] === delimChar) {\n      runStart--;\n    }\n    const runPrevChar = [...maskedSrc.slice(Math.max(0, runStart - 2), runStart)].at(-1) ?? '';\n    // The other delimiter character counts as punctuation here (`_**a*`, `*_#_`)\n    const runPrevPunct = runPrevChar === '*' || runPrevChar === '_' || !!this.rules.inline.punctuation.exec(runPrevChar);\n    if (runStart < srcStart) {\n      prevChar = runPrevChar;\n    }\n    const prevPunct = runStart < srcStart\n      ? runPrevPunct\n      : prevChar === '*' || prevChar === '_' || !!this.rules.inline.punctuation.exec(prevChar);\n\n    // _ can't be between two alphanumerics. \\p{L}\\p{N} includes non-english alphabet/numbers as well\n    if (match[4] && prevChar.match(this.rules.other.unicodeAlphaNumeric)) return;\n\n    const nextChar = match[1] || match[3] || '';\n\n    if (!nextChar || !prevChar || prevPunct) {\n      // unicode Regex counts emoji as 1 char; spread into array for proper count (used multiple times below)\n      const lLength = [...match[0]].length - 1;\n      let rDelim, rLength, delimTotal = lLength, midDelimTotal = 0;\n\n      // Rules 9-10 count the whole run, and also apply when the opener could\n      // close as well (`a*b**`, where `*` is both left- and right-flanking).\n      const runLength = srcStart - runStart + lLength;\n      const openerCanClose = !this.options.pedantic && !!runPrevChar.trim()\n        && (!!nextChar || (delimChar === '*' && !runPrevPunct));\n      if (delimChar !== '*' && delimChar !== '_') return;\n      const endReg = delimChar === '*' ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;\n      const lastPossibleEmStrongCloserIndex = cachedLastPossibleEmStrongCloserIndex(this, maskedSrc, delimChar);\n      const emStrongCloserWindowStart = maskedSrc.length - src.length + lLength;\n      if (lastPossibleEmStrongCloserIndex < emStrongCloserWindowStart) return;\n      // Clip maskedSrc to same section of string as src (move to lexer?)\n      maskedSrc = maskedSrc.slice(-1 * src.length + lLength);\n      const lastPossibleEmStrongCloserIndexInWindow = lastPossibleEmStrongCloserIndex - emStrongCloserWindowStart;\n      endReg.lastIndex = 0;\n\n      while ((match = endReg.exec(maskedSrc)) !== null) {\n        if (match.index > lastPossibleEmStrongCloserIndexInWindow) break;\n        rDelim = match[1] || match[2] || match[3] || match[4] || match[5] || match[6];\n\n        if (!rDelim) continue; // skip single * in __abc*abc__\n\n        rLength = [...rDelim].length;\n\n        if (match[3] || match[4]) { // found another Left Delim\n          delimTotal += rLength;\n          continue;\n        } else if (match[5] || match[6] || openerCanClose) { // either Left or Right Delim\n          if (midRun && (match[5] || match[6])) {\n            // A mid-run opener cannot close against an ambiguous delimiter that\n            // can also open; that delimiter opens its own emphasis span instead.\n            break;\n          }\n          if (runLength % 3 && !((runLength + rLength) % 3)) {\n            midDelimTotal += rLength;\n            continue; // CommonMark Emphasis Rules 9-10\n          }\n        }\n\n        delimTotal -= rLength;\n\n        if (delimTotal > 0) continue; // Haven't found enough closing delimiters\n\n        // Remove extra characters. *a*** -> *a*\n        rLength = Math.min(rLength, rLength + delimTotal + midDelimTotal);\n        // char length can be >1 for unicode characters;\n        const lastCharLength = [...match[0]][0].length;\n        const raw = src.slice(0, lLength + match.index + lastCharLength + rLength);\n\n        // Create `em` if smallest delimiter has odd char count. *a***\n        if (Math.min(lLength, rLength) % 2) {\n          const text = raw.slice(1, -1);\n          return {\n            type: 'em',\n            raw,\n            text,\n            tokens: this.lexer.inlineTokens(text),\n          };\n        }\n\n        // Create 'strong' if smallest delimiter has even char count. **a***\n        const text = raw.slice(2, -2);\n        return {\n          type: 'strong',\n          raw,\n          text,\n          tokens: this.lexer.inlineTokens(text),\n        };\n      }\n    }\n  }\n\n  codespan(src: string): Tokens.Codespan | undefined {\n    const cap = this.rules.inline.code.exec(src);\n    if (cap) {\n      let text = cap[2].replace(this.rules.other.newLineCharGlobal, ' ');\n      const hasNonSpaceChars = this.rules.other.nonSpaceChar.test(text);\n      const hasSpaceCharsOnBothEnds = this.rules.other.startingSpaceChar.test(text) && this.rules.other.endingSpaceChar.test(text);\n      if (hasNonSpaceChars && hasSpaceCharsOnBothEnds) {\n        text = text.substring(1, text.length - 1);\n      }\n      return {\n        type: 'codespan',\n        raw: cap[0],\n        text,\n      };\n    }\n  }\n\n  br(src: string): Tokens.Br | undefined {\n    const cap = this.rules.inline.br.exec(src);\n    if (cap) {\n      return {\n        type: 'br',\n        raw: cap[0],\n      };\n    }\n  }\n\n  del(src: string, maskedSrc: string, prevChar = ''): Tokens.Del | undefined {\n    let match = this.rules.inline.delLDelim.exec(src);\n    if (!match) return;\n\n    const nextChar = match[1] || '';\n\n    if (!nextChar || !prevChar || this.rules.inline.punctuation.exec(prevChar)) {\n      // unicode Regex counts emoji as 1 char; spread into array for proper count\n      const lLength = [...match[0]].length - 1;\n      let rDelim, rLength, delimTotal = lLength;\n\n      const endReg = this.rules.inline.delRDelim;\n      const lastPossibleDelCloserIndex = cachedLastPossibleDelCloserIndex(this, maskedSrc);\n      const delCloserWindowStart = maskedSrc.length - src.length + lLength;\n      if (lastPossibleDelCloserIndex < delCloserWindowStart) return;\n      // Clip maskedSrc to same section of string as src\n      maskedSrc = maskedSrc.slice(-1 * src.length + lLength);\n      const lastPossibleDelCloserIndexInWindow = lastPossibleDelCloserIndex - delCloserWindowStart;\n      endReg.lastIndex = 0;\n\n      while ((match = endReg.exec(maskedSrc)) !== null) {\n        if (match.index > lastPossibleDelCloserIndexInWindow) break;\n        rDelim = match[1] || match[2] || match[3] || match[4] || match[5] || match[6];\n\n        if (!rDelim) continue;\n\n        rLength = [...rDelim].length;\n\n        if (rLength !== lLength) continue;\n\n        if (match[3] || match[4]) { // found another Left Delim\n          delimTotal += rLength;\n          continue;\n        }\n\n        delimTotal -= rLength;\n\n        if (delimTotal > 0) continue; // Haven't found enough closing delimiters\n\n        // Remove extra characters\n        rLength = Math.min(rLength, rLength + delimTotal);\n        // char length can be >1 for unicode characters\n        const lastCharLength = [...match[0]][0].length;\n        const raw = src.slice(0, lLength + match.index + lastCharLength + rLength);\n\n        // Create del token - only single ~ or double ~~ supported\n        const text = raw.slice(lLength, -lLength);\n        return {\n          type: 'del',\n          raw,\n          text,\n          tokens: this.lexer.inlineTokens(text),\n        };\n      }\n    }\n  }\n\n  autolink(src: string): Tokens.Link | undefined {\n    const cap = this.rules.inline.autolink.exec(src);\n    if (cap) {\n      let text, href;\n      if (cap[2] === '@') {\n        text = cap[1];\n        href = 'mailto:' + text;\n      } else {\n        text = cap[1];\n        href = text;\n      }\n\n      return {\n        type: 'link',\n        raw: cap[0],\n        text,\n        href,\n        autolink: true,\n        tokens: [\n          {\n            type: 'text',\n            raw: text,\n            text,\n          },\n        ],\n      };\n    }\n  }\n\n  url(src: string): Tokens.Link | undefined {\n    let cap;\n    if (cap = this.rules.inline.url.exec(src)) {\n      let text, href;\n      if (cap[2] === '@') {\n        text = cap[0];\n        href = 'mailto:' + text;\n      } else {\n        // do extended autolink path validation\n        let prevCapZero;\n        do {\n          prevCapZero = cap[0];\n          cap[0] = this.rules.inline._backpedal.exec(cap[0])?.[0] ?? '';\n        } while (prevCapZero !== cap[0]);\n        text = cap[0];\n        if (cap[1] === 'www.') {\n          href = 'http://' + cap[0];\n        } else {\n          href = cap[0];\n        }\n      }\n      return {\n        type: 'link',\n        raw: cap[0],\n        text,\n        href,\n        autolink: true,\n        tokens: [\n          {\n            type: 'text',\n            raw: text,\n            text,\n          },\n        ],\n      };\n    }\n  }\n\n  inlineText(src: string): Tokens.Text | undefined {\n    const cap = this.rules.inline.text.exec(src);\n    if (cap) {\n      const escaped = this.lexer.state.inRawBlock;\n      return {\n        type: 'text',\n        raw: cap[0],\n        // raw HTML keeps whatever it was written with, everywhere else a numeric\n        // character reference stands for the character itself\n        text: escaped ? cap[0] : decodeNumericCharacterReferences(cap[0]),\n        escaped,\n      };\n    }\n  }\n}\n","import { _Tokenizer } from './Tokenizer.ts';\nimport { _defaults } from './defaults.ts';\nimport { other, block, inline } from './rules.ts';\nimport { beginEmStrongDelCloserScan, endEmStrongDelCloserScan, normalizeLabel } from './helpers.ts';\nimport type { Token, TokensList, Tokens } from './Tokens.ts';\nimport type { MarkedOptions } from './MarkedOptions.ts';\n\n/**\n * Block Lexer\n */\nexport class _Lexer<ParserOutput = string, RendererOutput = string> {\n  tokens: TokensList;\n  options: MarkedOptions<ParserOutput, RendererOutput>;\n  state: {\n    inLink: boolean;\n    inRawBlock: boolean;\n    /** a link was produced in the inline run currently being scanned */\n    linkEmitted: boolean;\n    /**\n     * false while scanning an inline run whose source contains no ')',\n     * letting Tokenizer.link bail out before its quadratic backtracking.\n     * Anchored once per run by inlineTokens.\n     */\n    linkParenPossible: boolean;\n    top: boolean;\n    /** the last block token lexed in the current block run, so a tokenizer can check the token before it */\n    lastToken?: Token;\n  };\n\n  public inlineQueue: { src: string, tokens: Token[] }[];\n\n  private tokenizer: _Tokenizer<ParserOutput, RendererOutput>;\n\n  constructor(options?: MarkedOptions<ParserOutput, RendererOutput>) {\n    // TokenList cannot be created in one go\n    this.tokens = [] as unknown as TokensList;\n    this.tokens.links = Object.create(null);\n    this.options = options || _defaults;\n    this.options.tokenizer = this.options.tokenizer || new _Tokenizer<ParserOutput, RendererOutput>();\n    this.tokenizer = this.options.tokenizer;\n    this.tokenizer.options = this.options;\n    this.tokenizer.lexer = this;\n    this.inlineQueue = [];\n    this.state = {\n      inLink: false,\n      inRawBlock: false,\n      linkEmitted: false,\n      linkParenPossible: true,\n      top: true,\n    };\n\n    const rules = {\n      other,\n      block: block.normal,\n      inline: inline.normal,\n    };\n\n    if (this.options.pedantic) {\n      rules.block = block.pedantic;\n      rules.inline = inline.pedantic;\n    } else if (this.options.gfm) {\n      rules.block = block.gfm;\n      if (this.options.breaks) {\n        rules.inline = inline.breaks;\n      } else {\n        rules.inline = inline.gfm;\n      }\n    }\n    this.tokenizer.rules = rules;\n  }\n\n  /**\n   * Expose Rules\n   */\n  static get rules() {\n    return {\n      block,\n      inline,\n    };\n  }\n\n  /**\n   * Static Lex Method\n   */\n  static lex<ParserOutput = string, RendererOutput = string>(src: string, options?: MarkedOptions<ParserOutput, RendererOutput>) {\n    const lexer = new _Lexer<ParserOutput, RendererOutput>(options);\n    return lexer.lex(src);\n  }\n\n  /**\n   * Static Lex Inline Method\n   */\n  static lexInline<ParserOutput = string, RendererOutput = string>(src: string, options?: MarkedOptions<ParserOutput, RendererOutput>) {\n    const lexer = new _Lexer<ParserOutput, RendererOutput>(options);\n    return lexer.inlineTokens(src);\n  }\n\n  /**\n   * Preprocessing\n   */\n  lex(src: string) {\n    src = src.replace(other.carriageReturn, '\\n');\n\n    this.blockTokens(src, this.tokens);\n\n    for (let i = 0; i < this.inlineQueue.length; i++) {\n      const next = this.inlineQueue[i];\n      // an inline <pre>, <code>, <kbd> or <script> left open ends with the block\n      // holding it; carried over, it would stop every later block's text from\n      // being escaped\n      this.state.inRawBlock = false;\n      this.inlineTokens(next.src, next.tokens);\n    }\n    this.inlineQueue = [];\n\n    return this.tokens;\n  }\n\n  /**\n   * Lexing\n   */\n  blockTokens(src: string, tokens?: Token[], lastParagraphClipped?: boolean): Token[];\n  blockTokens(src: string, tokens?: TokensList, lastParagraphClipped?: boolean): TokensList;\n  blockTokens(src: string, tokens: Token[] = [], lastParagraphClipped = false) {\n    this.tokenizer.lexer = this;\n    // list items and block quotes lex their contents with a nested call, so\n    // restore the outer last token when it returns\n    const outerLastToken = this.state.lastToken;\n    if (this.options.pedantic) {\n      src = src.replace(other.tabCharGlobal, '    ').replace(other.spaceLine, '');\n    }\n\n    let srcLength = Infinity;\n    while (src) {\n      if (src.length < srcLength) {\n        srcLength = src.length;\n      } else {\n        this.infiniteLoopError(src.charCodeAt(0));\n        break;\n      }\n\n      this.state.lastToken = tokens.at(-1);\n      let token: Tokens.Generic | undefined;\n\n      if (this.options.extensions?.block?.some((extTokenizer) => {\n        if (token = extTokenizer.call({ lexer: this }, src, tokens)) {\n          src = src.substring(token.raw.length);\n          tokens.push(token);\n          return true;\n        }\n        return false;\n      })) {\n        continue;\n      }\n\n      // newline\n      if (token = this.tokenizer.space(src)) {\n        src = src.substring(token.raw.length);\n        const lastToken = tokens.at(-1);\n        if (token.raw.length === 1 && lastToken !== undefined) {\n          // if there's a single \\n as a spacer, it's terminating the last line,\n          // so move it there so that we don't get unnecessary paragraph tags\n          lastToken.raw += '\\n';\n        } else {\n          tokens.push(token);\n        }\n        continue;\n      }\n\n      // code\n      if (token = this.tokenizer.code(src)) {\n        src = src.substring(token.raw.length);\n        const lastToken = tokens.at(-1);\n        // An indented code block cannot interrupt a paragraph.\n        if (lastToken?.type === 'paragraph' || lastToken?.type === 'text') {\n          lastToken.raw += (lastToken.raw.endsWith('\\n') ? '' : '\\n') + token.raw;\n          lastToken.text += '\\n' + token.text;\n          this.inlineQueue.at(-1)!.src = lastToken.text;\n        } else {\n          tokens.push(token);\n        }\n        continue;\n      }\n\n      // fences\n      if (token = this.tokenizer.fences(src)) {\n        src = src.substring(token.raw.length);\n        tokens.push(token);\n        continue;\n      }\n\n      // heading\n      if (token = this.tokenizer.heading(src)) {\n        src = src.substring(token.raw.length);\n        tokens.push(token);\n        continue;\n      }\n\n      // hr\n      if (token = this.tokenizer.hr(src)) {\n        src = src.substring(token.raw.length);\n        tokens.push(token);\n        continue;\n      }\n\n      // blockquote\n      if (token = this.tokenizer.blockquote(src)) {\n        src = src.substring(token.raw.length);\n        tokens.push(token);\n        continue;\n      }\n\n      // list\n      if (token = this.tokenizer.list(src)) {\n        src = src.substring(token.raw.length);\n        tokens.push(token);\n        continue;\n      }\n\n      // html\n      if (token = this.tokenizer.html(src)) {\n        src = src.substring(token.raw.length);\n        tokens.push(token);\n        continue;\n      }\n\n      // def\n      if (token = this.tokenizer.def(src)) {\n        src = src.substring(token.raw.length);\n        const lastToken = tokens.at(-1);\n        if (lastToken?.type === 'paragraph' || lastToken?.type === 'text') {\n          lastToken.raw += (lastToken.raw.endsWith('\\n') ? '' : '\\n') + token.raw;\n          lastToken.text += '\\n' + token.raw;\n          this.inlineQueue.at(-1)!.src = lastToken.text;\n        } else {\n          // The first definition of a label wins, but a later one still consumes its text\n          if (!this.tokens.links[token.tag]) {\n            this.tokens.links[token.tag] = {\n              href: token.href,\n              title: token.title,\n            };\n          }\n          tokens.push(token);\n        }\n        continue;\n      }\n\n      // table (gfm)\n      if (token = this.tokenizer.table(src)) {\n        src = src.substring(token.raw.length);\n        tokens.push(token);\n        continue;\n      }\n\n      // lheading\n      if (token = this.tokenizer.lheading(src)) {\n        src = src.substring(token.raw.length);\n        tokens.push(token);\n        continue;\n      }\n\n      // top-level paragraph\n      // prevent paragraph consuming extensions by clipping 'src' to extension start\n      let cutSrc = src;\n      if (this.options.extensions?.startBlock) {\n        let startIndex = Infinity;\n        const tempSrc = src.slice(1);\n        let tempStart;\n        this.options.extensions.startBlock.forEach((getStartIndex) => {\n          tempStart = getStartIndex.call({ lexer: this }, tempSrc);\n          if (typeof tempStart === 'number' && tempStart >= 0) {\n            startIndex = Math.min(startIndex, tempStart);\n          }\n        });\n        if (startIndex < Infinity && startIndex >= 0) {\n          cutSrc = src.substring(0, startIndex + 1);\n        }\n      }\n      if (this.state.top && (token = this.tokenizer.paragraph(cutSrc))) {\n        const lastToken = tokens.at(-1);\n        if (lastParagraphClipped && lastToken?.type === 'paragraph') {\n          lastToken.raw += (lastToken.raw.endsWith('\\n') ? '' : '\\n') + token.raw;\n          lastToken.text += '\\n' + token.text;\n          this.inlineQueue.pop();\n          this.inlineQueue.at(-1)!.src = lastToken.text;\n        } else {\n          tokens.push(token);\n        }\n        lastParagraphClipped = cutSrc.length !== src.length;\n        src = src.substring(token.raw.length);\n        continue;\n      }\n\n      // text\n      if (token = this.tokenizer.text(src)) {\n        src = src.substring(token.raw.length);\n        const lastToken = tokens.at(-1);\n        if (lastToken?.type === 'text') {\n          lastToken.raw += (lastToken.raw.endsWith('\\n') ? '' : '\\n') + token.raw;\n          lastToken.text += '\\n' + token.text;\n          this.inlineQueue.pop();\n          this.inlineQueue.at(-1)!.src = lastToken.text;\n        } else {\n          tokens.push(token);\n        }\n        continue;\n      }\n\n      if (src) {\n        this.infiniteLoopError(src.charCodeAt(0));\n        break;\n      }\n    }\n\n    this.state.top = true;\n    this.state.lastToken = outerLastToken;\n    return tokens;\n  }\n\n  inline(src: string, tokens: Token[] = []) {\n    this.inlineQueue.push({ src, tokens });\n    return tokens;\n  }\n\n  /**\n   * Does this link text hold a link already? An image does not count: an image\n   * may hold a link, a link may not.\n   */\n  private linkInText(text: string): boolean {\n    if (!text.includes('[')) {\n      return false;\n    }\n\n    const linkRule = this.tokenizer.rules.inline.link;\n    for (const match of text.matchAll(this.tokenizer.rules.inline.blockSkip)) {\n      // blockSkip also matches code spans and html, and the `!` of an image is\n      // left out of the match, so read the character before it.\n      if (linkRule.test(match[0]) && text.charAt(match.index - 1) !== '!') {\n        return true;\n      }\n    }\n\n    for (const match of text.matchAll(this.tokenizer.rules.inline.reflinkSearch)) {\n      const match0 = match[0];\n      const refStart = match0.lastIndexOf('[');\n      if (match0.charAt(0) === '!' || !Object.hasOwn(this.tokens.links, normalizeLabel(match0.slice(refStart + 1, -1)))) {\n        continue;\n      }\n      // a candidate holding a link is not a link either, so it does not count\n      if (refStart > 1 && this.linkInText(match0.slice(1, refStart - 1))) {\n        continue;\n      }\n      return true;\n    }\n\n    return false;\n  }\n\n  /**\n   * Lexing/Compiling\n   */\n  inlineTokens(src: string, tokens: Token[] = []): Token[] {\n    this.tokenizer.lexer = this;\n    // One paren scan per inline run, shared with Tokenizer.link: without a\n    // ')' ahead the link regex cannot match, and skipping it avoids its\n    // quadratic backtracking over unterminated-link inputs like\n    // `'[a](b'.repeat(n)`. A nested run receives a substring of the outer\n    // run, so if the outer had no ')' neither does this substring — skip\n    // the scan in that case.\n    const prevLinkParenPossible = this.state.linkParenPossible;\n    this.state.linkParenPossible = prevLinkParenPossible && src.includes(')');\n    try {\n      return this.#inlineTokensInner(src, tokens);\n    } finally {\n      // A nested run (e.g. a link label) anchored on its own substring;\n      // restore the outer run's flag for the rest of its loop.\n      this.state.linkParenPossible = prevLinkParenPossible;\n    }\n  }\n\n  #inlineTokensInner(src: string, tokens: Token[]): Token[] {\n    // The masked source is only read by emStrong and del, which need a *, _ or\n    // ~ to start. Skip building it for a run without one, unless a custom\n    // tokenizer or an emStrongMask hook may read it.\n    const maskedSrc = src.includes('*') || src.includes('_') || src.includes('~')\n      || this.options.hooks?.emStrongMask\n      || this.tokenizer.emStrong !== _Tokenizer.prototype.emStrong\n      || this.tokenizer.del !== _Tokenizer.prototype.del\n      ? this.#maskSrc(src)\n      : src;\n\n    // One scan of this maskedSrc for the last emphasis, strong, and\n    // strikethrough closers, shared by every opener in the pass. Popped\n    // when the pass ends so the source is not retained (#4099).\n    beginEmStrongDelCloserScan(this.tokenizer, maskedSrc);\n    try {\n      return this.#tokenizeInlines(src, maskedSrc, tokens);\n    } finally {\n      endEmStrongDelCloserScan(this.tokenizer);\n    }\n  }\n\n  #tokenizeInlines(src: string, maskedSrc: string, tokens: Token[]): Token[] {\n    let keepPrevChar = false;\n    let prevChar = '';\n    let srcLength = Infinity;\n    while (src) {\n      if (src.length < srcLength) {\n        srcLength = src.length;\n      } else {\n        this.infiniteLoopError(src.charCodeAt(0));\n        break;\n      }\n\n      if (!keepPrevChar) {\n        prevChar = '';\n      }\n      keepPrevChar = false;\n\n      let token: Tokens.Generic | undefined;\n\n      // extensions\n      if (this.options.extensions?.inline?.some((extTokenizer) => {\n        if (token = extTokenizer.call({ lexer: this }, src, tokens)) {\n          src = src.substring(token.raw.length);\n          tokens.push(token);\n          return true;\n        }\n        return false;\n      })) {\n        continue;\n      }\n\n      // escape\n      if (token = this.tokenizer.escape(src)) {\n        src = src.substring(token.raw.length);\n        tokens.push(token);\n        continue;\n      }\n\n      // tag\n      if (token = this.tokenizer.tag(src)) {\n        src = src.substring(token.raw.length);\n        tokens.push(token);\n        continue;\n      }\n\n      // link\n      if (token = this.tokenizer.link(src)) {\n        src = src.substring(token.raw.length);\n        tokens.push(token);\n        continue;\n      }\n\n      // reflink, nolink\n      if (token = this.tokenizer.reflink(src, this.tokens.links)) {\n        src = src.substring(token.raw.length);\n        const lastToken = tokens.at(-1);\n        if (token.type === 'text' && lastToken?.type === 'text') {\n          lastToken.raw += token.raw;\n          lastToken.text += token.text;\n        } else {\n          tokens.push(token);\n        }\n        continue;\n      }\n\n      // em & strong\n      if (token = this.tokenizer.emStrong(src, maskedSrc, prevChar)) {\n        src = src.substring(token.raw.length);\n        tokens.push(token);\n        continue;\n      }\n\n      // code\n      if (token = this.tokenizer.codespan(src)) {\n        src = src.substring(token.raw.length);\n        tokens.push(token);\n        continue;\n      }\n\n      // br\n      if (token = this.tokenizer.br(src)) {\n        src = src.substring(token.raw.length);\n        tokens.push(token);\n        continue;\n      }\n\n      // del (gfm)\n      if (token = this.tokenizer.del(src, maskedSrc, prevChar)) {\n        src = src.substring(token.raw.length);\n        tokens.push(token);\n        continue;\n      }\n\n      // autolink\n      if (token = this.tokenizer.autolink(src)) {\n        src = src.substring(token.raw.length);\n        tokens.push(token);\n        continue;\n      }\n\n      // url (gfm)\n      if (!this.state.inLink && (token = this.tokenizer.url(src))) {\n        src = src.substring(token.raw.length);\n        tokens.push(token);\n        continue;\n      }\n\n      // text\n      // prevent inlineText consuming extensions by clipping 'src' to extension start\n      let cutSrc = src;\n      if (this.options.extensions?.startInline) {\n        let startIndex = Infinity;\n        const tempSrc = src.slice(1);\n        let tempStart;\n        this.options.extensions.startInline.forEach((getStartIndex) => {\n          tempStart = getStartIndex.call({ lexer: this }, tempSrc);\n          if (typeof tempStart === 'number' && tempStart >= 0) {\n            startIndex = Math.min(startIndex, tempStart);\n          }\n        });\n        if (startIndex < Infinity && startIndex >= 0) {\n          cutSrc = src.substring(0, startIndex + 1);\n        }\n      }\n      if (token = this.tokenizer.inlineText(cutSrc)) {\n        src = src.substring(token.raw.length);\n        if (token.raw.slice(-1) !== '_') { // Track prevChar before string of ____ started\n          prevChar = token.raw.slice(-1);\n        }\n        keepPrevChar = true;\n        const lastToken = tokens.at(-1);\n        if (lastToken?.type === 'text') {\n          lastToken.raw += token.raw;\n          lastToken.text += token.text;\n        } else {\n          tokens.push(token);\n        }\n        continue;\n      }\n\n      if (src) {\n        this.infiniteLoopError(src.charCodeAt(0));\n        break;\n      }\n    }\n\n    return tokens;\n  }\n\n  /**\n   * Mask links, code spans, raw html and autolinks. blockSkip finds every\n   * `<...>` run, but only real raw html and autolinks take precedence over\n   * emphasis: other text in angle brackets, like `<*name*>`, stays unmasked so\n   * emphasis can open and close in it. A tag may also run past the first `>`,\n   * as in `<a title=\">\">`, so mask the whole tag.\n   */\n  #maskBlocks(src: string): string {\n    const { blockSkip, tag, autolink } = this.tokenizer.rules.inline;\n    let masked = '';\n    let last = 0;\n    let match: RegExpExecArray | null;\n    blockSkip.lastIndex = 0;\n    while ((match = blockSkip.exec(src))) {\n      const start = match.index + (match[2] ? match[2].length : 0);\n      let end = match.index + match[0].length;\n      if (src.charAt(start) === '<') {\n        const rest = src.slice(start);\n        const html = tag.exec(rest) || autolink.exec(rest);\n        if (!html) {\n          blockSkip.lastIndex = start + 1;\n          continue;\n        }\n        end = start + html[0].length;\n        blockSkip.lastIndex = end;\n      }\n      masked += src.slice(last, start) + '[' + 'a'.repeat(end - start - 2) + ']';\n      last = end;\n    }\n    return masked + src.slice(last);\n  }\n\n  /**\n   * Mask links, code, html and escapes so emStrong and del do not see their\n   * delimiters inside them.\n   */\n  #maskSrc(src: string): string {\n    // String with links masked to avoid interference with em and strong\n    let maskedSrc = src;\n\n    // Mask out reflinks\n    if (this.tokens.links && src.includes('[')) {\n      const reflinkSearch = this.tokenizer.rules.inline.reflinkSearch;\n      const maskReflink = (match0: string): string => {\n        const refStart = match0.lastIndexOf('[');\n        if (!Object.hasOwn(this.tokens.links, normalizeLabel(match0.slice(refStart + 1, -1)))) {\n          return match0;\n        }\n        // CommonMark: \"Links may not contain other links, at any level of\n        // nesting.\" A candidate whose text already holds one never becomes a\n        // link, so flattening the whole span would hide the emphasis that\n        // does still apply inside it. Mask the links it holds instead.\n        // Images are exempt: their text is flattened into an alt attribute.\n        if (refStart > 1 && match0.charAt(0) !== '!') {\n          const text = match0.slice(1, refStart - 1);\n          if (this.linkInText(text)) {\n            return '[' + text.replace(reflinkSearch, maskReflink)\n              + '][' + 'a'.repeat(match0.length - refStart - 2) + ']';\n          }\n        }\n        return '[' + 'a'.repeat(match0.length - 2) + ']';\n      };\n      maskedSrc = maskedSrc.replace(reflinkSearch, maskReflink);\n    }\n\n    // Mask out escaped characters.\n    // Every mask must keep the length it replaces: emStrong and del line\n    // maskedSrc up with src by slicing from the end. `anyPunctuation` matches\n    // unicode punctuation, so an escaped astral character is 3 code units.\n    // A backslash inside a code span is literal, not an escape. Mask the\n    // backticks inside the span instead, so blockSkip still skips all of it.\n    maskedSrc = maskedSrc.replace(this.tokenizer.rules.inline.anyPunctuationOutsideCode, (match0, code, punct) => {\n      if (punct) {\n        return '+'.repeat(match0.length);\n      }\n      if (code) {\n        return code + match0.slice(code.length, -code.length).replace(/`/g, '+') + code;\n      }\n      return match0;\n    });\n\n    // Mask out other blocks\n    maskedSrc = this.#maskBlocks(maskedSrc);\n\n    // Mask out blocks from extensions\n    maskedSrc = this.options.hooks?.emStrongMask?.call({ lexer: this }, maskedSrc) ?? maskedSrc;\n\n    return maskedSrc;\n  }\n\n  private infiniteLoopError(byte: number) {\n    const errMsg = 'Infinite loop on byte: ' + byte;\n    if (this.options.silent) {\n      console.error(errMsg);\n    } else {\n      throw new Error(errMsg);\n    }\n  }\n}\n","import { _defaults } from './defaults.ts';\nimport {\n  cleanUrl,\n  escapeHtmlEntities,\n} from './helpers.ts';\nimport { other } from './rules.ts';\nimport type { MarkedOptions } from './MarkedOptions.ts';\nimport type { Tokens } from './Tokens.ts';\nimport type { _Parser } from './Parser.ts';\n\n/**\n * Renderer\n */\nexport class _Renderer<ParserOutput = string, RendererOutput = string> {\n  options: MarkedOptions<ParserOutput, RendererOutput>;\n  parser!: _Parser<ParserOutput, RendererOutput>; // set by the parser\n  constructor(options?: MarkedOptions<ParserOutput, RendererOutput>) {\n    this.options = options || _defaults;\n  }\n\n  space(token: Tokens.Space): RendererOutput {\n    return '' as RendererOutput;\n  }\n\n  code({ text, lang, escaped }: Tokens.Code): RendererOutput {\n    const langString = (lang || '').match(other.notSpaceStart)?.[0];\n\n    // An empty code block has no content, so it must not gain a newline.\n    const code = text ? text.replace(other.endingNewline, '') + '\\n' : '';\n\n    if (!langString) {\n      return '<pre><code>'\n        + (escaped ? code : escapeHtmlEntities(code, true))\n        + '</code></pre>\\n' as RendererOutput;\n    }\n\n    return '<pre><code class=\"language-'\n      + escapeHtmlEntities(langString)\n      + '\">'\n      + (escaped ? code : escapeHtmlEntities(code, true))\n      + '</code></pre>\\n' as RendererOutput;\n  }\n\n  blockquote({ tokens }: Tokens.Blockquote): RendererOutput {\n    const body = this.parser.parse(tokens);\n    return `<blockquote>\\n${body}</blockquote>\\n` as RendererOutput;\n  }\n\n  html({ text }: Tokens.HTML | Tokens.Tag): RendererOutput {\n    return text as RendererOutput;\n  }\n\n  def(token: Tokens.Def): RendererOutput {\n    return '' as RendererOutput;\n  }\n\n  heading({ tokens, depth }: Tokens.Heading): RendererOutput {\n    return `<h${depth}>${this.parser.parseInline(tokens)}</h${depth}>\\n` as RendererOutput;\n  }\n\n  hr(token: Tokens.Hr): RendererOutput {\n    return '<hr>\\n' as RendererOutput;\n  }\n\n  list(token: Tokens.List): RendererOutput {\n    const ordered = token.ordered;\n    const start = token.start;\n\n    let body = '';\n    for (let j = 0; j < token.items.length; j++) {\n      const item = token.items[j];\n      body += this.listitem(item);\n    }\n\n    const type = ordered ? 'ol' : 'ul';\n    const startAttr = (ordered && start !== 1) ? (' start=\"' + start + '\"') : '';\n    return '<' + type + startAttr + '>\\n' + body + '</' + type + '>\\n' as RendererOutput;\n  }\n\n  listitem(item: Tokens.ListItem): RendererOutput {\n    return `<li>${this.parser.parse(item.tokens)}</li>\\n` as RendererOutput;\n  }\n\n  checkbox({ checked }: Tokens.Checkbox): RendererOutput {\n    return '<input '\n      + (checked ? 'checked=\"\" ' : '')\n      + 'disabled=\"\" type=\"checkbox\"> ' as RendererOutput;\n  }\n\n  paragraph({ tokens }: Tokens.Paragraph): RendererOutput {\n    return `<p>${this.parser.parseInline(tokens)}</p>\\n` as RendererOutput;\n  }\n\n  table(token: Tokens.Table): RendererOutput {\n    let header = '';\n\n    // header\n    let cell = '';\n    for (let j = 0; j < token.header.length; j++) {\n      cell += this.tablecell(token.header[j]);\n    }\n    header += this.tablerow({ text: cell as ParserOutput });\n\n    let body = '';\n    for (let j = 0; j < token.rows.length; j++) {\n      const row = token.rows[j];\n\n      cell = '';\n      for (let k = 0; k < row.length; k++) {\n        cell += this.tablecell(row[k]);\n      }\n\n      body += this.tablerow({ text: cell as ParserOutput });\n    }\n    if (body) body = `<tbody>${body}</tbody>`;\n\n    return '<table>\\n'\n      + '<thead>\\n'\n      + header\n      + '</thead>\\n'\n      + body\n      + '</table>\\n' as RendererOutput;\n  }\n\n  tablerow({ text }: Tokens.TableRow<ParserOutput>): RendererOutput {\n    return `<tr>\\n${text}</tr>\\n` as RendererOutput;\n  }\n\n  tablecell(token: Tokens.TableCell): RendererOutput {\n    const content = this.parser.parseInline(token.tokens);\n    const type = token.header ? 'th' : 'td';\n    const tag = token.align\n      ? `<${type} align=\"${token.align}\">`\n      : `<${type}>`;\n    return tag + content + `</${type}>\\n` as RendererOutput;\n  }\n\n  /**\n   * span level renderer\n   */\n  strong({ tokens }: Tokens.Strong): RendererOutput {\n    return `<strong>${this.parser.parseInline(tokens)}</strong>` as RendererOutput;\n  }\n\n  em({ tokens }: Tokens.Em): RendererOutput {\n    return `<em>${this.parser.parseInline(tokens)}</em>` as RendererOutput;\n  }\n\n  codespan({ text }: Tokens.Codespan): RendererOutput {\n    return `<code>${escapeHtmlEntities(text, true)}</code>` as RendererOutput;\n  }\n\n  br(token: Tokens.Br): RendererOutput {\n    return '<br>' as RendererOutput;\n  }\n\n  del({ tokens }: Tokens.Del): RendererOutput {\n    return `<del>${this.parser.parseInline(tokens)}</del>` as RendererOutput;\n  }\n\n  link({ href, title, text, tokens, autolink }: Tokens.Link): RendererOutput {\n    // References are not resolved inside an autolink, so every `&` there is\n    // literal. Elsewhere only an `&` that cannot start one needs escaping.\n    const parsedText = autolink\n      ? escapeHtmlEntities(text, true)\n      : this.parser.parseInline(tokens) as string;\n    const cleanHref = cleanUrl(href);\n    if (cleanHref === null) {\n      return parsedText as RendererOutput;\n    }\n    href = escapeHtmlEntities(cleanHref, autolink);\n    let out = '<a href=\"' + href + '\"';\n    if (title) {\n      out += ' title=\"' + (escapeHtmlEntities(title)) + '\"';\n    }\n    out += '>' + parsedText + '</a>';\n    return out as RendererOutput;\n  }\n\n  image({ href, title, text, tokens }: Tokens.Image): RendererOutput {\n    if (tokens) {\n      text = this.parser.parseInline(tokens, this.parser.textRenderer) as string;\n    }\n    const cleanHref = cleanUrl(href);\n    if (cleanHref === null) {\n      return escapeHtmlEntities(text) as RendererOutput;\n    }\n    href = cleanHref;\n\n    let out = `<img src=\"${escapeHtmlEntities(href)}\" alt=\"${escapeHtmlEntities(text)}\"`;\n    if (title) {\n      out += ` title=\"${escapeHtmlEntities(title)}\"`;\n    }\n    out += '>';\n    return out as RendererOutput;\n  }\n\n  text(token: Tokens.Text | Tokens.Escape): RendererOutput {\n    return 'tokens' in token && token.tokens\n      ? this.parser.parseInline(token.tokens) as unknown as RendererOutput\n      : ('escaped' in token && token.escaped ? token.text as RendererOutput : escapeHtmlEntities(token.text) as RendererOutput);\n  }\n}\n","import type { Tokens } from './Tokens.ts';\nimport type { _Parser } from './Parser.ts';\n\n/**\n * TextRenderer\n * returns only the textual part of the token\n */\nexport class _TextRenderer<RendererOutput = string> {\n  parser!: _Parser<unknown, RendererOutput>;\n  // no need for block level renderers\n  strong({ text, tokens }: Tokens.Strong): RendererOutput {\n    return (tokens ? this.parser.parseInline(tokens, this) : text) as RendererOutput;\n  }\n\n  em({ text, tokens }: Tokens.Em): RendererOutput {\n    return (tokens ? this.parser.parseInline(tokens, this) : text) as RendererOutput;\n  }\n\n  codespan({ text }: Tokens.Codespan): RendererOutput {\n    return text as RendererOutput;\n  }\n\n  del({ text, tokens }: Tokens.Del): RendererOutput {\n    return (tokens ? this.parser.parseInline(tokens, this) : text) as RendererOutput;\n  }\n\n  html({ text }: Tokens.HTML | Tokens.Tag): RendererOutput {\n    return text as RendererOutput;\n  }\n\n  text({ text }: Tokens.Text | Tokens.Escape | Tokens.Tag): RendererOutput {\n    return text as RendererOutput;\n  }\n\n  link({ text, tokens }: Tokens.Link): RendererOutput {\n    return (tokens ? this.parser.parseInline(tokens, this) : text) as RendererOutput;\n  }\n\n  image({ text, tokens }: Tokens.Image): RendererOutput {\n    return (tokens ? this.parser.parseInline(tokens, this) : text) as RendererOutput;\n  }\n\n  br(): RendererOutput {\n    return '\\n' as RendererOutput;\n  }\n\n  checkbox({ raw }: Tokens.Checkbox): RendererOutput {\n    return raw as RendererOutput;\n  }\n}\n","import { _Renderer } from './Renderer.ts';\nimport { _TextRenderer } from './TextRenderer.ts';\nimport { _defaults } from './defaults.ts';\nimport type { MarkedToken, Token, Tokens } from './Tokens.ts';\nimport type { MarkedOptions } from './MarkedOptions.ts';\n\n/**\n * Parsing & Compiling\n */\nexport class _Parser<ParserOutput = string, RendererOutput = string> {\n  options: MarkedOptions<ParserOutput, RendererOutput>;\n  renderer: _Renderer<ParserOutput, RendererOutput>;\n  textRenderer: _TextRenderer<RendererOutput>;\n  constructor(options?: MarkedOptions<ParserOutput, RendererOutput>) {\n    this.options = options || _defaults;\n    this.options.renderer = this.options.renderer || new _Renderer<ParserOutput, RendererOutput>();\n    this.renderer = this.options.renderer;\n    this.renderer.options = this.options;\n    this.renderer.parser = this;\n    this.textRenderer = new _TextRenderer<RendererOutput>();\n    this.textRenderer.parser = this;\n  }\n\n  /**\n   * Static Parse Method\n   */\n  static parse<ParserOutput = string, RendererOutput = string>(tokens: Token[], options?: MarkedOptions<ParserOutput, RendererOutput>) {\n    const parser = new _Parser<ParserOutput, RendererOutput>(options);\n    return parser.parse(tokens);\n  }\n\n  /**\n   * Static Parse Inline Method\n   */\n  static parseInline<ParserOutput = string, RendererOutput = string>(tokens: Token[], options?: MarkedOptions<ParserOutput, RendererOutput>) {\n    const parser = new _Parser<ParserOutput, RendererOutput>(options);\n    return parser.parseInline(tokens);\n  }\n\n  /**\n   * Parse Loop\n   */\n  parse(tokens: Token[]): ParserOutput {\n    this.renderer.parser = this;\n    let out = '';\n\n    for (let i = 0; i < tokens.length; i++) {\n      const anyToken = tokens[i];\n\n      // Run any renderer extensions\n      if (this.options.extensions?.renderers?.[anyToken.type]) {\n        const genericToken = anyToken as Tokens.Generic;\n        const ret = this.options.extensions.renderers[genericToken.type].call({ parser: this }, genericToken);\n        if (ret !== false || !['space', 'hr', 'heading', 'code', 'table', 'blockquote', 'list', 'checkbox', 'html', 'def', 'paragraph', 'text'].includes(genericToken.type)) {\n          out += ret === false ? '' : ret ?? '';\n          continue;\n        }\n      }\n\n      const token = anyToken as MarkedToken;\n\n      switch (token.type) {\n        case 'space': {\n          out += this.renderer.space(token);\n          break;\n        }\n        case 'hr': {\n          out += this.renderer.hr(token);\n          break;\n        }\n        case 'heading': {\n          out += this.renderer.heading(token);\n          break;\n        }\n        case 'code': {\n          out += this.renderer.code(token);\n          break;\n        }\n        case 'table': {\n          out += this.renderer.table(token);\n          break;\n        }\n        case 'blockquote': {\n          out += this.renderer.blockquote(token);\n          break;\n        }\n        case 'list': {\n          out += this.renderer.list(token);\n          break;\n        }\n        case 'checkbox': {\n          out += this.renderer.checkbox(token);\n          break;\n        }\n        case 'html': {\n          out += this.renderer.html(token);\n          break;\n        }\n        case 'def': {\n          out += this.renderer.def(token);\n          break;\n        }\n        case 'paragraph': {\n          out += this.renderer.paragraph(token);\n          break;\n        }\n        case 'text': {\n          out += this.renderer.text(token);\n          break;\n        }\n\n        default: {\n          const errMsg = 'Token with \"' + token.type + '\" type was not found.';\n          if (this.options.silent) {\n            console.error(errMsg);\n            return '' as ParserOutput;\n          } else {\n            throw new Error(errMsg);\n          }\n        }\n      }\n    }\n\n    return out as ParserOutput;\n  }\n\n  /**\n   * Parse Inline Tokens\n   */\n  parseInline(tokens: Token[], renderer: _Renderer<ParserOutput, RendererOutput> | _TextRenderer<RendererOutput> = this.renderer): ParserOutput {\n    this.renderer.parser = this;\n    let out = '';\n\n    for (let i = 0; i < tokens.length; i++) {\n      const anyToken = tokens[i];\n\n      // Run any renderer extensions\n      if (this.options.extensions?.renderers?.[anyToken.type]) {\n        const ret = this.options.extensions.renderers[anyToken.type].call({ parser: this }, anyToken);\n        if (ret !== false || !['escape', 'html', 'link', 'image', 'checkbox', 'strong', 'em', 'codespan', 'br', 'del', 'text'].includes(anyToken.type)) {\n          out += ret === false ? '' : ret ?? '';\n          continue;\n        }\n      }\n\n      const token = anyToken as MarkedToken;\n\n      switch (token.type) {\n        case 'escape': {\n          out += renderer.text(token);\n          break;\n        }\n        case 'html': {\n          out += renderer.html(token);\n          break;\n        }\n        case 'link': {\n          out += renderer.link(token);\n          break;\n        }\n        case 'image': {\n          out += renderer.image(token);\n          break;\n        }\n        case 'checkbox': {\n          out += renderer.checkbox(token);\n          break;\n        }\n        case 'strong': {\n          out += renderer.strong(token);\n          break;\n        }\n        case 'em': {\n          out += renderer.em(token);\n          break;\n        }\n        case 'codespan': {\n          out += renderer.codespan(token);\n          break;\n        }\n        case 'br': {\n          out += renderer.br(token);\n          break;\n        }\n        case 'del': {\n          out += renderer.del(token);\n          break;\n        }\n        case 'text': {\n          out += renderer.text(token);\n          break;\n        }\n        default: {\n          const errMsg = 'Token with \"' + token.type + '\" type was not found.';\n          if (this.options.silent) {\n            console.error(errMsg);\n            return '' as ParserOutput;\n          } else {\n            throw new Error(errMsg);\n          }\n        }\n      }\n    }\n    return out as ParserOutput;\n  }\n}\n","import { _defaults } from './defaults.ts';\nimport { _Lexer } from './Lexer.ts';\nimport { _Parser } from './Parser.ts';\nimport type { MarkedOptions } from './MarkedOptions.ts';\nimport type { Token, TokensList } from './Tokens.ts';\n\nexport class _Hooks<ParserOutput = string, RendererOutput = string> {\n  options: MarkedOptions<ParserOutput, RendererOutput>;\n  block?: boolean;\n\n  constructor(options?: MarkedOptions<ParserOutput, RendererOutput>) {\n    this.options = options || _defaults;\n  }\n\n  static passThroughHooks = new Set([\n    'preprocess',\n    'postprocess',\n    'processAllTokens',\n    'emStrongMask',\n  ]);\n\n  static passThroughHooksRespectAsync = new Set([\n    'preprocess',\n    'postprocess',\n    'processAllTokens',\n  ]);\n\n  /**\n   * Process markdown before marked\n   */\n  preprocess(markdown: string) {\n    return markdown;\n  }\n\n  /**\n   * Process HTML after marked is finished\n   */\n  postprocess(html: ParserOutput) {\n    return html;\n  }\n\n  /**\n   * Process all tokens before walk tokens\n   */\n  processAllTokens(tokens: Token[] | TokensList) {\n    return tokens;\n  }\n\n  /**\n   * Mask contents that should not be interpreted as em/strong delimiters\n   */\n  emStrongMask(src: string) {\n    return src;\n  }\n\n  /**\n   * Provide function to tokenize markdown\n   */\n  provideLexer(block = this.block) {\n    return block ? _Lexer.lex : _Lexer.lexInline;\n  }\n\n  /**\n   * Provide function to parse tokens\n   */\n  provideParser(block = this.block) {\n    return block ? _Parser.parse<ParserOutput, RendererOutput> : _Parser.parseInline<ParserOutput, RendererOutput>;\n  }\n}\n","import { _getDefaults } from './defaults.ts';\nimport { _Lexer } from './Lexer.ts';\nimport { _Parser } from './Parser.ts';\nimport { _Hooks } from './Hooks.ts';\nimport { _Renderer } from './Renderer.ts';\nimport { _Tokenizer } from './Tokenizer.ts';\nimport { _TextRenderer } from './TextRenderer.ts';\nimport { escapeHtmlEntities } from './helpers.ts';\nimport type { MarkedExtension, MarkedOptions } from './MarkedOptions.ts';\nimport type { Token, Tokens, TokensList } from './Tokens.ts';\n\nexport type MaybePromise = void | Promise<void>;\n\ntype UnknownFunction = (...args: unknown[]) => unknown;\ntype GenericRendererFunction<RendererOutput> = (...args: unknown[]) => RendererOutput | false;\n\n/**\n * Append value(s) to values in place, flattening one level like concat\n */\nfunction pushValues(values: MaybePromise[], value: MaybePromise | MaybePromise[]) {\n  if (Array.isArray(value)) {\n    for (let i = 0; i < value.length; i++) {\n      values.push(value[i]);\n    }\n  } else {\n    values.push(value);\n  }\n}\n\nexport class Marked<ParserOutput = string, RendererOutput = string> {\n  defaults = _getDefaults<ParserOutput, RendererOutput>();\n  options = this.setOptions;\n\n  /**\n   * Compiles markdown to HTML.\n   *\n   * To configure hooks, a renderer, or a tokenizer, create a separate `Marked`\n   * instance and use `Marked#use` instead of passing them on each call.\n   */\n  parse = this.parseMarkdown(true);\n\n  /**\n   * Compiles inline markdown to HTML.\n   *\n   * To configure hooks, a renderer, or a tokenizer, create a separate `Marked`\n   * instance and use `Marked#use` instead of passing them on each call.\n   */\n  parseInline = this.parseMarkdown(false);\n\n  Parser = _Parser<ParserOutput, RendererOutput>;\n  Renderer = _Renderer<ParserOutput, RendererOutput>;\n  TextRenderer = _TextRenderer<RendererOutput>;\n  Lexer = _Lexer;\n  Tokenizer = _Tokenizer<ParserOutput, RendererOutput>;\n  Hooks = _Hooks<ParserOutput, RendererOutput>;\n\n  constructor(...args: MarkedExtension<ParserOutput, RendererOutput>[]) {\n    this.use(...args);\n  }\n\n  /**\n   * Run callback for every token\n   */\n  walkTokens(tokens: Token[] | TokensList, callback: (token: Token) => MaybePromise | MaybePromise[]) {\n    const values: MaybePromise[] = [];\n    for (const token of tokens) {\n      pushValues(values, callback.call(this, token));\n      switch (token.type) {\n        case 'table': {\n          const tableToken = token as Tokens.Table;\n          for (const cell of tableToken.header) {\n            pushValues(values, this.walkTokens(cell.tokens, callback));\n          }\n          for (const row of tableToken.rows) {\n            for (const cell of row) {\n              pushValues(values, this.walkTokens(cell.tokens, callback));\n            }\n          }\n          break;\n        }\n        case 'list': {\n          const listToken = token as Tokens.List;\n          pushValues(values, this.walkTokens(listToken.items, callback));\n          break;\n        }\n        default: {\n          const genericToken = token as Tokens.Generic;\n          if (this.defaults.extensions?.childTokens?.[genericToken.type]) {\n            this.defaults.extensions.childTokens[genericToken.type].forEach((childTokens) => {\n              const tokens = genericToken[childTokens].flat(Infinity) as Token[] | TokensList;\n              pushValues(values, this.walkTokens(tokens, callback));\n            });\n          } else if (genericToken.tokens) {\n            pushValues(values, this.walkTokens(genericToken.tokens, callback));\n          }\n        }\n      }\n    }\n    return values;\n  }\n\n  /**\n   * Registers extensions with this Marked instance.\n   *\n   * The `renderer`, `tokenizer`, and `hooks` objects may each contain only the\n   * methods that should be overridden. Their methods are merged with built-in\n   * behavior and extensions registered by earlier calls.\n   *\n   * Use this method when supplying only some hook methods.\n   */\n  use(...args: MarkedExtension<ParserOutput, RendererOutput>[]) {\n    const extensions: MarkedOptions<ParserOutput, RendererOutput>['extensions'] = this.defaults.extensions || { renderers: Object.create(null), childTokens: Object.create(null) };\n\n    args.forEach((pack) => {\n      // copy options to new object\n      const opts = { ...pack } as MarkedOptions<ParserOutput, RendererOutput>;\n\n      // set async to true if it was set to true before\n      opts.async = this.defaults.async || opts.async || false;\n\n      // ==-- Parse \"addon\" extensions --== //\n      if (pack.extensions) {\n        pack.extensions.forEach((ext) => {\n          if (!ext.name) {\n            throw new Error('extension name required');\n          }\n          if ('renderer' in ext) { // Renderer extensions\n            const prevRenderer = extensions.renderers[ext.name];\n            if (prevRenderer) {\n              // Replace extension with func to run new extension but fall back if false\n              extensions.renderers[ext.name] = function(...args) {\n                let ret = ext.renderer.apply(this, args);\n                if (ret === false) {\n                  ret = prevRenderer.apply(this, args);\n                }\n                return ret;\n              };\n            } else {\n              extensions.renderers[ext.name] = ext.renderer;\n            }\n          }\n          if ('tokenizer' in ext) { // Tokenizer Extensions\n            if (!ext.level || (ext.level !== 'block' && ext.level !== 'inline')) {\n              throw new Error(\"extension level must be 'block' or 'inline'\");\n            }\n            const extLevel = extensions[ext.level];\n            if (extLevel) {\n              extLevel.unshift(ext.tokenizer);\n            } else {\n              extensions[ext.level] = [ext.tokenizer];\n            }\n            if (ext.start) { // Function to check for start of token\n              if (ext.level === 'block') {\n                if (extensions.startBlock) {\n                  extensions.startBlock.push(ext.start);\n                } else {\n                  extensions.startBlock = [ext.start];\n                }\n              } else if (ext.level === 'inline') {\n                if (extensions.startInline) {\n                  extensions.startInline.push(ext.start);\n                } else {\n                  extensions.startInline = [ext.start];\n                }\n              }\n            }\n          }\n          if ('childTokens' in ext && ext.childTokens) { // Child tokens to be visited by walkTokens\n            extensions.childTokens[ext.name] = ext.childTokens;\n          }\n        });\n        opts.extensions = extensions;\n      }\n\n      // ==-- Parse \"overwrite\" extensions --== //\n      if (pack.renderer) {\n        const renderer = this.defaults.renderer || new _Renderer<ParserOutput, RendererOutput>(this.defaults);\n        for (const prop in pack.renderer) {\n          if (!(prop in renderer)) {\n            throw new Error(`renderer '${prop}' does not exist`);\n          }\n          if (['options', 'parser'].includes(prop)) {\n            // ignore options property\n            continue;\n          }\n          const rendererProp = prop as Exclude<keyof _Renderer<ParserOutput, RendererOutput>, 'options' | 'parser'>;\n          const rendererFunc = pack.renderer[rendererProp] as GenericRendererFunction<RendererOutput>;\n          const prevRenderer = renderer[rendererProp] as GenericRendererFunction<RendererOutput>;\n          // Replace renderer with func to run extension, but fall back if false\n          renderer[rendererProp] = (...args: unknown[]) => {\n            let ret = rendererFunc.apply(renderer, args);\n            if (ret === false) {\n              ret = prevRenderer.apply(renderer, args);\n            }\n            return (ret === false ? '' : ret ?? '') as RendererOutput;\n          };\n        }\n        opts.renderer = renderer;\n      }\n      if (pack.tokenizer) {\n        const tokenizer = this.defaults.tokenizer || new _Tokenizer<ParserOutput, RendererOutput>(this.defaults);\n        for (const prop in pack.tokenizer) {\n          if (!(prop in tokenizer)) {\n            throw new Error(`tokenizer '${prop}' does not exist`);\n          }\n          if (['options', 'rules', 'lexer'].includes(prop)) {\n            // ignore options, rules, and lexer properties\n            continue;\n          }\n          const tokenizerProp = prop as Exclude<keyof _Tokenizer<ParserOutput, RendererOutput>, 'options' | 'rules' | 'lexer'>;\n          const tokenizerFunc = pack.tokenizer[tokenizerProp] as UnknownFunction;\n          const prevTokenizer = tokenizer[tokenizerProp] as UnknownFunction;\n          // Replace tokenizer with func to run extension, but fall back if false\n          // @ts-expect-error cannot type tokenizer function dynamically\n          tokenizer[tokenizerProp] = (...args: unknown[]) => {\n            let ret = tokenizerFunc.apply(tokenizer, args);\n            if (ret === false) {\n              ret = prevTokenizer.apply(tokenizer, args);\n            }\n            return ret;\n          };\n        }\n        opts.tokenizer = tokenizer;\n      }\n\n      // ==-- Parse Hooks extensions --== //\n      if (pack.hooks) {\n        const hooks = this.defaults.hooks || new _Hooks<ParserOutput, RendererOutput>();\n        for (const prop in pack.hooks) {\n          if (!(prop in hooks)) {\n            throw new Error(`hook '${prop}' does not exist`);\n          }\n          if (['options', 'block'].includes(prop)) {\n            // ignore options and block properties\n            continue;\n          }\n          const hooksProp = prop as Exclude<keyof _Hooks<ParserOutput, RendererOutput>, 'options' | 'block'>;\n          const hooksFunc = pack.hooks[hooksProp] as UnknownFunction;\n          const prevHook = hooks[hooksProp] as UnknownFunction;\n          if (_Hooks.passThroughHooks.has(prop)) {\n            // @ts-expect-error cannot type hook function dynamically\n            hooks[hooksProp] = (arg: unknown) => {\n              if (hooks.options.async && _Hooks.passThroughHooksRespectAsync.has(prop)) {\n                return (async() => {\n                  const ret = await hooksFunc.call(hooks, arg);\n                  return prevHook.call(hooks, ret);\n                })();\n              }\n\n              const ret = hooksFunc.call(hooks, arg);\n              return prevHook.call(hooks, ret);\n            };\n          } else {\n            // @ts-expect-error cannot type hook function dynamically\n            hooks[hooksProp] = (...args: unknown[]) => {\n              if (hooks.options.async) {\n                return (async() => {\n                  let ret = await hooksFunc.apply(hooks, args);\n                  if (ret === false) {\n                    ret = await prevHook.apply(hooks, args);\n                  }\n                  return ret;\n                })();\n              }\n\n              let ret = hooksFunc.apply(hooks, args);\n              if (ret === false) {\n                ret = prevHook.apply(hooks, args);\n              }\n              return ret;\n            };\n          }\n        }\n        opts.hooks = hooks;\n      }\n\n      // ==-- Parse WalkTokens extensions --== //\n      if (pack.walkTokens) {\n        const walkTokens = this.defaults.walkTokens;\n        const packWalktokens = pack.walkTokens;\n        opts.walkTokens = function(token) {\n          const values: MaybePromise[] = [];\n          pushValues(values, packWalktokens.call(this, token));\n          if (walkTokens) {\n            pushValues(values, walkTokens.call(this, token));\n          }\n          return values;\n        };\n      }\n\n      this.defaults = { ...this.defaults, ...opts };\n    });\n\n    return this;\n  }\n\n  setOptions(opt: MarkedOptions<ParserOutput, RendererOutput>) {\n    this.defaults = { ...this.defaults, ...opt };\n    return this;\n  }\n\n  lexer(src: string, options?: MarkedOptions<ParserOutput, RendererOutput>) {\n    return _Lexer.lex(src, options ?? this.defaults);\n  }\n\n  parser(tokens: Token[], options?: MarkedOptions<ParserOutput, RendererOutput>) {\n    return _Parser.parse<ParserOutput, RendererOutput>(tokens, options ?? this.defaults);\n  }\n\n  private parseMarkdown(blockType: boolean) {\n    type overloadedParse = {\n      (src: string, options: MarkedOptions<ParserOutput, RendererOutput> & { async: true }): Promise<ParserOutput>;\n      (src: string, options: MarkedOptions<ParserOutput, RendererOutput> & { async: false }): ParserOutput;\n      (src: string, options?: MarkedOptions<ParserOutput, RendererOutput> | null): ParserOutput | Promise<ParserOutput>;\n    };\n\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    const parse: overloadedParse = (src: string, options?: MarkedOptions<ParserOutput, RendererOutput> | null): any => {\n      const origOpt = { ...options };\n      const opt = { ...this.defaults, ...origOpt };\n\n      const throwError = this.onError(!!opt.silent, !!opt.async);\n\n      // throw error if an extension set async to true but parse was called with async: false\n      if (this.defaults.async === true && origOpt.async === false) {\n        return throwError(new Error('marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.'));\n      }\n\n      // throw error in case of non string input\n      if (typeof src === 'undefined' || src === null) {\n        return throwError(new Error('marked(): input parameter is undefined or null'));\n      }\n      if (typeof src !== 'string') {\n        return throwError(new Error('marked(): input parameter is of type '\n          + Object.prototype.toString.call(src) + ', string expected'));\n      }\n\n      if (opt.hooks) {\n        opt.hooks.options = opt;\n        opt.hooks.block = blockType;\n      }\n\n      if (opt.async) {\n        return (async() => {\n          const processedSrc = opt.hooks ? await opt.hooks.preprocess(src) : src;\n          const lexer = opt.hooks ? await opt.hooks.provideLexer(blockType) : (blockType ? _Lexer.lex : _Lexer.lexInline);\n          const tokens = await lexer(processedSrc, opt);\n          const processedTokens = opt.hooks ? await opt.hooks.processAllTokens(tokens) : tokens;\n          if (opt.walkTokens) {\n            await Promise.all(this.walkTokens(processedTokens, opt.walkTokens));\n          }\n          const parser = opt.hooks ? await opt.hooks.provideParser(blockType) : (blockType ? _Parser.parse : _Parser.parseInline);\n          const html = await parser(processedTokens, opt);\n          return opt.hooks ? await opt.hooks.postprocess(html) : html;\n        })().catch(throwError);\n      }\n\n      try {\n        if (opt.hooks) {\n          src = opt.hooks.preprocess(src) as string;\n        }\n        const lexer = opt.hooks ? opt.hooks.provideLexer(blockType) : (blockType ? _Lexer.lex : _Lexer.lexInline);\n        let tokens = lexer(src, opt);\n        if (opt.hooks) {\n          tokens = opt.hooks.processAllTokens(tokens);\n        }\n        if (opt.walkTokens) {\n          this.walkTokens(tokens, opt.walkTokens);\n        }\n        const parser = opt.hooks ? opt.hooks.provideParser(blockType) : (blockType ? _Parser.parse : _Parser.parseInline);\n        let html = parser(tokens, opt);\n        if (opt.hooks) {\n          html = opt.hooks.postprocess(html);\n        }\n        return html;\n      } catch(e) {\n        return throwError(e as Error);\n      }\n    };\n\n    return parse;\n  }\n\n  private onError(silent: boolean, async: boolean) {\n    return (e: Error): string | Promise<string> => {\n      e.message += '\\nPlease report this to https://github.com/markedjs/marked.';\n\n      if (silent) {\n        const msg = '<p>An error occurred:</p><pre>'\n          + escapeHtmlEntities(e.message + '', true)\n          + '</pre>';\n        if (async) {\n          return Promise.resolve(msg);\n        }\n        return msg;\n      }\n\n      if (async) {\n        return Promise.reject(e);\n      }\n      throw e;\n    };\n  }\n}\n"]}