Flagpack.Helpers (Flagpack v0.6.0)

View Source

Summary

Functions

Finds a country by its alpha2 or alpha3 code.

Finds all id attributes in an SVG and adds an @id suffix to ensure that multiple instances of the same flag can be rendered on a page without ID conflicts. It also updates all references to those IDs (in mask, fill, and filter attributes).

Functions

country_name_by_alpha(alpha)

Finds a country by its alpha2 or alpha3 code.

templatize_ids(svg_string)

Finds all id attributes in an SVG and adds an @id suffix to ensure that multiple instances of the same flag can be rendered on a page without ID conflicts. It also updates all references to those IDs (in mask, fill, and filter attributes).