@ai-matrx/content-ir 0.19.6 → 0.19.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -5288,6 +5288,7 @@ function parseFenceOpener(line) {
5288
5288
  let ticks = 0;
5289
5289
  while (start + ticks < end && line[start + ticks] === "`") ticks++;
5290
5290
  if (ticks < 3) return null;
5291
+ if (line.slice(start + ticks, end).includes("`")) return null;
5291
5292
  let infoStart = start + ticks;
5292
5293
  while (infoStart < end && isOpenerWhitespace(line[infoStart])) infoStart++;
5293
5294
  let langEnd = infoStart;
@@ -5312,9 +5313,9 @@ function classifyInnerFenceLine(trimmed, openTicks, nests, nestedDepth) {
5312
5313
  function fenceOpenerOf(content) {
5313
5314
  const t = content.trimStart();
5314
5315
  if (t.startsWith("```")) {
5315
- let ticks = 0;
5316
- while (ticks < t.length && t[ticks] === "`") ticks++;
5317
- return { char: "`", ticks, lang: parseFenceOpener(t)?.lang ?? "" };
5316
+ const parsed = parseFenceOpener(t);
5317
+ if (!parsed) return null;
5318
+ return { char: "`", ticks: parsed.ticks, lang: parsed.lang };
5318
5319
  }
5319
5320
  if (content.length - t.length <= 3 && t.startsWith("~~~")) {
5320
5321
  const open = /^(~{3,})(.*)$/.exec(t);
@@ -5324,11 +5325,7 @@ function fenceOpenerOf(content) {
5324
5325
  return null;
5325
5326
  }
5326
5327
  function opensStrictFence(line) {
5327
- const opener = fenceOpenerOf(line);
5328
- if (!opener) return false;
5329
- if (opener.char === "~") return true;
5330
- const t = line.trimStart();
5331
- return !t.slice(opener.ticks).includes("`");
5328
+ return fenceOpenerOf(line) !== null;
5332
5329
  }
5333
5330
  var FenceReader = class {
5334
5331
  opener;