{"version":3,"file":"backticks.mjs","sources":["../../../../../../node_modules/markdown-it/lib/rules_inline/backticks.mjs"],"sourcesContent":["// Parse backticks\n\nexport default function backtick (state, silent) {\n  let pos = state.pos\n  const ch = state.src.charCodeAt(pos)\n\n  if (ch !== 0x60/* ` */) { return false }\n\n  const start = pos\n  pos++\n  const max = state.posMax\n\n  // scan marker length\n  while (pos < max && state.src.charCodeAt(pos) === 0x60/* ` */) { pos++ }\n\n  const marker = state.src.slice(start, pos)\n  const openerLength = marker.length\n\n  if (state.backticksScanned && (state.backticks[openerLength] || 0) <= start) {\n    if (!silent) state.pending += marker\n    state.pos += openerLength\n    return true\n  }\n\n  let matchEnd = pos\n  let matchStart\n\n  // Nothing found in the cache, scan until the end of the line (or until marker is found)\n  while ((matchStart = state.src.indexOf('`', matchEnd)) !== -1) {\n    matchEnd = matchStart + 1\n\n    // scan marker length\n    while (matchEnd < max && state.src.charCodeAt(matchEnd) === 0x60/* ` */) { matchEnd++ }\n\n    const closerLength = matchEnd - matchStart\n\n    if (closerLength === openerLength) {\n      // Found matching closer length.\n      if (!silent) {\n        const token = state.push('code_inline', 'code', 0)\n        token.markup = marker\n        token.content = state.src.slice(pos, matchStart)\n          .replace(/\\n/g, ' ')\n          .replace(/^ (.+) $/, '$1')\n      }\n      state.pos = matchEnd\n      return true\n    }\n\n    // Some different length found, put it in cache as upper limit of where closer can be found\n    state.backticks[closerLength] = matchStart\n  }\n\n  // Scanned through the end, didn't find anything\n  state.backticksScanned = true\n\n  if (!silent) state.pending += marker\n  state.pos += openerLength\n  return true\n}\n"],"names":["backtick","state","silent","pos","start","max","marker","openerLength","matchEnd","matchStart","closerLength","token"],"mappings":"AAEe,SAASA,EAAUC,GAAOC,GAAQ;AAC/C,MAAIC,IAAMF,EAAM;AAGhB,MAFWA,EAAM,IAAI,WAAWE,CAAG,MAExB;AAAe,WAAO;AAEjC,QAAMC,IAAQD;AACd,EAAAA;AACA,QAAME,IAAMJ,EAAM;AAGlB,SAAOE,IAAME,KAAOJ,EAAM,IAAI,WAAWE,CAAG,MAAM;AAAe,IAAAA;AAEjE,QAAMG,IAASL,EAAM,IAAI,MAAMG,GAAOD,CAAG,GACnCI,IAAeD,EAAO;AAE5B,MAAIL,EAAM,qBAAqBA,EAAM,UAAUM,CAAY,KAAK,MAAMH;AACpE,WAAKF,MAAQD,EAAM,WAAWK,IAC9BL,EAAM,OAAOM,GACN;AAGT,MAAIC,IAAWL,GACXM;AAGJ,UAAQA,IAAaR,EAAM,IAAI,QAAQ,KAAKO,CAAQ,OAAO,MAAI;AAI7D,SAHAA,IAAWC,IAAa,GAGjBD,IAAWH,KAAOJ,EAAM,IAAI,WAAWO,CAAQ,MAAM;AAAe,MAAAA;AAE3E,UAAME,IAAeF,IAAWC;AAEhC,QAAIC,MAAiBH,GAAc;AAEjC,UAAI,CAACL,GAAQ;AACX,cAAMS,IAAQV,EAAM,KAAK,eAAe,QAAQ,CAAC;AACjD,QAAAU,EAAM,SAASL,GACfK,EAAM,UAAUV,EAAM,IAAI,MAAME,GAAKM,CAAU,EAC5C,QAAQ,OAAO,GAAG,EAClB,QAAQ,YAAY,IAAI;AAAA,MAC7B;AACA,aAAAR,EAAM,MAAMO,GACL;AAAA,IACT;AAGA,IAAAP,EAAM,UAAUS,CAAY,IAAID;AAAA,EAClC;AAGA,SAAAR,EAAM,mBAAmB,IAEpBC,MAAQD,EAAM,WAAWK,IAC9BL,EAAM,OAAOM,GACN;AACT;","x_google_ignoreList":[0]}