@verbaly/compiler 0.60.0 → 0.62.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.
package/dist/cli.js CHANGED
@@ -2686,7 +2686,7 @@ function renderHtml(html, options) {
2686
2686
  const key = attrs.get(attr);
2687
2687
  const attrMapRaw = attrs.get(attrsAttr);
2688
2688
  if (key === void 0 && attrMapRaw === void 0) continue;
2689
- const args = parseArgs$1(attrs.get(argsAttr));
2689
+ const args = parseArgs$1(attrs.get(argsAttr), argsAttr);
2690
2690
  if (key) {
2691
2691
  if (!v.has(key)) missing.add(key);
2692
2692
  else if (!VOID.has(tagName) && !attrChunk.trimEnd().endsWith("/")) {
@@ -2694,7 +2694,7 @@ function renderHtml(html, options) {
2694
2694
  const close = findClose(html, tagName, openEnd, inSkip);
2695
2695
  if (close) {
2696
2696
  const text = t(key, args);
2697
- const own = parseArgs$1(attrs.get(linksAttr));
2697
+ const own = parseArgs$1(attrs.get(linksAttr), linksAttr);
2698
2698
  const merged = own ? globalLinks ? {
2699
2699
  ...globalLinks,
2700
2700
  ...own
@@ -2715,7 +2715,7 @@ function renderHtml(html, options) {
2715
2715
  }
2716
2716
  }
2717
2717
  if (attrMapRaw !== void 0) {
2718
- const map = parseArgs$1(attrMapRaw);
2718
+ const map = parseArgs$1(attrMapRaw, attrsAttr);
2719
2719
  if (map) for (const [name, attrKey] of Object.entries(map)) {
2720
2720
  if (typeof attrKey !== "string") continue;
2721
2721
  if (!v.has(attrKey)) {
@@ -2980,12 +2980,12 @@ function parseAttrs(chunk) {
2980
2980
  while ((m = ATTR.exec(chunk)) !== null) attrs.set(m[1].toLowerCase(), m[2] ?? m[3] ?? m[4] ?? "");
2981
2981
  return attrs;
2982
2982
  }
2983
- function parseArgs$1(raw) {
2983
+ function parseArgs$1(raw, attribute) {
2984
2984
  if (!raw) return void 0;
2985
2985
  try {
2986
2986
  return JSON.parse(decodeEntities(raw));
2987
2987
  } catch {
2988
- console.warn(`[verbaly] invalid args JSON: ${raw}`);
2988
+ warnOnce(`invalid JSON in ${attribute}: ${raw}`, `${attribute}:${raw}`);
2989
2989
  return;
2990
2990
  }
2991
2991
  }