@ai-matrx/content-ir 0.19.4 → 0.19.6
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 +11 -0
- package/dist/index.cjs +28 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +27 -4
- package/dist/index.js.map +1 -1
- package/dist/source.cjs +28 -3
- package/dist/source.cjs.map +1 -1
- package/dist/source.d.cts +10 -1
- package/dist/source.d.ts +10 -1
- package/dist/source.js +27 -4
- package/dist/source.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.19.6
|
|
4
|
+
### Unreleased
|
|
5
|
+
|
|
6
|
+
- `/source`: a table row opening with a backtick run whose info string holds a backtick ("```` code ```` | b") continues the table, as GFM reads it — fences in the table rule are judged by the new `opensStrictFence` (CommonMark 4.5), in the code-range owner. New `findInlineCodeSpans` / `mapInlineCodeSpans` for INLINE content (a table cell, a label) where a leading ``` is a code span, never a fence (verify-RC-B4 round 8).
|
|
7
|
+
|
|
8
|
+
## 0.19.5
|
|
9
|
+
|
|
10
|
+
Automatic changed-only republish (docs/metadata drift since the last tag — see
|
|
11
|
+
`git diff npm/content-ir-core/v0.19.4..npm/content-ir-core/v0.19.5 -- apps/shared/content-ir-core`).
|
|
12
|
+
No source changes intended and no consumer action required.
|
|
13
|
+
|
|
3
14
|
## 0.19.4
|
|
4
15
|
### Unreleased
|
|
5
16
|
|
package/dist/index.cjs
CHANGED
|
@@ -5329,6 +5329,13 @@ function fenceOpenerOf(content) {
|
|
|
5329
5329
|
}
|
|
5330
5330
|
return null;
|
|
5331
5331
|
}
|
|
5332
|
+
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("`");
|
|
5338
|
+
}
|
|
5332
5339
|
var FenceReader = class {
|
|
5333
5340
|
opener;
|
|
5334
5341
|
state = { inString: false, escaped: false };
|
|
@@ -5615,6 +5622,21 @@ function mapCodeRanges(text, fn) {
|
|
|
5615
5622
|
}
|
|
5616
5623
|
return out + text.slice(at);
|
|
5617
5624
|
}
|
|
5625
|
+
function findInlineCodeSpans(text) {
|
|
5626
|
+
const ranges = [];
|
|
5627
|
+
codeSpans(text, 0, text.length, ranges);
|
|
5628
|
+
return ranges.sort((a, b) => a.start - b.start);
|
|
5629
|
+
}
|
|
5630
|
+
function mapInlineCodeSpans(text, fn) {
|
|
5631
|
+
let out = "";
|
|
5632
|
+
let at = 0;
|
|
5633
|
+
for (const r of findInlineCodeSpans(text)) {
|
|
5634
|
+
if (r.start < at) continue;
|
|
5635
|
+
out += text.slice(at, r.start) + fn(r, text.slice(r.start, r.end));
|
|
5636
|
+
at = r.end;
|
|
5637
|
+
}
|
|
5638
|
+
return out + text.slice(at);
|
|
5639
|
+
}
|
|
5618
5640
|
function codeSpanText(raw) {
|
|
5619
5641
|
const ticks = backtickRunLength(raw, 0);
|
|
5620
5642
|
const inner = raw.slice(ticks, raw.length - ticks);
|
|
@@ -7674,7 +7696,8 @@ function rowCells(line) {
|
|
|
7674
7696
|
function unescapeCellPipes(cell) {
|
|
7675
7697
|
return cell.replace(/\\\|/g, "|");
|
|
7676
7698
|
}
|
|
7677
|
-
var BLOCK_START = /^(?:[-+*](?:\s|$)|\d{1,9}[.)](?:\s|$)|>|#{1,6}(?:\s|$)
|
|
7699
|
+
var BLOCK_START = /^(?:[-+*](?:\s|$)|\d{1,9}[.)](?:\s|$)|>|#{1,6}(?:\s|$)|(?:-\s*){3,}$|(?:\*\s*){3,}$|(?:_\s*){3,}$)/;
|
|
7700
|
+
var startsBlock = (trimmed) => BLOCK_START.test(trimmed) || opensStrictFence(trimmed);
|
|
7678
7701
|
var DELIMITER_CELL = /^:?-+:?$/;
|
|
7679
7702
|
function isGfmDelimiterRow(line) {
|
|
7680
7703
|
const trimmed = line.trim();
|
|
@@ -7688,7 +7711,7 @@ function isPipeLedRow(line) {
|
|
|
7688
7711
|
}
|
|
7689
7712
|
function startsPipelessTable(header, delimiter) {
|
|
7690
7713
|
const head = header.trim();
|
|
7691
|
-
if (!head || head.startsWith("|") ||
|
|
7714
|
+
if (!head || head.startsWith("|") || startsBlock(head)) return false;
|
|
7692
7715
|
if (splitRowSegments(head).length < 2) return false;
|
|
7693
7716
|
if (delimiter === void 0 || !isGfmDelimiterRow(delimiter)) return false;
|
|
7694
7717
|
return rowCells(head).length === rowCells(delimiter.trim()).length;
|
|
@@ -7696,7 +7719,7 @@ function startsPipelessTable(header, delimiter) {
|
|
|
7696
7719
|
function continuesTable(line) {
|
|
7697
7720
|
const trimmed = line.trim();
|
|
7698
7721
|
if (!trimmed) return false;
|
|
7699
|
-
return trimmed.startsWith("|") || !
|
|
7722
|
+
return trimmed.startsWith("|") || !startsBlock(trimmed);
|
|
7700
7723
|
}
|
|
7701
7724
|
function opensTable(lines, index) {
|
|
7702
7725
|
const line = lines[index] ?? "";
|
|
@@ -7789,6 +7812,7 @@ exports.fenceOpenerOf = fenceOpenerOf;
|
|
|
7789
7812
|
exports.fenceParts = fenceParts;
|
|
7790
7813
|
exports.fieldsToDbPayload = fieldsToDbPayload;
|
|
7791
7814
|
exports.findCodeRanges = findCodeRanges;
|
|
7815
|
+
exports.findInlineCodeSpans = findInlineCodeSpans;
|
|
7792
7816
|
exports.findTableEnd = findTableEnd;
|
|
7793
7817
|
exports.findTableStart = findTableStart;
|
|
7794
7818
|
exports.fingerprintText = fingerprintText;
|
|
@@ -7832,6 +7856,7 @@ exports.looksLikeDisplayMath = looksLikeDisplayMath;
|
|
|
7832
7856
|
exports.looksLikeOpenInlineMath = looksLikeOpenInlineMath;
|
|
7833
7857
|
exports.makePartialKindStalenessGate = makePartialKindStalenessGate;
|
|
7834
7858
|
exports.mapCodeRanges = mapCodeRanges;
|
|
7859
|
+
exports.mapInlineCodeSpans = mapInlineCodeSpans;
|
|
7835
7860
|
exports.mapPosition = mapPosition;
|
|
7836
7861
|
exports.mapRange = mapRange;
|
|
7837
7862
|
exports.mergeResidueIntoValue = mergeResidueIntoValue;
|