@ai-matrx/content-ir 0.18.2 → 0.18.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 +6 -0
- package/dist/index.cjs +18 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +18 -7
- package/dist/index.js.map +1 -1
- package/dist/source.cjs +18 -7
- package/dist/source.cjs.map +1 -1
- package/dist/source.js +18 -7
- package/dist/source.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5482,16 +5482,27 @@ var BacktickRuns = class {
|
|
|
5482
5482
|
}
|
|
5483
5483
|
};
|
|
5484
5484
|
function codeSpans(text, from, to, out) {
|
|
5485
|
-
|
|
5486
|
-
for (let
|
|
5487
|
-
const
|
|
5488
|
-
|
|
5485
|
+
let runs = null;
|
|
5486
|
+
for (let i = from; i < to; ) {
|
|
5487
|
+
const ch = text.charCodeAt(i);
|
|
5488
|
+
if (ch === 92) {
|
|
5489
|
+
i += 2;
|
|
5490
|
+
continue;
|
|
5491
|
+
}
|
|
5492
|
+
if (ch !== 96) {
|
|
5493
|
+
i++;
|
|
5494
|
+
continue;
|
|
5495
|
+
}
|
|
5496
|
+
const n = backtickRunLength(text, i);
|
|
5497
|
+
const len = Math.min(n, to - i);
|
|
5498
|
+
runs ??= new BacktickRuns(text, from, to);
|
|
5499
|
+
const close = runs.next(len, i + len);
|
|
5489
5500
|
if (close === -1) {
|
|
5490
|
-
|
|
5501
|
+
i += len;
|
|
5491
5502
|
continue;
|
|
5492
5503
|
}
|
|
5493
|
-
out.push({ start, end: close +
|
|
5494
|
-
|
|
5504
|
+
out.push({ start: i, end: close + len, kind: "span" });
|
|
5505
|
+
i = close + len;
|
|
5495
5506
|
}
|
|
5496
5507
|
}
|
|
5497
5508
|
function findCodeRanges(text) {
|