@ai-matrx/content-ir 0.14.1 → 0.14.3

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,27 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.14.3
4
+
5
+ Automatic changed-only republish (docs/metadata drift since the last tag — see
6
+ `git diff npm/content-ir-core/v0.14.2..npm/content-ir-core/v0.14.3 -- apps/shared/content-ir-core`).
7
+ No source changes intended and no consumer action required.
8
+
9
+ ## 0.14.2 — 2026-09-25
10
+
11
+ **`/source` — a tilde fence locks what the renderer draws inside it**
12
+ (verify-RC-B3 residual R5). The renderer's splitter does not know `~~~`
13
+ fences, so a ```` ``` ```` fence (or an XML section, a JSON block) that starts
14
+ inside one can run past the tilde closer — and the tokenizer had left that
15
+ overflow as editable prose. A tilde island now extends over every block the
16
+ renderer would detect starting inside it (the union of both readings). Found
17
+ by matrx-frontend's new `source-covers-renderer` property test (every fenced
18
+ block the renderer draws must sit inside one tokenizer island; red on 0.14.1,
19
+ green on 0.14.2 over 80k generated documents with tilde, nested-markdown,
20
+ CRLF and exotic-whitespace fences). Guard here: 3 cases in
21
+ `__tests__/source-verify-findings.test.ts`.
22
+
23
+ **Consumer action:** none.
24
+
3
25
  ## 0.14.1 — 2026-09-25
4
26
 
5
27
  **Single-dollar math: an adversarial review of the widened rule** (RC-B2's
package/dist/index.cjs CHANGED
@@ -5487,6 +5487,37 @@ var NOT_WHITESPACE = /\S/;
5487
5487
  var DIRECTIVE_OPEN = /^(:{2,})([A-Za-z][\w-]*)/;
5488
5488
  var MKDOCS_OPEN = /^(!!!|\?\?\?\+?)[ \t]+([A-Za-z][\w-]*)/;
5489
5489
  var CALLOUT_OPEN = /^>[ \t]*\[!([A-Za-z][\w-]*)\]([+-])?/;
5490
+ var CALLOUT_NAMES = /* @__PURE__ */ new Set([
5491
+ "note",
5492
+ "seealso",
5493
+ "example",
5494
+ "tip",
5495
+ "hint",
5496
+ "important",
5497
+ "warning",
5498
+ "warn",
5499
+ "attention",
5500
+ "caution",
5501
+ "danger",
5502
+ "error",
5503
+ "failure",
5504
+ "fail",
5505
+ "missing",
5506
+ "bug",
5507
+ "info",
5508
+ "abstract",
5509
+ "summary",
5510
+ "tldr",
5511
+ "todo",
5512
+ "success",
5513
+ "check",
5514
+ "done",
5515
+ "question",
5516
+ "help",
5517
+ "faq",
5518
+ "quote",
5519
+ "cite"
5520
+ ]);
5490
5521
  var FOOTNOTE_DEF = /^\[\^([^\]\s]+)\]:/;
5491
5522
  function countStructuralBraces(source) {
5492
5523
  let opens = 0;
@@ -5880,7 +5911,7 @@ var Tokenizer = class {
5880
5911
  /** A blockquote whose first line is `> [!TYPE]…` — every following `>` line belongs to it. */
5881
5912
  callout(p, li, t) {
5882
5913
  const open = CALLOUT_OPEN.exec(t);
5883
- if (!open) return null;
5914
+ if (!open || !CALLOUT_NAMES.has(open[1].toLowerCase())) return null;
5884
5915
  let last = li;
5885
5916
  for (let k = li + 1; k < this.lineCount; k++) {
5886
5917
  if (!/^ {0,3}>/.test(this.lineText(k))) break;
@@ -6005,11 +6036,41 @@ var Tokenizer = class {
6005
6036
  for (let k = li + 1; k < this.lineCount; k++) {
6006
6037
  if (this.isOpenTail(k)) continue;
6007
6038
  if (close.test(this.lineText(k))) {
6008
- return this.island("fence", p, this.contentEnds[k], true, meta);
6039
+ const tildeEnd = this.contentEnds[k];
6040
+ const end = this.rendererOverflow(li + 1, k, tildeEnd);
6041
+ return this.island("fence", p, end, end === this.n ? this.overflowComplete : true, meta);
6009
6042
  }
6010
6043
  }
6011
6044
  return this.island("fence", p, this.n, false, meta);
6012
6045
  }
6046
+ /** Completion of the last `rendererOverflow` that ran to the end of the text. */
6047
+ overflowComplete = true;
6048
+ /**
6049
+ * The renderer's splitter does not know ~~~ fences: it reads the lines inside
6050
+ * one as ordinary lines, so a ```` ``` ```` fence (or an XML section, a JSON
6051
+ * block…) that STARTS inside the tilde fence can run past its closer. The
6052
+ * editor must lock at least what the renderer draws (verify-RC-B3 residual
6053
+ * R5), so a tilde island extends over every block the renderer would detect
6054
+ * starting inside it. Returns the island's end.
6055
+ */
6056
+ rendererOverflow(firstLine, closeLine, tildeEnd) {
6057
+ let end = tildeEnd;
6058
+ this.overflowComplete = true;
6059
+ for (let j = firstLine; j <= closeLine && j < this.lineCount; j++) {
6060
+ const start = this.lineStarts[j];
6061
+ if (this.lineIsBlank(j)) continue;
6062
+ if (this.lineText(j).trimStart().startsWith("~~~")) continue;
6063
+ const inner = this.detectBlockUncached(start, j, false);
6064
+ if (!inner) continue;
6065
+ if (inner.end > end) {
6066
+ end = inner.end;
6067
+ this.overflowComplete = inner.complete;
6068
+ }
6069
+ const lastLine = this.lineOf(Math.max(start, inner.end - 1));
6070
+ if (lastLine > j) j = lastLine;
6071
+ }
6072
+ return end;
6073
+ }
6013
6074
  /**
6014
6075
  * A line-leading `$$` that OPENS a math pair (source/math-pairs.ts — the
6015
6076
  * core's rule). A closer, an unpaired `$$`, or a prose pair is never a block:
@@ -6830,6 +6891,7 @@ function mapRange(changes, start, end, unit = "utf16") {
6830
6891
  }
6831
6892
 
6832
6893
  exports.ACTION_BY_CLASS = ACTION_BY_CLASS;
6894
+ exports.CALLOUT_NAMES = CALLOUT_NAMES;
6833
6895
  exports.CAPABILITY_BY_CLASS = CAPABILITY_BY_CLASS;
6834
6896
  exports.CLASSES = CLASSES;
6835
6897
  exports.DIRECTIVE_VERSION = DIRECTIVE_VERSION;