@ai-matrx/content-ir 0.22.5 → 0.22.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 +12 -0
- package/dist/convert.cjs +33 -2
- package/dist/convert.cjs.map +1 -1
- package/dist/convert.js +33 -2
- package/dist/convert.js.map +1 -1
- package/dist/index.cjs +39 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +39 -8
- package/dist/index.js.map +1 -1
- package/dist/source.cjs +6 -6
- package/dist/source.cjs.map +1 -1
- package/dist/source.d.cts +4 -4
- package/dist/source.d.ts +4 -4
- package/dist/source.js +6 -6
- package/dist/source.js.map +1 -1
- package/package.json +1 -1
package/dist/source.d.cts
CHANGED
|
@@ -726,6 +726,10 @@ declare function tableStartsAt(lines: readonly string[], index: number): boolean
|
|
|
726
726
|
declare function findTableStart(lines: readonly string[], from?: number): number;
|
|
727
727
|
/** Index just past the table whose header is at `start` (header, delimiter, then continuation rows). */
|
|
728
728
|
declare function findTableEnd(lines: readonly string[], start: number): number;
|
|
729
|
+
/** A line that starts like a pipe-led row — even a lone `|` still growing. */
|
|
730
|
+
declare function startsLikeTableRow(line: string): boolean;
|
|
731
|
+
/** A delimiter row still arriving: only pipes, colons, dashes and spaces, with a dash so far. */
|
|
732
|
+
declare function isGrowingDelimiterRow(line: string): boolean;
|
|
729
733
|
|
|
730
734
|
/** Replace every inline code span with its text (`x` → x); fences untouched. */
|
|
731
735
|
declare function unwrapCodeSpans(text: string): string;
|
|
@@ -871,10 +875,6 @@ declare function findBalancedXmlClose(line: string, tagName: string, state: XmlB
|
|
|
871
875
|
* row opens before its delimiter arrives).
|
|
872
876
|
*/
|
|
873
877
|
declare function findWholeTableStart(lines: readonly string[], from?: number): number;
|
|
874
|
-
/** A line that starts like a pipe-led row — even a lone `|` still growing. */
|
|
875
|
-
declare function startsLikeTableRow(line: string): boolean;
|
|
876
|
-
/** A delimiter row still arriving: only pipes, colons, dashes and spaces, with a dash so far. */
|
|
877
|
-
declare function isGrowingDelimiterRow(line: string): boolean;
|
|
878
878
|
/**
|
|
879
879
|
* The trailing lines of a streaming text that belong to a table being written
|
|
880
880
|
* (pipe-led rows, even partial; pipe-less rows once a delimiter follows the
|
package/dist/source.d.ts
CHANGED
|
@@ -726,6 +726,10 @@ declare function tableStartsAt(lines: readonly string[], index: number): boolean
|
|
|
726
726
|
declare function findTableStart(lines: readonly string[], from?: number): number;
|
|
727
727
|
/** Index just past the table whose header is at `start` (header, delimiter, then continuation rows). */
|
|
728
728
|
declare function findTableEnd(lines: readonly string[], start: number): number;
|
|
729
|
+
/** A line that starts like a pipe-led row — even a lone `|` still growing. */
|
|
730
|
+
declare function startsLikeTableRow(line: string): boolean;
|
|
731
|
+
/** A delimiter row still arriving: only pipes, colons, dashes and spaces, with a dash so far. */
|
|
732
|
+
declare function isGrowingDelimiterRow(line: string): boolean;
|
|
729
733
|
|
|
730
734
|
/** Replace every inline code span with its text (`x` → x); fences untouched. */
|
|
731
735
|
declare function unwrapCodeSpans(text: string): string;
|
|
@@ -871,10 +875,6 @@ declare function findBalancedXmlClose(line: string, tagName: string, state: XmlB
|
|
|
871
875
|
* row opens before its delimiter arrives).
|
|
872
876
|
*/
|
|
873
877
|
declare function findWholeTableStart(lines: readonly string[], from?: number): number;
|
|
874
|
-
/** A line that starts like a pipe-led row — even a lone `|` still growing. */
|
|
875
|
-
declare function startsLikeTableRow(line: string): boolean;
|
|
876
|
-
/** A delimiter row still arriving: only pipes, colons, dashes and spaces, with a dash so far. */
|
|
877
|
-
declare function isGrowingDelimiterRow(line: string): boolean;
|
|
878
878
|
/**
|
|
879
879
|
* The trailing lines of a streaming text that belong to a table being written
|
|
880
880
|
* (pipe-led rows, even partial; pipe-less rows once a delimiter follows the
|
package/dist/source.js
CHANGED
|
@@ -1195,6 +1195,12 @@ function findTableEnd(lines, start) {
|
|
|
1195
1195
|
while (end < lines.length && continuesTable(lines[end] ?? "", container)) end += 1;
|
|
1196
1196
|
return end;
|
|
1197
1197
|
}
|
|
1198
|
+
function startsLikeTableRow(line) {
|
|
1199
|
+
return /^\s*\|/.test(line);
|
|
1200
|
+
}
|
|
1201
|
+
function isGrowingDelimiterRow(line) {
|
|
1202
|
+
return /^[\s|:-]*-[\s|:-]*$/.test(line);
|
|
1203
|
+
}
|
|
1198
1204
|
|
|
1199
1205
|
// source/tokenize.ts
|
|
1200
1206
|
var QUOTE_PREFIX = /^ {0,3}>(?: ?>)* ?/;
|
|
@@ -3273,12 +3279,6 @@ function findWholeTableStart(lines, from = 0) {
|
|
|
3273
3279
|
for (let i = Math.max(0, from); i + 1 < lines.length; i += 1) if (tableStartsAt(lines, i)) return i;
|
|
3274
3280
|
return -1;
|
|
3275
3281
|
}
|
|
3276
|
-
function startsLikeTableRow(line) {
|
|
3277
|
-
return /^\s*\|/.test(line);
|
|
3278
|
-
}
|
|
3279
|
-
function isGrowingDelimiterRow(line) {
|
|
3280
|
-
return /^[\s|:-]*-[\s|:-]*$/.test(line);
|
|
3281
|
-
}
|
|
3282
3282
|
function trailingTableStart(lines, end = lines.length) {
|
|
3283
3283
|
const isTableLine = (line) => startsLikeTableRow(line) || continuesTable(line.trimStart());
|
|
3284
3284
|
let start = end;
|