mirror of
https://github.com/zoriya/react-native-svg.git
synced 2025-12-05 22:56:11 +00:00
feat: allow single quote ID wrapper (#2580)
# Summary
The SVG specification does not strictly standardize linking, and most
browsers permit the use of `'` as a wrapper in `url` links. As a result,
I've added support for URLs such as `url('#id')`.
## Test Plan
`url(#id)` and `url('#id')` should do the exact same thing.
Closes #1768
This commit is contained in:
@@ -13,7 +13,7 @@ export function pickNotNil(object: { [prop: string]: unknown }) {
|
||||
return result;
|
||||
}
|
||||
|
||||
export const idPattern = /#([^)]+)\)?$/;
|
||||
export const idPattern = /#([^)]+)'?\)?$/;
|
||||
|
||||
export const getRandomNumber = () =>
|
||||
Math.floor(Math.random() * Math.floor(Math.random() * Date.now()));
|
||||
|
||||
Reference in New Issue
Block a user