@diagrammo/dgmo 0.8.14 → 0.8.15

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diagrammo/dgmo",
3
- "version": "0.8.14",
3
+ "version": "0.8.15",
4
4
  "description": "DGMO diagram markup language — parser, renderer, and color system",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -200,7 +200,8 @@ function parseArrowToken(token: string, palette?: PaletteColors): ArrowInfo {
200
200
  ? (resolveColor(m[2].trim(), palette) ?? undefined)
201
201
  : undefined;
202
202
  if (label && !color) {
203
- color = inferArrowColor(label);
203
+ const inferred = inferArrowColor(label);
204
+ if (inferred) color = resolveColor(inferred, palette) ?? undefined;
204
205
  }
205
206
  return { label, color };
206
207
  }
@@ -72,7 +72,8 @@ function parseArrowLine(
72
72
  ? (resolveColor(arrowMatch[2].trim(), palette) ?? undefined)
73
73
  : undefined;
74
74
  if (label && !color) {
75
- color = inferArrowColor(label);
75
+ const inferred = inferArrowColor(label);
76
+ if (inferred) color = resolveColor(inferred, palette) ?? undefined;
76
77
  }
77
78
  const rawTarget = arrowMatch[3].trim();
78
79
  const groupMatch = rawTarget.match(/^\[(.+)\]$/);