lucide/packages/shared/tests
Saadanjum0 e8a2c60b75
fix(shared): escape attribute values in buildLucideSvg (#4940)
* fix(shared): escape attribute values in buildLucideSvg

Attribute values were interpolated into the SVG string as-is, so a value
containing a double quote, ampersand or angle bracket (for example in a
custom attribute or class name) produced malformed markup.

* Use replace(/x/g) instead of replaceAll for broader TS lib compat

lucide-react-native's tsconfig doesn't include the ES2021 lib that
replaceAll requires, failing typecheck. A global regex replace is
functionally identical here and works under any target.

* Escape the full set of relevant HTML entities in attribute values

Also escape > and ' per review feedback, not just & " <.

* Apply suggestion from @karsa-mistmere

---------

Co-authored-by: Karsa <contact@karsa.org>
2026-10-02 09:41:22 +02:00
..
buildLucideIconForReact.spec.ts test(packages/shared): cover buildLucideIconForReact (#4872) 2026-09-18 14:08:40 +02:00
buildLucideSvg.spec.ts fix(shared): escape attribute values in buildLucideSvg (#4940) 2026-10-02 09:41:22 +02:00
hasA11yProp.spec.ts feat(packages): Added aria-hidden fallback for decorative icons to all packages (#3604) 2026-01-20 15:55:02 +01:00
isEmptyString.spec.ts feat(packages): Added aria-hidden fallback for decorative icons to all packages (#3604) 2026-01-20 15:55:02 +01:00
mergeClasses.spec.ts feat(packages): Added aria-hidden fallback for decorative icons to all packages (#3604) 2026-01-20 15:55:02 +01:00
toCamelCase.spec.ts feat(packages): Added aria-hidden fallback for decorative icons to all packages (#3604) 2026-01-20 15:55:02 +01:00
toKebabCase.spec.ts feat(packages): Added aria-hidden fallback for decorative icons to all packages (#3604) 2026-01-20 15:55:02 +01:00
toLucideIconData.spec.ts chore(typchecking): More typecheck jobs for all packages (#4885) 2026-09-22 13:49:09 +02:00
toPascalCase.spec.ts feat(packages): Added aria-hidden fallback for decorative icons to all packages (#3604) 2026-01-20 15:55:02 +01:00