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