@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/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.19.7
4
+ ### Unreleased
5
+
6
+ - `/source` **THE fence opener follows GFM (CommonMark 4.5):** a backtick run whose info string holds a backtick opens NO fence — "```` code ```` | b" and "``` `x` | b" are code spans. Applied at the one source (`parseFenceOpener` → `fenceOpenerOf`), so the tokenizer's islands, `findCodeRanges`, content cleanup and every splitter move together; `opensStrictFence` is now just `fenceOpenerOf(line) !== null`. Fence-nesting vectors regenerated (+5 openers, +2 documents); the Python twin moved with them.
7
+
3
8
  ## 0.19.6
4
9
  ### Unreleased
5
10
 
package/dist/index.cjs CHANGED
@@ -5294,6 +5294,7 @@ function parseFenceOpener(line) {
5294
5294
  let ticks = 0;
5295
5295
  while (start + ticks < end && line[start + ticks] === "`") ticks++;
5296
5296
  if (ticks < 3) return null;
5297
+ if (line.slice(start + ticks, end).includes("`")) return null;
5297
5298
  let infoStart = start + ticks;
5298
5299
  while (infoStart < end && isOpenerWhitespace(line[infoStart])) infoStart++;
5299
5300
  let langEnd = infoStart;
@@ -5318,9 +5319,9 @@ function classifyInnerFenceLine(trimmed, openTicks, nests, nestedDepth) {
5318
5319
  function fenceOpenerOf(content) {
5319
5320
  const t = content.trimStart();
5320
5321
  if (t.startsWith("```")) {
5321
- let ticks = 0;
5322
- while (ticks < t.length && t[ticks] === "`") ticks++;
5323
- return { char: "`", ticks, lang: parseFenceOpener(t)?.lang ?? "" };
5322
+ const parsed = parseFenceOpener(t);
5323
+ if (!parsed) return null;
5324
+ return { char: "`", ticks: parsed.ticks, lang: parsed.lang };
5324
5325
  }
5325
5326
  if (content.length - t.length <= 3 && t.startsWith("~~~")) {
5326
5327
  const open = /^(~{3,})(.*)$/.exec(t);
@@ -5330,11 +5331,7 @@ function fenceOpenerOf(content) {
5330
5331
  return null;
5331
5332
  }
5332
5333
  function opensStrictFence(line) {
5333
- const opener = fenceOpenerOf(line);
5334
- if (!opener) return false;
5335
- if (opener.char === "~") return true;
5336
- const t = line.trimStart();
5337
- return !t.slice(opener.ticks).includes("`");
5334
+ return fenceOpenerOf(line) !== null;
5338
5335
  }
5339
5336
  var FenceReader = class {
5340
5337
  opener;