@wix/himalaya-cli 0.1080.0 → 0.1082.0

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.
@@ -211,6 +211,7 @@ function encodeRichContent(doc, opts = {}) {
211
211
  }
212
212
  var TOO_DEEP = { reason: "too_deep" };
213
213
  var PATH_SHAPED = /^[0-9.]+$/;
214
+ var unusableId = (id) => PATH_SHAPED.test(id) || id.includes("/") || id.includes("$");
214
215
  var isWrapper = (t) => t === "COLLAPSIBLE_LIST" || t === "COLLAPSIBLE_ITEM" || t === "COLLAPSIBLE_ITEM_TITLE" || t === "COLLAPSIBLE_ITEM_BODY";
215
216
  var holdsBlocks = (t) => t === void 0 || t === "BULLETED_LIST" || t === "ORDERED_LIST" || t === "LIST_ITEM" || t === "BLOCKQUOTE" || isWrapper(t);
216
217
  var LINK_FIELDS = {
@@ -301,7 +302,7 @@ function cleanNode(node, path, depth, ctx, parentType) {
301
302
  const inBlocks = holdsBlocks(parentType);
302
303
  if (node.type !== "TEXT" || inBlocks) {
303
304
  const own = typeof node.id === "string" ? node.id : "";
304
- const usable = own !== "" && !PATH_SHAPED.test(own);
305
+ const usable = own !== "" && !unusableId(own);
305
306
  if (inBlocks && !isWrapper(node.type)) {
306
307
  if (usable && !ctx.ids.has(own)) ctx.ids.add(own);
307
308
  else node.id = path;