@mintlify/cli 4.0.1783 → 4.0.1785
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/bin/cli.js +6 -0
- package/bin/tsconfig.build.tsbuildinfo +1 -1
- package/bin/vendor/converter.js +222 -58
- package/package.json +8 -8
- package/src/cli.tsx +6 -0
package/bin/vendor/converter.js
CHANGED
|
@@ -9826,6 +9826,10 @@ var labelView;
|
|
|
9826
9826
|
var labelContext;
|
|
9827
9827
|
var labelEnd = -1;
|
|
9828
9828
|
var documentSource = "";
|
|
9829
|
+
var replayFrom = [];
|
|
9830
|
+
var replayTo = [];
|
|
9831
|
+
var replayRest = Infinity;
|
|
9832
|
+
var contentEnd = 0;
|
|
9829
9833
|
function resetInline(config, source) {
|
|
9830
9834
|
documentSource = source;
|
|
9831
9835
|
delimiterCount = 0;
|
|
@@ -9963,7 +9967,7 @@ function destinationEnd(source, start, end) {
|
|
|
9963
9967
|
const c = source.charCodeAt(i);
|
|
9964
9968
|
if (c !== 0 && c <= 32 || c === 127)
|
|
9965
9969
|
break;
|
|
9966
|
-
if (c === 92 && isPunctuation(source.charCodeAt(i + 1))) {
|
|
9970
|
+
if (c === 92 && i + 1 < source.length && isPunctuation(source.charCodeAt(i + 1))) {
|
|
9967
9971
|
i++;
|
|
9968
9972
|
continue;
|
|
9969
9973
|
}
|
|
@@ -10231,15 +10235,16 @@ function codeValue(view, start, end) {
|
|
|
10231
10235
|
function virtualSpace(view, i) {
|
|
10232
10236
|
return !!view.map && view.source.charCodeAt(i) === 32 && documentSource.charCodeAt(view.map[i]) === 9;
|
|
10233
10237
|
}
|
|
10238
|
+
var htmlReach = 0;
|
|
10234
10239
|
function attributeValueEnd(source, at3, end, loose) {
|
|
10235
10240
|
let i = at3;
|
|
10236
10241
|
for (; ; ) {
|
|
10237
10242
|
const c = source.charCodeAt(i);
|
|
10238
10243
|
if (i >= end || c === 60 || c === 61 || c === 62 || c === 96)
|
|
10239
|
-
return
|
|
10244
|
+
return htmlFailure(i);
|
|
10240
10245
|
if (c === 34 || c === 39) {
|
|
10241
10246
|
const stop = source.indexOf(source[i], i + 1);
|
|
10242
|
-
return stop < 0 || stop >= end ?
|
|
10247
|
+
return stop < 0 || stop >= end ? htmlFailure(end) : stop + 1;
|
|
10243
10248
|
}
|
|
10244
10249
|
const begin = i;
|
|
10245
10250
|
if (!loose)
|
|
@@ -10247,7 +10252,7 @@ function attributeValueEnd(source, at3, end, loose) {
|
|
|
10247
10252
|
while (i < end && !isWhitespace(source.charCodeAt(i)) && !"\"'=/<>`".includes(source[i]))
|
|
10248
10253
|
i++;
|
|
10249
10254
|
if (i === begin)
|
|
10250
|
-
return
|
|
10255
|
+
return htmlFailure(i);
|
|
10251
10256
|
if (!loose || source.charCodeAt(i) !== 61)
|
|
10252
10257
|
return i;
|
|
10253
10258
|
i++;
|
|
@@ -10255,29 +10260,34 @@ function attributeValueEnd(source, at3, end, loose) {
|
|
|
10255
10260
|
i++;
|
|
10256
10261
|
}
|
|
10257
10262
|
}
|
|
10263
|
+
function htmlFailure(at3) {
|
|
10264
|
+
htmlReach = at3;
|
|
10265
|
+
return -1;
|
|
10266
|
+
}
|
|
10258
10267
|
function htmlEnd(source, start, end, loose = false) {
|
|
10259
10268
|
let i = start + 1;
|
|
10269
|
+
htmlReach = i;
|
|
10260
10270
|
if (source.startsWith("<!--", start)) {
|
|
10261
10271
|
if (source.charCodeAt(start + 4) === 62)
|
|
10262
10272
|
return start + 5;
|
|
10263
10273
|
if (source.charCodeAt(start + 4) === 45 && source.charCodeAt(start + 5) === 62)
|
|
10264
10274
|
return start + 6;
|
|
10265
10275
|
const stop = source.indexOf("-->", start + 4);
|
|
10266
|
-
return stop < 0 || stop + 3 > end ?
|
|
10276
|
+
return stop < 0 || stop + 3 > end ? htmlFailure(end) : stop + 3;
|
|
10267
10277
|
}
|
|
10268
10278
|
if (source.startsWith("<![CDATA[", start)) {
|
|
10269
10279
|
const stop = source.indexOf("]]>", start + 9);
|
|
10270
|
-
return stop < 0 || stop + 3 > end ?
|
|
10280
|
+
return stop < 0 || stop + 3 > end ? htmlFailure(end) : stop + 3;
|
|
10271
10281
|
}
|
|
10272
10282
|
if (source.charCodeAt(i) === 63) {
|
|
10273
10283
|
const stop = source.indexOf("?>", i + 1);
|
|
10274
|
-
return stop < 0 || stop + 2 > end ?
|
|
10284
|
+
return stop < 0 || stop + 2 > end ? htmlFailure(end) : stop + 2;
|
|
10275
10285
|
}
|
|
10276
10286
|
if (source.charCodeAt(i) === 33) {
|
|
10277
10287
|
if (!alpha(source.charCodeAt(i + 1)))
|
|
10278
10288
|
return -1;
|
|
10279
10289
|
const stop = source.indexOf(">", i + 2);
|
|
10280
|
-
return stop < 0 || stop >= end ?
|
|
10290
|
+
return stop < 0 || stop >= end ? htmlFailure(end) : stop + 1;
|
|
10281
10291
|
}
|
|
10282
10292
|
const closing = source.charCodeAt(i) === 47;
|
|
10283
10293
|
if (closing)
|
|
@@ -10294,10 +10304,10 @@ function htmlEnd(source, start, end, loose = false) {
|
|
|
10294
10304
|
if (source.charCodeAt(i) === 47 && source.charCodeAt(i + 1) === 62 && !closing)
|
|
10295
10305
|
return i + 2;
|
|
10296
10306
|
if (closing || i === before)
|
|
10297
|
-
return
|
|
10307
|
+
return htmlFailure(i);
|
|
10298
10308
|
const c = source.charCodeAt(i);
|
|
10299
10309
|
if (!alpha(c) && c !== 95 && c !== 58)
|
|
10300
|
-
return
|
|
10310
|
+
return htmlFailure(i);
|
|
10301
10311
|
i++;
|
|
10302
10312
|
while (i < end && (alpha(source.charCodeAt(i)) || digit(source.charCodeAt(i)) || "-._:".includes(source[i])))
|
|
10303
10313
|
i++;
|
|
@@ -10312,7 +10322,7 @@ function htmlEnd(source, start, end, loose = false) {
|
|
|
10312
10322
|
if (i < 0)
|
|
10313
10323
|
return -1;
|
|
10314
10324
|
}
|
|
10315
|
-
return
|
|
10325
|
+
return htmlFailure(end);
|
|
10316
10326
|
}
|
|
10317
10327
|
function autolink(source, start, end) {
|
|
10318
10328
|
let i = start + 1;
|
|
@@ -10365,10 +10375,80 @@ function validEmail(value) {
|
|
|
10365
10375
|
}
|
|
10366
10376
|
function plainText(view, start, end, parent, value) {
|
|
10367
10377
|
const last = view.source.charCodeAt(end - 1);
|
|
10368
|
-
const n = node(Kind.Text, offset(view, start), last === 10 || last === 13 ?
|
|
10378
|
+
const n = node(Kind.Text, offset(view, start), last === 10 || last === 13 ? lineEndingEnd(view, end) : offset(view, end), parent);
|
|
10369
10379
|
tree.value[n] = value ?? decode(view.source.slice(start, end));
|
|
10370
10380
|
return n;
|
|
10371
10381
|
}
|
|
10382
|
+
function replay(from, to) {
|
|
10383
|
+
if (to >= contentEnd)
|
|
10384
|
+
replayRest = Math.min(replayRest, from);
|
|
10385
|
+
else {
|
|
10386
|
+
replayFrom.push(from);
|
|
10387
|
+
replayTo.push(to);
|
|
10388
|
+
}
|
|
10389
|
+
}
|
|
10390
|
+
function lineEndingEnd(view, stop) {
|
|
10391
|
+
if (!view.map || !replayed(stop))
|
|
10392
|
+
return offset(view, stop - 1) + 1;
|
|
10393
|
+
const at3 = offset(view, stop);
|
|
10394
|
+
return view.source.charCodeAt(stop) === 32 && documentSource.charCodeAt(at3) === 9 ? at3 + 1 : at3;
|
|
10395
|
+
}
|
|
10396
|
+
function replayed(stop) {
|
|
10397
|
+
if (replayRest < stop)
|
|
10398
|
+
return true;
|
|
10399
|
+
let live = 0;
|
|
10400
|
+
let hit = false;
|
|
10401
|
+
for (let k = 0; k < replayFrom.length; k++) {
|
|
10402
|
+
if (replayTo[k] < stop)
|
|
10403
|
+
continue;
|
|
10404
|
+
if (replayFrom[k] < stop)
|
|
10405
|
+
hit = true;
|
|
10406
|
+
replayFrom[live] = replayFrom[k];
|
|
10407
|
+
replayTo[live++] = replayTo[k];
|
|
10408
|
+
}
|
|
10409
|
+
replayFrom.length = replayTo.length = live;
|
|
10410
|
+
return hit;
|
|
10411
|
+
}
|
|
10412
|
+
function resourceFailure(source, start, end) {
|
|
10413
|
+
let i = skipWhitespace(source, start + 1, end);
|
|
10414
|
+
const dest = destinationEnd(source, i, end);
|
|
10415
|
+
if (dest < 0) {
|
|
10416
|
+
if (source.charCodeAt(i) === 60) {
|
|
10417
|
+
for (i++; i < end; i++) {
|
|
10418
|
+
const c = source.charCodeAt(i);
|
|
10419
|
+
if (c === 60 || c === 10 || c === 13)
|
|
10420
|
+
return i;
|
|
10421
|
+
if (c === 92 && isPunctuation(source.charCodeAt(i + 1)))
|
|
10422
|
+
i++;
|
|
10423
|
+
}
|
|
10424
|
+
return end;
|
|
10425
|
+
}
|
|
10426
|
+
let depth = 0;
|
|
10427
|
+
for (; i < end; i++) {
|
|
10428
|
+
const c = source.charCodeAt(i);
|
|
10429
|
+
if (c !== 0 && c <= 32 || c === 127)
|
|
10430
|
+
return i;
|
|
10431
|
+
if (c === 92 && isPunctuation(source.charCodeAt(i + 1)))
|
|
10432
|
+
i++;
|
|
10433
|
+
else if (c === 40 && ++depth > MAX_DESTINATION_PAREN_DEPTH)
|
|
10434
|
+
return i;
|
|
10435
|
+
else if (c === 41)
|
|
10436
|
+
depth--;
|
|
10437
|
+
}
|
|
10438
|
+
return end;
|
|
10439
|
+
}
|
|
10440
|
+
i = skipWhitespace(source, dest, end);
|
|
10441
|
+
if (i > dest && source.charCodeAt(i) !== 41) {
|
|
10442
|
+
const t = titleEnd(source, i, end);
|
|
10443
|
+
if (t < 0)
|
|
10444
|
+
return titleOpener(source.charCodeAt(i)) ? end : i;
|
|
10445
|
+
i = skipWhitespace(source, t, end);
|
|
10446
|
+
}
|
|
10447
|
+
return i;
|
|
10448
|
+
}
|
|
10449
|
+
function titleOpener(c) {
|
|
10450
|
+
return c === 34 || c === 39 || c === 40;
|
|
10451
|
+
}
|
|
10372
10452
|
function mergeText(parent) {
|
|
10373
10453
|
let last = 0;
|
|
10374
10454
|
for (let n = tree.child[parent]; n; ) {
|
|
@@ -10394,8 +10474,12 @@ function flatten(parent) {
|
|
|
10394
10474
|
function parseInline(view, start, end, parent, context, inLink = false, trim = true, literals = !inLink) {
|
|
10395
10475
|
const source = view.source;
|
|
10396
10476
|
const delimiterBegin = delimiterCount;
|
|
10397
|
-
if (trim)
|
|
10477
|
+
if (trim) {
|
|
10398
10478
|
firstRun = 0;
|
|
10479
|
+
replayFrom.length = replayTo.length = 0;
|
|
10480
|
+
replayRest = Infinity;
|
|
10481
|
+
contentEnd = end;
|
|
10482
|
+
}
|
|
10399
10483
|
let textStart = start;
|
|
10400
10484
|
const emailAt = context.config.gfm && literals ? source.indexOf("@", start) : -1;
|
|
10401
10485
|
const email = emailAt >= 0 && emailAt < end;
|
|
@@ -10456,7 +10540,7 @@ function parseInline(view, start, end, parent, context, inLink = false, trim = t
|
|
|
10456
10540
|
let stop = i + 2;
|
|
10457
10541
|
if (next === 13 && source.charCodeAt(stop) === 10)
|
|
10458
10542
|
stop++;
|
|
10459
|
-
node(Kind.Break, offset(view, i),
|
|
10543
|
+
node(Kind.Break, offset(view, i), lineEndingEnd(view, stop), parent);
|
|
10460
10544
|
while (space(source.charCodeAt(stop)))
|
|
10461
10545
|
stop++;
|
|
10462
10546
|
i = textStart = stop;
|
|
@@ -10477,7 +10561,7 @@ function parseInline(view, start, end, parent, context, inLink = false, trim = t
|
|
|
10477
10561
|
if (!tabs && i - trim2 >= 2 && source.charCodeAt(i - 1) === 32 && source.charCodeAt(i - 2) === 32) {
|
|
10478
10562
|
if (textStart < trim2)
|
|
10479
10563
|
plainText(view, textStart, trim2, parent);
|
|
10480
|
-
node(Kind.Break, offset(view, trim2),
|
|
10564
|
+
node(Kind.Break, offset(view, trim2), lineEndingEnd(view, stop), parent);
|
|
10481
10565
|
while (space(source.charCodeAt(stop)))
|
|
10482
10566
|
stop++;
|
|
10483
10567
|
i = textStart = stop;
|
|
@@ -10507,6 +10591,7 @@ function parseInline(view, start, end, parent, context, inLink = false, trim = t
|
|
|
10507
10591
|
i = textStart = stop;
|
|
10508
10592
|
continue;
|
|
10509
10593
|
}
|
|
10594
|
+
replay(i, Infinity);
|
|
10510
10595
|
i = run;
|
|
10511
10596
|
continue;
|
|
10512
10597
|
}
|
|
@@ -10524,6 +10609,8 @@ function parseInline(view, start, end, parent, context, inLink = false, trim = t
|
|
|
10524
10609
|
i = textStart = stop;
|
|
10525
10610
|
continue;
|
|
10526
10611
|
}
|
|
10612
|
+
if (run - i >= mathRun)
|
|
10613
|
+
replay(i, Infinity);
|
|
10527
10614
|
i = run;
|
|
10528
10615
|
continue;
|
|
10529
10616
|
}
|
|
@@ -10569,8 +10656,11 @@ function parseInline(view, start, end, parent, context, inLink = false, trim = t
|
|
|
10569
10656
|
data3 = { label: decode(raw.slice(1)), identifier: normalizeIdentifier(raw.slice(1)) };
|
|
10570
10657
|
footnote = true;
|
|
10571
10658
|
} else if (image2 || !inLink) {
|
|
10572
|
-
if (source.charCodeAt(stop) === 40)
|
|
10659
|
+
if (source.charCodeAt(stop) === 40) {
|
|
10573
10660
|
data3 = resource(source, stop, end);
|
|
10661
|
+
if (!data3 && view.map)
|
|
10662
|
+
replay(stop, resourceFailure(source, stop, end));
|
|
10663
|
+
}
|
|
10574
10664
|
if (data3)
|
|
10575
10665
|
stop = data3.end;
|
|
10576
10666
|
else {
|
|
@@ -10594,6 +10684,8 @@ function parseInline(view, start, end, parent, context, inLink = false, trim = t
|
|
|
10594
10684
|
else
|
|
10595
10685
|
label = "";
|
|
10596
10686
|
}
|
|
10687
|
+
if (stop <= r)
|
|
10688
|
+
replay(stop, source.charCodeAt(r) === 93 ? r + 1 : r);
|
|
10597
10689
|
}
|
|
10598
10690
|
if (label && context.definitions.has(normalizeIdentifier(label))) {
|
|
10599
10691
|
data3 = {
|
|
@@ -10604,6 +10696,8 @@ function parseInline(view, start, end, parent, context, inLink = false, trim = t
|
|
|
10604
10696
|
reference = true;
|
|
10605
10697
|
}
|
|
10606
10698
|
}
|
|
10699
|
+
} else if (view.map && source.charCodeAt(stop) === 40) {
|
|
10700
|
+
replay(stop, resourceFailure(source, stop, end));
|
|
10607
10701
|
}
|
|
10608
10702
|
if (data3 && !image2 && !footnote && containsLink(view, labelStart, close, context))
|
|
10609
10703
|
data3 = void 0;
|
|
@@ -10644,6 +10738,8 @@ function parseInline(view, start, end, parent, context, inLink = false, trim = t
|
|
|
10644
10738
|
i = textStart = stop;
|
|
10645
10739
|
continue;
|
|
10646
10740
|
}
|
|
10741
|
+
if (!auto)
|
|
10742
|
+
replay(i, htmlReach);
|
|
10647
10743
|
}
|
|
10648
10744
|
i++;
|
|
10649
10745
|
}
|
|
@@ -10985,7 +11081,8 @@ function marker(source, line, mdx2 = mdxMode) {
|
|
|
10985
11081
|
i++;
|
|
10986
11082
|
}
|
|
10987
11083
|
let remaining = 0;
|
|
10988
|
-
|
|
11084
|
+
const blankItem = i === line.end;
|
|
11085
|
+
if (!mdx2 && padding > MAX_LIST_PADDING || blankItem) {
|
|
10989
11086
|
remaining = source.charCodeAt(markerEnd) === 9 ? tabWidth(source, markerEnd) - 1 : 0;
|
|
10990
11087
|
i = markerEnd < line.end ? markerEnd + 1 : markerEnd;
|
|
10991
11088
|
padding = 1;
|
|
@@ -10993,6 +11090,7 @@ function marker(source, line, mdx2 = mdxMode) {
|
|
|
10993
11090
|
return {
|
|
10994
11091
|
start: scan.start,
|
|
10995
11092
|
content: i,
|
|
11093
|
+
prefix: blankItem ? markerEnd : i,
|
|
10996
11094
|
indent: scan.indent + markerEnd - scan.start + (padding || 1),
|
|
10997
11095
|
ordered,
|
|
10998
11096
|
number,
|
|
@@ -11154,7 +11252,7 @@ function startsContainer(context, line) {
|
|
|
11154
11252
|
function closesQuotedContainer(context, input, j, boundary) {
|
|
11155
11253
|
const source = context.source;
|
|
11156
11254
|
const line = j < input.length ? input[j] : boundary;
|
|
11157
|
-
if (!line || line === siblingLine || line.lazy
|
|
11255
|
+
if (!line || line === siblingLine || line.lazy)
|
|
11158
11256
|
return false;
|
|
11159
11257
|
if (!quotePrefix(source, line) && !footnoteIndented(source, line))
|
|
11160
11258
|
return false;
|
|
@@ -11184,7 +11282,7 @@ function closeFootnoteItem(context, input, j, lastContent, item, list, nextSibli
|
|
|
11184
11282
|
if (!footnoteLines)
|
|
11185
11283
|
return false;
|
|
11186
11284
|
const source = context.source;
|
|
11187
|
-
const exit = nextSibling ? footnoteIndented(source, input[j]) && nextSibling.
|
|
11285
|
+
const exit = nextSibling ? footnoteIndented(source, input[j]) && nextSibling.prefix : closesQuotedContainer(context, input, j, boundary) ? footnoteIndented(source, input[j] ?? boundary) && (input[j] ?? boundary).start : j > lastContent + 1 && quotePrefix(source, input[j - 1]) && footnoteIndented(source, input[j - 1]) && input[j - 1].end;
|
|
11188
11286
|
if (exit === false)
|
|
11189
11287
|
return false;
|
|
11190
11288
|
if (tree.end[item] <= input[lastContent].end) {
|
|
@@ -11201,51 +11299,88 @@ function lazyLine(context, line) {
|
|
|
11201
11299
|
return 1;
|
|
11202
11300
|
return line.next === line.end ? 0 : 2;
|
|
11203
11301
|
}
|
|
11204
|
-
function within(
|
|
11302
|
+
function within(context, opener, line) {
|
|
11303
|
+
const source = context.source;
|
|
11304
|
+
let list = false;
|
|
11205
11305
|
for (let depth = 0; depth < MAX_LAZY_CONTAINER_PROBES; depth++) {
|
|
11206
11306
|
const q = quote(source, opener);
|
|
11207
11307
|
const m = q < 0 ? marker(source, opener) : void 0;
|
|
11208
|
-
|
|
11308
|
+
const f = q < 0 && !m && context.config.gfm ? footnoteLabel(source, opener) : void 0;
|
|
11309
|
+
if (q < 0 && !m && !f)
|
|
11209
11310
|
break;
|
|
11210
|
-
|
|
11311
|
+
list = !!m;
|
|
11312
|
+
const next = m ? { start: m.content, end: opener.end, next: opener.next, padding: m.padding } : f ? { start: f.end, end: opener.end, next: opener.next } : { start: q, end: opener.end, next: opener.next, padding: quotePadding(source, q) };
|
|
11211
11313
|
if (line.start === opener.start)
|
|
11212
11314
|
line = { ...next, end: line.end, next: line.next };
|
|
11213
|
-
else if (m) {
|
|
11214
|
-
|
|
11215
|
-
|
|
11216
|
-
|
|
11315
|
+
else if (m || f) {
|
|
11316
|
+
const indent = m ? m.indent : FOOTNOTE_INDENT;
|
|
11317
|
+
if (indentation(source, line).indent < indent)
|
|
11318
|
+
return { line, lazy: true, list };
|
|
11319
|
+
line = stripIndent(source, line, indent);
|
|
11217
11320
|
} else {
|
|
11218
11321
|
const r = quote(source, line);
|
|
11219
11322
|
if (r < 0)
|
|
11220
|
-
return { line, lazy: true };
|
|
11323
|
+
return { line, lazy: true, list };
|
|
11221
11324
|
line = { start: r, end: line.end, next: line.next, padding: quotePadding(source, r) };
|
|
11222
11325
|
}
|
|
11223
11326
|
opener = next;
|
|
11224
11327
|
}
|
|
11225
|
-
return { line, lazy: false };
|
|
11328
|
+
return { line, lazy: false, list };
|
|
11226
11329
|
}
|
|
11227
11330
|
function quotePadding(source, content) {
|
|
11228
11331
|
return source.charCodeAt(content - 1) === 9 ? tabWidth(source, content - 1) - 1 : 0;
|
|
11229
11332
|
}
|
|
11230
|
-
function nestedTable(context, opener, header, delimiter2) {
|
|
11333
|
+
function nestedTable(context, previous, opener, header, delimiter2) {
|
|
11231
11334
|
const source = context.source;
|
|
11232
11335
|
let dash = delimiter2.start;
|
|
11233
11336
|
while (dash < delimiter2.end && source.charCodeAt(dash) !== 45)
|
|
11234
11337
|
dash++;
|
|
11235
11338
|
if (dash === delimiter2.end)
|
|
11236
11339
|
return false;
|
|
11237
|
-
const row2 =
|
|
11340
|
+
const row2 = withinOpener(context, previous, opener, delimiter2);
|
|
11238
11341
|
if (row2.lazy)
|
|
11239
11342
|
return false;
|
|
11240
|
-
const head =
|
|
11241
|
-
|
|
11343
|
+
const head = withinOpener(context, previous, opener, header).line;
|
|
11344
|
+
if (blank(source, head))
|
|
11345
|
+
return false;
|
|
11346
|
+
if (context.interrupt?.(head))
|
|
11347
|
+
return false;
|
|
11348
|
+
return !!tableStart(context, [head, row2.line], 0);
|
|
11349
|
+
}
|
|
11350
|
+
function tableRow(context, previous, opener, line) {
|
|
11351
|
+
const row2 = withinOpener(context, previous, opener, line);
|
|
11352
|
+
return !row2.lazy && !blank(context.source, row2.line) && !interrupts(context, row2.line) && !marker(context.source, row2.line);
|
|
11242
11353
|
}
|
|
11243
|
-
function
|
|
11244
|
-
|
|
11245
|
-
|
|
11354
|
+
function mayOpenContainer(source, line) {
|
|
11355
|
+
let i = line.start;
|
|
11356
|
+
while (space(source.charCodeAt(i)))
|
|
11357
|
+
i++;
|
|
11358
|
+
const c = source.charCodeAt(i);
|
|
11359
|
+
return c === 62 || c === 45 || c === 42 || c === 43 || c === 91 || c >= 48 && c <= 57;
|
|
11246
11360
|
}
|
|
11247
11361
|
function paragraphOpener(context, opener, line, open) {
|
|
11248
|
-
|
|
11362
|
+
const source = context.source;
|
|
11363
|
+
if (!open) {
|
|
11364
|
+
if (opener !== line) {
|
|
11365
|
+
const inner = within(context, opener, opener);
|
|
11366
|
+
if (inner.list && blank(source, inner.line) && !within(context, opener, line).lazy)
|
|
11367
|
+
return opener;
|
|
11368
|
+
}
|
|
11369
|
+
return line;
|
|
11370
|
+
}
|
|
11371
|
+
return interrupts(context, within(context, opener, line).line) ? line : opener;
|
|
11372
|
+
}
|
|
11373
|
+
function withinOpener(context, previous, opener, line) {
|
|
11374
|
+
if (previous && previous !== opener && mayOpenContainer(context.source, previous)) {
|
|
11375
|
+
const inner = within(context, previous, opener);
|
|
11376
|
+
if (!inner.lazy && inner.line.start !== opener.start) {
|
|
11377
|
+
const outer = within(context, previous, line);
|
|
11378
|
+
if (outer.lazy || !mayOpenContainer(context.source, inner.line))
|
|
11379
|
+
return outer;
|
|
11380
|
+
return within(context, inner.line, outer.line);
|
|
11381
|
+
}
|
|
11382
|
+
}
|
|
11383
|
+
return within(context, opener, line);
|
|
11249
11384
|
}
|
|
11250
11385
|
function lazyState(context, line, interrupted = false, open = 0, listed = false) {
|
|
11251
11386
|
const source = context.source;
|
|
@@ -11532,7 +11667,7 @@ function row(context, line, parent) {
|
|
|
11532
11667
|
}
|
|
11533
11668
|
}
|
|
11534
11669
|
function tableStart(context, input, i, paragraph = false) {
|
|
11535
|
-
if (!context.config.gfm || !input[i + 1] || input[i + 1].lazy)
|
|
11670
|
+
if (!context.config.gfm || !input[i + 1] || input[i + 1].lazy || input[i] === afterTable)
|
|
11536
11671
|
return;
|
|
11537
11672
|
const source = context.source;
|
|
11538
11673
|
const align = tableAlign(source, input[i + 1]);
|
|
@@ -11557,8 +11692,6 @@ function endsWithTable(n, end) {
|
|
|
11557
11692
|
return !!last && tree.kind[last] === Kind.Table && tree.end[last] === end;
|
|
11558
11693
|
}
|
|
11559
11694
|
function parseTable(context, input, i, parent, paragraph) {
|
|
11560
|
-
if (input[i] === afterTable)
|
|
11561
|
-
return 0;
|
|
11562
11695
|
const align = tableStart(context, input, i, paragraph);
|
|
11563
11696
|
if (!align || !mdxMode && htmlBlock(context.source, input[i], false))
|
|
11564
11697
|
return 0;
|
|
@@ -11646,6 +11779,11 @@ function parseFencedCode(context, input, i, parent, opening, boundary) {
|
|
|
11646
11779
|
else if (value.charCodeAt(value.length - 1) === 13)
|
|
11647
11780
|
tree.value[n] = value.slice(0, -1);
|
|
11648
11781
|
}
|
|
11782
|
+
const head = content[0];
|
|
11783
|
+
if (head && head.start === head.end && !head.padding && source.charCodeAt(line.end) === 13 && line.next === line.end + 1 && tree.value[n].charCodeAt(0) === 10)
|
|
11784
|
+
tree.value[n] = tree.value[n].slice(1);
|
|
11785
|
+
if ((closed || keepEnding) && content.length > 1 && tail.start === tail.end && !tail.padding && source.charCodeAt(tail.end) === 10 && tree.value[n].charCodeAt(tree.value[n].length - 1) === 13)
|
|
11786
|
+
tree.value[n] = tree.value[n].slice(0, -1);
|
|
11649
11787
|
return j - i + (closed ? 1 : 0);
|
|
11650
11788
|
}
|
|
11651
11789
|
function parseHtmlBlock(context, input, i, parent, html2, boundary) {
|
|
@@ -11691,6 +11829,7 @@ function parseFootnoteDefinition(context, input, i, parent, footnote, start, res
|
|
|
11691
11829
|
let open = lazyState(context, content[0], residual > 0);
|
|
11692
11830
|
let listed = lazyListed;
|
|
11693
11831
|
let opener = content[0];
|
|
11832
|
+
let previous;
|
|
11694
11833
|
let table = false;
|
|
11695
11834
|
let rejected;
|
|
11696
11835
|
for (; j < input.length; j++) {
|
|
@@ -11706,19 +11845,24 @@ function parseFootnoteDefinition(context, input, i, parent, footnote, start, res
|
|
|
11706
11845
|
nested && indent === 0)) {
|
|
11707
11846
|
const stripped = indent >= FOOTNOTE_INDENT ? stripIndent(source, input[j], FOOTNOTE_INDENT) : input[j];
|
|
11708
11847
|
if (table) {
|
|
11709
|
-
table = tableRow(context, opener, stripped);
|
|
11848
|
+
table = tableRow(context, previous, opener, stripped);
|
|
11710
11849
|
if (!table)
|
|
11711
11850
|
rejected = stripped;
|
|
11712
|
-
} else if (context.config.gfm && content[content.length - 1] !== rejected && nestedTable(context, opener, content[content.length - 1], stripped))
|
|
11851
|
+
} else if (context.config.gfm && content[content.length - 1] !== rejected && nestedTable(context, previous, opener, content[content.length - 1], stripped))
|
|
11713
11852
|
table = true;
|
|
11714
|
-
if (!table)
|
|
11715
|
-
|
|
11853
|
+
if (!table) {
|
|
11854
|
+
const next = paragraphOpener(
|
|
11716
11855
|
context,
|
|
11717
11856
|
opener,
|
|
11718
11857
|
stripped,
|
|
11719
11858
|
open === 1
|
|
11720
11859
|
/* InterruptState.Paragraph */
|
|
11721
11860
|
);
|
|
11861
|
+
if (next !== opener) {
|
|
11862
|
+
previous = opener;
|
|
11863
|
+
opener = next;
|
|
11864
|
+
}
|
|
11865
|
+
}
|
|
11722
11866
|
content.push(stripped);
|
|
11723
11867
|
last = j;
|
|
11724
11868
|
open = table ? 0 : lazyState(context, stripped, open === 1, open, listed);
|
|
@@ -11776,12 +11920,12 @@ function hasNestedBlankLine(source, content, parent) {
|
|
|
11776
11920
|
continue;
|
|
11777
11921
|
for (let c = tree.child[n]; c; c = tree.next[c]) {
|
|
11778
11922
|
for (const line of content)
|
|
11779
|
-
if (line.
|
|
11923
|
+
if (line.end > previousEnd && line.end <= tree.start[c] && blank(source, line))
|
|
11780
11924
|
return true;
|
|
11781
11925
|
previousEnd = tree.end[c];
|
|
11782
11926
|
}
|
|
11783
11927
|
for (const line of content)
|
|
11784
|
-
if (line.
|
|
11928
|
+
if (line.end > previousEnd && (tree.kind[n] === Kind.FootnoteDefinition ? line.end < line.next && line.next <= end : line.end <= end) && blank(source, line))
|
|
11785
11929
|
return true;
|
|
11786
11930
|
if (hasNestedBlankLine(source, content, n))
|
|
11787
11931
|
return true;
|
|
@@ -11796,6 +11940,7 @@ function quoteLines(context, input, i, residual, content) {
|
|
|
11796
11940
|
let table = false;
|
|
11797
11941
|
let rejected;
|
|
11798
11942
|
let opener;
|
|
11943
|
+
let previous;
|
|
11799
11944
|
for (; j < input.length; j++) {
|
|
11800
11945
|
const current3 = input[j];
|
|
11801
11946
|
const stripped = quote(source, current3);
|
|
@@ -11808,19 +11953,24 @@ function quoteLines(context, input, i, residual, content) {
|
|
|
11808
11953
|
lazy: current3.lazy
|
|
11809
11954
|
};
|
|
11810
11955
|
if (table && opener) {
|
|
11811
|
-
table = tableRow(context, opener, item);
|
|
11956
|
+
table = tableRow(context, previous, opener, item);
|
|
11812
11957
|
if (!table)
|
|
11813
11958
|
rejected = item;
|
|
11814
|
-
} else if (context.config.gfm && opener && content[content.length - 1] !== rejected && nestedTable(context, opener, content[content.length - 1], item))
|
|
11959
|
+
} else if (context.config.gfm && opener && content[content.length - 1] !== rejected && nestedTable(context, previous, opener, content[content.length - 1], item))
|
|
11815
11960
|
table = true;
|
|
11816
|
-
if (!table)
|
|
11817
|
-
|
|
11961
|
+
if (!table) {
|
|
11962
|
+
const next = paragraphOpener(
|
|
11818
11963
|
context,
|
|
11819
11964
|
opener ?? item,
|
|
11820
11965
|
item,
|
|
11821
11966
|
open === 1
|
|
11822
11967
|
/* InterruptState.Paragraph */
|
|
11823
11968
|
);
|
|
11969
|
+
if (next !== opener) {
|
|
11970
|
+
previous = opener;
|
|
11971
|
+
opener = next;
|
|
11972
|
+
}
|
|
11973
|
+
}
|
|
11824
11974
|
content.push(item);
|
|
11825
11975
|
const interrupted = open === 1 || j === i && residual > 0;
|
|
11826
11976
|
open = table ? 0 : lazyState(context, item, interrupted, open, listed);
|
|
@@ -11842,7 +11992,7 @@ function quoteLines(context, input, i, residual, content) {
|
|
|
11842
11992
|
function extendBlankContainer(source, input, i, parent) {
|
|
11843
11993
|
const line = input[i];
|
|
11844
11994
|
const previous = tree.last[parent];
|
|
11845
|
-
if (!previous || !quotePrefix(source, line) || !(tree.kind[previous] === Kind.Blockquote && line.next === source.length && line.end === line.next && i > 0 && !blank(source, input[i - 1]) || tree.kind[previous] === Kind.List || tree.kind[previous] === Kind.FootnoteDefinition))
|
|
11995
|
+
if (!previous || !quotePrefix(source, line) || !(tree.kind[previous] === Kind.Blockquote && line.next === source.length && line.end === line.next && line.start === line.end && !line.padding && i > 0 && !blank(source, input[i - 1]) || tree.kind[previous] === Kind.List || tree.kind[previous] === Kind.FootnoteDefinition))
|
|
11846
11996
|
return;
|
|
11847
11997
|
const item = tree.kind[previous] === Kind.List ? tree.last[previous] : 0;
|
|
11848
11998
|
if (item && footnoteIndented(source, line)) {
|
|
@@ -11931,8 +12081,9 @@ function parseBlocks(context, input, parent, document = false, inheritedInterrup
|
|
|
11931
12081
|
afterTable = input[j2];
|
|
11932
12082
|
if (input[j2]?.lazy)
|
|
11933
12083
|
return j2;
|
|
11934
|
-
|
|
11935
|
-
|
|
12084
|
+
const last = tree.last[n2];
|
|
12085
|
+
if (closesQuotedContainer(context, input, j2, boundary) || last && (input[j2] ?? boundary) && (input[j2] ?? boundary) !== siblingLine && tree.end[last] > input[j2 - 1].end)
|
|
12086
|
+
tree.end[n2] = (input[j2] ?? boundary).start;
|
|
11936
12087
|
if (tree.last[n2])
|
|
11937
12088
|
tree.end[n2] = Math.max(tree.end[n2], tree.end[tree.last[n2]]);
|
|
11938
12089
|
pendingLazy = j2 < input.length && !blank(source, input[j2]);
|
|
@@ -11998,6 +12149,7 @@ function parseBlocks(context, input, parent, document = false, inheritedInterrup
|
|
|
11998
12149
|
let open = lazyState(context, content2[0], residual > 0);
|
|
11999
12150
|
let listed = lazyListed;
|
|
12000
12151
|
let opener = content2[0];
|
|
12152
|
+
let previous2;
|
|
12001
12153
|
let sawBlank = false;
|
|
12002
12154
|
let lastContent = itemStart;
|
|
12003
12155
|
let itemSpread = false;
|
|
@@ -12032,19 +12184,24 @@ function parseBlocks(context, input, parent, document = false, inheritedInterrup
|
|
|
12032
12184
|
if (!current3.lazy && scan2.indent >= mark.indent) {
|
|
12033
12185
|
const stripped = stripIndent(source, current3, mark.indent);
|
|
12034
12186
|
if (table) {
|
|
12035
|
-
table = tableRow(context, opener, stripped);
|
|
12187
|
+
table = tableRow(context, previous2, opener, stripped);
|
|
12036
12188
|
if (!table)
|
|
12037
12189
|
rejected = stripped;
|
|
12038
|
-
} else if (context.config.gfm && content2[content2.length - 1] !== rejected && nestedTable(context, opener, content2[content2.length - 1], stripped))
|
|
12190
|
+
} else if (context.config.gfm && content2[content2.length - 1] !== rejected && nestedTable(context, previous2, opener, content2[content2.length - 1], stripped))
|
|
12039
12191
|
table = true;
|
|
12040
|
-
if (!table)
|
|
12041
|
-
|
|
12192
|
+
if (!table) {
|
|
12193
|
+
const next = paragraphOpener(
|
|
12042
12194
|
context,
|
|
12043
12195
|
opener,
|
|
12044
12196
|
stripped,
|
|
12045
12197
|
open === 1
|
|
12046
12198
|
/* InterruptState.Paragraph */
|
|
12047
12199
|
);
|
|
12200
|
+
if (next !== opener) {
|
|
12201
|
+
previous2 = opener;
|
|
12202
|
+
opener = next;
|
|
12203
|
+
}
|
|
12204
|
+
}
|
|
12048
12205
|
content2.push(stripped);
|
|
12049
12206
|
lastContent = j2;
|
|
12050
12207
|
const interrupted = open === 1 || residual > 0;
|
|
@@ -12118,7 +12275,7 @@ function parseBlocks(context, input, parent, document = false, inheritedInterrup
|
|
|
12118
12275
|
if (tree.last[item])
|
|
12119
12276
|
tree.end[item] = Math.max(tree.end[item], tree.end[tree.last[item]]);
|
|
12120
12277
|
if (sibling2 && tree.last[item] && (tree.end[tree.last[item]] === input[j2].start || tree.end[tree.last[item]] === input[j2 - 1].next))
|
|
12121
|
-
tree.end[item] = nextMark.
|
|
12278
|
+
tree.end[item] = nextMark.prefix;
|
|
12122
12279
|
if (closeFootnoteItem(context, input, j2, lastContent, item, list, sibling2 ? nextMark : void 0, boundary)) {
|
|
12123
12280
|
if (!sibling2)
|
|
12124
12281
|
break;
|
|
@@ -12138,6 +12295,9 @@ function parseBlocks(context, input, parent, document = false, inheritedInterrup
|
|
|
12138
12295
|
else if (tree.end[item] > input[lastContent].end)
|
|
12139
12296
|
tree.end[item] = tree.end[list];
|
|
12140
12297
|
}
|
|
12298
|
+
const exit = input[j2] ?? boundary;
|
|
12299
|
+
if (!sibling2 && exit && exit !== siblingLine && tree.end[item] > input[j2 - 1].end && exit.start > tree.end[list])
|
|
12300
|
+
tree.end[list] = tree.end[item] = exit.start;
|
|
12141
12301
|
if (!sibling2)
|
|
12142
12302
|
break;
|
|
12143
12303
|
}
|
|
@@ -13067,7 +13227,7 @@ function mdxHooks(source, syntax) {
|
|
|
13067
13227
|
hasImports: () => imports.length > 0,
|
|
13068
13228
|
// micromark tries a flow tag or expression on every paragraph continuation line, so its
|
|
13069
13229
|
// scan fails on the first lazy line it reads. Raw source probes cannot see laziness, and
|
|
13070
|
-
// read across container prefixes, so
|
|
13230
|
+
// read across container prefixes, so lines inside containers decide here instead.
|
|
13071
13231
|
continuation(context, input, at3, boundary) {
|
|
13072
13232
|
const line = input[at3];
|
|
13073
13233
|
let begin = line.start;
|
|
@@ -13082,6 +13242,10 @@ function mdxHooks(source, syntax) {
|
|
|
13082
13242
|
throw scanned.error;
|
|
13083
13243
|
return scanned.complete;
|
|
13084
13244
|
}
|
|
13245
|
+
if (view !== rawView) {
|
|
13246
|
+
const scanned = flowLine(view, starts[at3] + begin - line.start);
|
|
13247
|
+
return !!scanned.error || scanned.complete;
|
|
13248
|
+
}
|
|
13085
13249
|
},
|
|
13086
13250
|
interrupt(line) {
|
|
13087
13251
|
let i = line.start;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mintlify/cli",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.1785",
|
|
4
4
|
"description": "The Mintlify CLI",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=18.0.0"
|
|
@@ -45,12 +45,12 @@
|
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@inquirer/prompts": "7.9.0",
|
|
48
|
-
"@mintlify/common": "1.0.
|
|
49
|
-
"@mintlify/link-rot": "3.0.
|
|
48
|
+
"@mintlify/common": "1.0.1333",
|
|
49
|
+
"@mintlify/link-rot": "3.0.1571",
|
|
50
50
|
"@mintlify/models": "0.0.384",
|
|
51
|
-
"@mintlify/og": "0.0.
|
|
52
|
-
"@mintlify/prebuild": "1.0.
|
|
53
|
-
"@mintlify/previewing": "4.0.
|
|
51
|
+
"@mintlify/og": "0.0.132",
|
|
52
|
+
"@mintlify/prebuild": "1.0.1505",
|
|
53
|
+
"@mintlify/previewing": "4.0.1589",
|
|
54
54
|
"@mintlify/validation": "0.1.955",
|
|
55
55
|
"adm-zip": "0.6.0",
|
|
56
56
|
"chalk": "5.2.0",
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"keytar": "7.9.0"
|
|
88
88
|
},
|
|
89
89
|
"devDependencies": {
|
|
90
|
-
"@mintlify/editor": "0.0.
|
|
90
|
+
"@mintlify/editor": "0.0.610",
|
|
91
91
|
"@mintlify/ts-config": "2.0.2",
|
|
92
92
|
"@tsconfig/recommended": "1.0.2",
|
|
93
93
|
"@types/detect-port": "1.3.2",
|
|
@@ -106,5 +106,5 @@
|
|
|
106
106
|
"vitest": "2.1.9",
|
|
107
107
|
"vitest-mock-process": "1.0.4"
|
|
108
108
|
},
|
|
109
|
-
"gitHead": "
|
|
109
|
+
"gitHead": "d897cd3ba1570e5462b61c38d16d858e3b6b9ba6"
|
|
110
110
|
}
|