@mintlify/cli 4.0.1455 → 4.0.1457
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/vendor/converter.js +27 -7
- package/package.json +3 -3
package/bin/vendor/converter.js
CHANGED
|
@@ -1605,7 +1605,7 @@ function handleFlowJsxInner(node, ctx, transformNode2, mapJsxChildren2) {
|
|
|
1605
1605
|
content: mapJsxChildren2(node, ctx)
|
|
1606
1606
|
};
|
|
1607
1607
|
}
|
|
1608
|
-
if (node.name === "table") {
|
|
1608
|
+
if (node.name === "table" && !hasSpannedCell(node) && !hasTableClass(node)) {
|
|
1609
1609
|
return handleHtmlTable(node, ctx, transformNode2, mapJsxChildren2);
|
|
1610
1610
|
}
|
|
1611
1611
|
if (HTML_ELEMENTS.has(node.name)) {
|
|
@@ -1840,6 +1840,17 @@ function handleTree(node) {
|
|
|
1840
1840
|
attrs: Object.assign({ treeData: parseTreeChildren(node) }, extraTreeAttrs)
|
|
1841
1841
|
};
|
|
1842
1842
|
}
|
|
1843
|
+
var CELL_SPAN_ATTRS = /* @__PURE__ */ new Set(["colspan", "colSpan", "rowspan", "rowSpan"]);
|
|
1844
|
+
var TABLE_CLASS_ATTRS = /* @__PURE__ */ new Set(["class", "className"]);
|
|
1845
|
+
function hasTableClass(node) {
|
|
1846
|
+
return node.attributes.some((a) => a.type === "mdxJsxAttribute" && TABLE_CLASS_ATTRS.has(a.name));
|
|
1847
|
+
}
|
|
1848
|
+
function hasSpannedCell(node) {
|
|
1849
|
+
if (isTableCellJsxNode(node) && node.attributes.some((a) => a.type === "mdxJsxAttribute" && CELL_SPAN_ATTRS.has(a.name))) {
|
|
1850
|
+
return true;
|
|
1851
|
+
}
|
|
1852
|
+
return "children" in node && node.children.some((c) => hasSpannedCell(c));
|
|
1853
|
+
}
|
|
1843
1854
|
function handleHtmlTable(node, ctx, transformNode2, mapJsxChildren2) {
|
|
1844
1855
|
const rows = [];
|
|
1845
1856
|
for (const child of node.children) {
|
|
@@ -2676,7 +2687,8 @@ function convertInlineContent(children, parentMarks, ctx) {
|
|
|
2676
2687
|
} else {
|
|
2677
2688
|
const converted = transformNode(child, ctx);
|
|
2678
2689
|
const arr = Array.isArray(converted) ? converted : [converted];
|
|
2679
|
-
|
|
2690
|
+
const withMarks = child.type === "mdxTextExpression" && parentMarks.length > 0 ? arr.map((n) => Object.assign(Object.assign({}, n), { marks: parentMarks })) : arr;
|
|
2691
|
+
results.push(...withMarks);
|
|
2680
2692
|
}
|
|
2681
2693
|
}
|
|
2682
2694
|
return results;
|
|
@@ -10875,6 +10887,11 @@ var FLANKING_DELIMITER_MARKS = ["bold", "italic", "strike"];
|
|
|
10875
10887
|
function usesFlanking(mark) {
|
|
10876
10888
|
return FLANKING_DELIMITER_MARKS.includes(mark.type.name);
|
|
10877
10889
|
}
|
|
10890
|
+
var MARK_PRESERVING_INLINE = /* @__PURE__ */ new Set([
|
|
10891
|
+
"text",
|
|
10892
|
+
BLOCK_TYPES.inlineImage,
|
|
10893
|
+
BLOCK_TYPES.inlineUnknownTag
|
|
10894
|
+
]);
|
|
10878
10895
|
function reorderMarksForLink(marks2, parent, childIndex) {
|
|
10879
10896
|
if (marks2.length < 2)
|
|
10880
10897
|
return marks2;
|
|
@@ -10884,12 +10901,12 @@ function reorderMarksForLink(marks2, parent, childIndex) {
|
|
|
10884
10901
|
let linkEndIndex = childIndex;
|
|
10885
10902
|
for (let i = childIndex + 1; i < parent.childCount; i++) {
|
|
10886
10903
|
const sibling = parent.child(i);
|
|
10887
|
-
if (sibling.type.name
|
|
10904
|
+
if (!MARK_PRESERVING_INLINE.has(sibling.type.name) || !sibling.marks.some((m) => m.eq(linkMark)))
|
|
10888
10905
|
break;
|
|
10889
10906
|
linkEndIndex = i;
|
|
10890
10907
|
}
|
|
10891
10908
|
const nextAfterLink = linkEndIndex + 1 < parent.childCount ? parent.child(linkEndIndex + 1) : null;
|
|
10892
|
-
const nextMarks =
|
|
10909
|
+
const nextMarks = nextAfterLink && MARK_PRESERVING_INLINE.has(nextAfterLink.type.name) ? nextAfterLink.marks : [];
|
|
10893
10910
|
const otherMarks = marks2.filter((m) => !m.eq(linkMark));
|
|
10894
10911
|
const anyFormattingContinues = otherMarks.some((m) => nextMarks.some((nm) => nm.eq(m)));
|
|
10895
10912
|
if (anyFormattingContinues)
|
|
@@ -10985,10 +11002,15 @@ function renderInline(state, node, renderNode2, inlineRenderers2) {
|
|
|
10985
11002
|
}
|
|
10986
11003
|
} else {
|
|
10987
11004
|
if (typeName === BLOCK_TYPES.inlineImage) {
|
|
10988
|
-
transitionMarks(child.marks);
|
|
11005
|
+
transitionMarks(reorderMarksForLink(child.marks, node, i));
|
|
10989
11006
|
inlineRenderers2.renderInlineImage(state, child);
|
|
10990
11007
|
continue;
|
|
10991
11008
|
}
|
|
11009
|
+
if (typeName === BLOCK_TYPES.inlineUnknownTag) {
|
|
11010
|
+
transitionMarks(reorderMarksForLink(child.marks, node, i));
|
|
11011
|
+
inlineRenderers2.renderUnknownTag(state, child);
|
|
11012
|
+
continue;
|
|
11013
|
+
}
|
|
10992
11014
|
transitionMarks([]);
|
|
10993
11015
|
if (typeName === "hardBreak") {
|
|
10994
11016
|
state.write("<br />");
|
|
@@ -11002,8 +11024,6 @@ function renderInline(state, node, renderNode2, inlineRenderers2) {
|
|
|
11002
11024
|
if (child.attrs.expression) {
|
|
11003
11025
|
state.write(`$$${child.attrs.expression}$$`);
|
|
11004
11026
|
}
|
|
11005
|
-
} else if (typeName === BLOCK_TYPES.inlineUnknownTag) {
|
|
11006
|
-
inlineRenderers2.renderUnknownTag(state, child);
|
|
11007
11027
|
} else {
|
|
11008
11028
|
renderNode2(state, child, node, 0);
|
|
11009
11029
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mintlify/cli",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.1457",
|
|
4
4
|
"description": "The Mintlify CLI",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=18.0.0"
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"keytar": "7.9.0"
|
|
87
87
|
},
|
|
88
88
|
"devDependencies": {
|
|
89
|
-
"@mintlify/editor": "0.0.
|
|
89
|
+
"@mintlify/editor": "0.0.347",
|
|
90
90
|
"@mintlify/ts-config": "2.0.2",
|
|
91
91
|
"@tsconfig/recommended": "1.0.2",
|
|
92
92
|
"@types/detect-port": "1.3.2",
|
|
@@ -105,5 +105,5 @@
|
|
|
105
105
|
"vitest": "2.1.9",
|
|
106
106
|
"vitest-mock-process": "1.0.4"
|
|
107
107
|
},
|
|
108
|
-
"gitHead": "
|
|
108
|
+
"gitHead": "299b232ba90dfbf18ad63091485467c3d53f4dbb"
|
|
109
109
|
}
|