@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/source.cjs
CHANGED
|
@@ -515,16 +515,27 @@ var BacktickRuns = class {
|
|
|
515
515
|
}
|
|
516
516
|
};
|
|
517
517
|
function codeSpans(text, from, to, out) {
|
|
518
|
-
|
|
519
|
-
for (let
|
|
520
|
-
const
|
|
521
|
-
|
|
518
|
+
let runs = null;
|
|
519
|
+
for (let i = from; i < to; ) {
|
|
520
|
+
const ch = text.charCodeAt(i);
|
|
521
|
+
if (ch === 92) {
|
|
522
|
+
i += 2;
|
|
523
|
+
continue;
|
|
524
|
+
}
|
|
525
|
+
if (ch !== 96) {
|
|
526
|
+
i++;
|
|
527
|
+
continue;
|
|
528
|
+
}
|
|
529
|
+
const n = backtickRunLength(text, i);
|
|
530
|
+
const len = Math.min(n, to - i);
|
|
531
|
+
runs ??= new BacktickRuns(text, from, to);
|
|
532
|
+
const close = runs.next(len, i + len);
|
|
522
533
|
if (close === -1) {
|
|
523
|
-
|
|
534
|
+
i += len;
|
|
524
535
|
continue;
|
|
525
536
|
}
|
|
526
|
-
out.push({ start, end: close +
|
|
527
|
-
|
|
537
|
+
out.push({ start: i, end: close + len, kind: "span" });
|
|
538
|
+
i = close + len;
|
|
528
539
|
}
|
|
529
540
|
}
|
|
530
541
|
function findCodeRanges(text) {
|