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:
Jakub Grzywacz
2024-12-17 10:58:14 +01:00
committed by GitHub
parent 490d09e229
commit b4fa586ab8

View File

@@ -13,7 +13,7 @@ export function pickNotNil(object: { [prop: string]: unknown }) {
return result; return result;
} }
export const idPattern = /#([^)]+)\)?$/; export const idPattern = /#([^)]+)'?\)?$/;
export const getRandomNumber = () => export const getRandomNumber = () =>
Math.floor(Math.random() * Math.floor(Math.random() * Date.now())); Math.floor(Math.random() * Math.floor(Math.random() * Date.now()));