@mintlify/cli 4.0.1728 → 4.0.1729

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.
@@ -14019,18 +14019,17 @@ import { unified } from "unified";
14019
14019
 
14020
14020
  // ../editor/dist/converter/utils/jsx-content.js
14021
14021
  function isJSXContent(str) {
14022
- var _a;
14023
14022
  if (!str || !str.startsWith("<") || !str.endsWith(">")) {
14024
14023
  return false;
14025
14024
  }
14026
- const openingTag = (_a = str.match(/<([^\s>]+)/)) === null || _a === void 0 ? void 0 : _a[1];
14027
- if (!openingTag)
14025
+ try {
14026
+ const expression = createExpressionParser(str).parseExpressionAt(str, 0, {
14027
+ sourceType: "module"
14028
+ });
14029
+ return expression.type === "JSXElement" && expression.end === str.length;
14030
+ } catch (_a) {
14028
14031
  return false;
14029
- if (str.match(/<[^>]*\/\s*>$/)) {
14030
- return true;
14031
14032
  }
14032
- const closingTagRegex = new RegExp(`</${openingTag}\\s*>$`);
14033
- return closingTagRegex.test(str);
14034
14033
  }
14035
14034
 
14036
14035
  // ../editor/dist/converter/serialize/serialize-utils.js
@@ -14051,7 +14050,7 @@ function serializePropValue(v) {
14051
14050
  if (isJSXContent(v)) {
14052
14051
  return `{${v}}`;
14053
14052
  }
14054
- if (v.includes('"') && v.includes("'")) {
14053
+ if (v.includes("&") || v.includes('"') && v.includes("'")) {
14055
14054
  return `{${JSON.stringify(v)}}`;
14056
14055
  }
14057
14056
  if (v.includes('"')) {
@@ -14124,12 +14123,13 @@ function getNamedExpressionAttr(attrs2, key) {
14124
14123
 
14125
14124
  // ../editor/dist/converter/serialize/serializer-state.js
14126
14125
  var ALWAYS_ESCAPED = /* @__PURE__ */ new Set(["\\", "`", "*", "{", "}", "<", "$"]);
14127
- var CONTEXT_ESCAPED = /* @__PURE__ */ new Set(["|", "_", "[", "]", ">", "+"]);
14126
+ var CONTEXT_ESCAPED = /* @__PURE__ */ new Set(["|", "_", "[", "]", ">", "+", "&"]);
14128
14127
  var ESCAPABLE_CHAR = new RegExp(`[${[...ALWAYS_ESCAPED, ...CONTEXT_ESCAPED].map((ch) => `\\${ch}`).join("")}]`);
14129
14128
  var WORD_CHAR = /[\p{L}\p{N}]/u;
14130
14129
  var TASK_MARKER = /^\[[ xX]\]/;
14131
14130
  var LINK_CLOSE = /\][([]/;
14132
14131
  var DEFINITION_CLOSE = /\]:/;
14132
+ var ENTITY_REFERENCE = /^&(?:#[0-9]{1,7}|#x[0-9a-f]{1,6}|[a-z][a-z0-9]{1,31});/i;
14133
14133
  function isWordChar(ch) {
14134
14134
  return ch !== void 0 && WORD_CHAR.test(ch);
14135
14135
  }
@@ -14414,6 +14414,8 @@ var SerializerState = class {
14414
14414
  if (ALWAYS_ESCAPED.has(ch))
14415
14415
  return true;
14416
14416
  switch (ch) {
14417
+ case "&":
14418
+ return ENTITY_REFERENCE.test(str.slice(i));
14417
14419
  case "|":
14418
14420
  return this.escapesPipes;
14419
14421
  case "_":
@@ -14678,10 +14680,10 @@ function getMarkStrings(mark, emphasisMarker = "_") {
14678
14680
  }
14679
14681
  const href = mark.attrs.href || "";
14680
14682
  const title = mark.attrs.title;
14681
- const titleStr = title ? ` "${title}"` : "";
14683
+ const titleStr = title ? ` "${escapeAttributeValue(title)}"` : "";
14682
14684
  return {
14683
14685
  open: "[",
14684
- close: `](${href.replace(/[()]/g, "\\$&")}${titleStr})`
14686
+ close: `](${escapeAttributeValue(href).replace(/[()]/g, "\\$&")}${titleStr})`
14685
14687
  };
14686
14688
  }
14687
14689
  case "underline":
@@ -14808,10 +14810,10 @@ function writeImgTag(state, attrs2) {
14808
14810
  }
14809
14811
  function writeMarkdownImage(state, imgAttributes, src) {
14810
14812
  const alt = state.esc(String(imgAttributes["alt"] || ""), { inLinkText: true });
14811
- const escapedSrc = src.replace(/[()]/g, "\\$&");
14813
+ const escapedSrc = escapeAttributeValue(src).replace(/[()]/g, "\\$&");
14812
14814
  const title = imgAttributes["title"];
14813
14815
  if (typeof title === "string" && title) {
14814
- state.write(`![${alt}](${escapedSrc} "${title.replace(/"/g, '\\"')}")`);
14816
+ state.write(`![${alt}](${escapedSrc} "${escapeAttributeValue(title)}")`);
14815
14817
  } else {
14816
14818
  state.write(`![${alt}](${escapedSrc})`);
14817
14819
  }
@@ -15283,7 +15285,7 @@ var __rest = function(s, e) {
15283
15285
  }
15284
15286
  return t;
15285
15287
  };
15286
- var titleMarkdownSpecialCharacters = /[\\`*_[\]~]/g;
15288
+ var titleMarkdownSpecialCharacters = /[\\`*_[\]~&]/g;
15287
15289
  function hasInlineMarks(node) {
15288
15290
  for (let index = 0; index < node.childCount; index += 1) {
15289
15291
  if (node.child(index).marks.length > 0)
@@ -15408,7 +15410,7 @@ function renderBadge(state, node) {
15408
15410
  }).filter(Boolean).join(" ");
15409
15411
  const textContent = getTextContent(node);
15410
15412
  if (textContent) {
15411
- state.write(`<${BLOCK_TYPES.badge}${attrs2 ? ` ${attrs2}` : ""}>${textContent}</${BLOCK_TYPES.badge}>`);
15413
+ state.write(`<${BLOCK_TYPES.badge}${attrs2 ? ` ${attrs2}` : ""}>${state.esc(textContent)}</${BLOCK_TYPES.badge}>`);
15412
15414
  } else {
15413
15415
  state.write(`<${BLOCK_TYPES.badge}${attrs2 ? ` ${attrs2}` : ""} />`);
15414
15416
  }
@@ -15579,7 +15581,11 @@ function renderPromptBlock(state, node, renderContent2) {
15579
15581
  const rawChildren = codeBlockNode ? getTextContent(codeBlockNode) : "";
15580
15582
  const props = [];
15581
15583
  if (descriptionMd) {
15582
- if (descriptionMd.includes('"')) {
15584
+ if (descriptionMd.includes("&")) {
15585
+ const description = serializeLiteralJsxAttribute(node.attrs, "description", descriptionMd);
15586
+ if (description)
15587
+ props.push(description);
15588
+ } else if (descriptionMd.includes('"')) {
15583
15589
  const escaped = descriptionMd.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${");
15584
15590
  props.push(`description={\`${escaped}\`}`);
15585
15591
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mintlify/cli",
3
- "version": "4.0.1728",
3
+ "version": "4.0.1729",
4
4
  "description": "The Mintlify CLI",
5
5
  "engines": {
6
6
  "node": ">=18.0.0"
@@ -82,7 +82,7 @@
82
82
  "keytar": "7.9.0"
83
83
  },
84
84
  "devDependencies": {
85
- "@mintlify/editor": "0.0.573",
85
+ "@mintlify/editor": "0.0.574",
86
86
  "@mintlify/ts-config": "2.0.2",
87
87
  "@tsconfig/recommended": "1.0.2",
88
88
  "@types/detect-port": "1.3.2",
@@ -101,5 +101,5 @@
101
101
  "vitest": "2.1.9",
102
102
  "vitest-mock-process": "1.0.4"
103
103
  },
104
- "gitHead": "6fbe048c152c2966dd91279025b27edc2fcc3148"
104
+ "gitHead": "b9727763d90b1858af01529dd7ff10648278bda2"
105
105
  }