@dicebear/core 10.6.0 → 10.6.1

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.
Files changed (2) hide show
  1. package/lib/Renderer.js +9 -0
  2. package/package.json +1 -1
package/lib/Renderer.js CHANGED
@@ -181,6 +181,15 @@ _Renderer_style = new WeakMap(), _Renderer_resolver = new WeakMap(), _Renderer_d
181
181
  const attrs = __classPrivateFieldGet(this, _Renderer_instances, "m", _Renderer_renderAttributes).call(this, element.attributes());
182
182
  const children = __classPrivateFieldGet(this, _Renderer_instances, "m", _Renderer_renderElements).call(this, element.children());
183
183
  if (children.length === 0) {
184
+ // A wrapper whose children all rendered to nothing, because an optional
185
+ // component came up empty, has no content left to group. It draws
186
+ // nothing either way, but a masked group without content has an empty
187
+ // bounding box, and strict SVG parsers reject the whole document over
188
+ // it. Wrappers that carry an id stay, so references keep resolving.
189
+ if (element.children().length > 0 &&
190
+ element.attributes()?.id === undefined) {
191
+ return '';
192
+ }
184
193
  return `<${name}${attrs}/>`;
185
194
  }
186
195
  return `<${name}${attrs}>${children}</${name}>`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dicebear/core",
3
- "version": "10.6.0",
3
+ "version": "10.6.1",
4
4
  "description": "Unique avatars from dozens of styles — deterministic, customizable, vector-based.",
5
5
  "keywords": [
6
6
  "avatar",