You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The IDs on the linearGradient and clipPath SVG elements are the same for every badge. This means the IDs are unique within any given SVG document, but if you embed multiple SVGs inline in a single HTML document then the IDs aren't unique within the HTML page.
This leads to this behaviour:
This is a fairly uncommon use-case and for shields.io itself it is useful that the IDs are single character. However, it would be useful for the makeBadge() function to expose a non-default option which allows the user to specify they want globally unique IDs.
We could do this without adding any additional dependency by using crypto.randomUUID() from the node standard library to generate the IDs:
Discussed in #10321
The IDs on the
linearGradient
andclipPath
SVG elements are the same for every badge. This means the IDs are unique within any given SVG document, but if you embed multiple SVGs inline in a single HTML document then the IDs aren't unique within the HTML page.This leads to this behaviour:
This is a fairly uncommon use-case and for shields.io itself it is useful that the IDs are single character. However, it would be useful for the
makeBadge()
function to expose a non-default option which allows the user to specify they want globally unique IDs.We could do this without adding any additional dependency by using
crypto.randomUUID()
from the node standard library to generate the IDs:The text was updated successfully, but these errors were encountered: