Skip to content

Commit

Permalink
feat: allow single quote ID wrapper (#2580)
Browse files Browse the repository at this point in the history
# 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
  • Loading branch information
jakex7 authored Dec 17, 2024
1 parent 490d09e commit b4fa586
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
Expand Down

0 comments on commit b4fa586

Please sign in to comment.