@mintlify/cli 4.0.1490 → 4.0.1492

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.
@@ -11009,7 +11009,8 @@ function renderTitledComponent(state, node, name, renderContent2, renderInline2,
11009
11009
  title = titleState.out;
11010
11010
  } else {
11011
11011
  const plainTitle = getTextContent(titleChild);
11012
- title = titleMarkdownToText(plainTitle) === plainTitle ? plainTitle : plainTitle.replace(titleMarkdownSpecialCharacters, "\\$&");
11012
+ const escapedTitle = plainTitle.replace(titleMarkdownSpecialCharacters, "\\$&");
11013
+ title = escapedTitle === plainTitle || titleMarkdownToText(plainTitle) === plainTitle ? plainTitle : escapedTitle;
11013
11014
  }
11014
11015
  }
11015
11016
  const titleAttribute = isJSXContent(title) ? title.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;") : title;
@@ -11768,7 +11769,7 @@ function hasReferenceDefinitions(doc) {
11768
11769
  return found;
11769
11770
  }
11770
11771
  function pmToMdx(doc, options = {}) {
11771
- return serializeDoc(doc, options, null).mdx;
11772
+ return drainSerialization(serializeDoc(doc, options, null)).mdx;
11772
11773
  }
11773
11774
  function serializeNodeWithDelim(node, options, delim) {
11774
11775
  const state = new SerializerState(options);
@@ -11776,7 +11777,13 @@ function serializeNodeWithDelim(node, options, delim) {
11776
11777
  renderNode(state, node, node, 0);
11777
11778
  return state.out.replace(/(\n[ \t]*)+$/, "");
11778
11779
  }
11779
- function serializeDoc(doc, options, sourceMap) {
11780
+ function drainSerialization(steps) {
11781
+ let step = steps.next();
11782
+ while (!step.done)
11783
+ step = steps.next();
11784
+ return step.value;
11785
+ }
11786
+ function* serializeDoc(doc, options, sourceMap) {
11780
11787
  var _a;
11781
11788
  const { frontmatter } = options, serializerOptions = __rest2(options, ["frontmatter"]);
11782
11789
  const state = new SerializerState(Object.assign(Object.assign({}, serializerOptions), { hasReferenceDefinitions: (_a = serializerOptions.hasReferenceDefinitions) !== null && _a !== void 0 ? _a : hasReferenceDefinitions(doc) }));
@@ -11792,26 +11799,34 @@ function serializeDoc(doc, options, sourceMap) {
11792
11799
  state.write("---\n\n");
11793
11800
  }
11794
11801
  }
11795
- renderContent(state, doc);
11802
+ for (let i = 0; i < doc.childCount; i++) {
11803
+ renderChild(state, doc, i);
11804
+ yield i + 1;
11805
+ }
11796
11806
  let result = state.out;
11797
11807
  if (options.removeTrailingNewline !== false && result.endsWith("\n")) {
11798
11808
  result = result.replace(/\n+$/, "");
11799
11809
  }
11810
+ for (const entry of sourceMap !== null && sourceMap !== void 0 ? sourceMap : []) {
11811
+ entry.end = Math.min(entry.end, result.length);
11812
+ entry.start = Math.min(entry.start, entry.end);
11813
+ }
11800
11814
  return { mdx: result, sourceMap: sourceMap !== null && sourceMap !== void 0 ? sourceMap : [] };
11801
11815
  }
11802
11816
  function renderContent(state, node) {
11803
- for (let i = 0; i < node.childCount; i++) {
11804
- const child = node.child(i);
11805
- if (i > 0) {
11817
+ for (let i = 0; i < node.childCount; i++)
11818
+ renderChild(state, node, i);
11819
+ }
11820
+ function renderChild(state, node, index) {
11821
+ const child = node.child(index);
11822
+ if (index > 0) {
11823
+ state.ensureNewLine();
11824
+ if (needsBlankLine(node.child(index - 1), child))
11806
11825
  state.ensureNewLine();
11807
- if (needsBlankLine(node.child(i - 1), child)) {
11808
- state.ensureNewLine();
11809
- }
11810
- }
11811
- const start = state.beginBlock(i);
11812
- renderNode(state, child, node, i);
11813
- state.endBlock(start);
11814
11826
  }
11827
+ const start = state.beginBlock(index);
11828
+ renderNode(state, child, node, index);
11829
+ state.endBlock(start);
11815
11830
  }
11816
11831
  function needsBlankLine(prev, current) {
11817
11832
  return BLOCK_LINE_TYPES.has(prev.type.name) || BLOCK_LINE_TYPES.has(current.type.name);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mintlify/cli",
3
- "version": "4.0.1490",
3
+ "version": "4.0.1492",
4
4
  "description": "The Mintlify CLI",
5
5
  "engines": {
6
6
  "node": ">=18.0.0"
@@ -45,11 +45,11 @@
45
45
  },
46
46
  "dependencies": {
47
47
  "@inquirer/prompts": "7.9.0",
48
- "@mintlify/common": "1.0.1141",
49
- "@mintlify/link-rot": "3.0.1343",
48
+ "@mintlify/common": "1.0.1142",
49
+ "@mintlify/link-rot": "3.0.1344",
50
50
  "@mintlify/models": "0.0.355",
51
- "@mintlify/prebuild": "1.0.1295",
52
- "@mintlify/previewing": "4.0.1367",
51
+ "@mintlify/prebuild": "1.0.1296",
52
+ "@mintlify/previewing": "4.0.1368",
53
53
  "@mintlify/validation": "0.1.852",
54
54
  "adm-zip": "0.6.0",
55
55
  "chalk": "5.2.0",
@@ -86,7 +86,7 @@
86
86
  "keytar": "7.9.0"
87
87
  },
88
88
  "devDependencies": {
89
- "@mintlify/editor": "0.0.374",
89
+ "@mintlify/editor": "0.0.376",
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": "5249b7a4102028cb80b59c854377d880c2f0e416"
108
+ "gitHead": "a412c935f02b2e73c85740079e60f4b064a1bb3b"
109
109
  }