Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: return shorter data url if possible #326

Merged
merged 2 commits into from
Aug 19, 2024
Merged

Conversation

hyrious
Copy link
Contributor

@hyrious hyrious commented Aug 16, 2024

Concern: the result of encodeSvgForCss() intentionally escapes " (double quote) because it is then be used in generating the CSS url("..."). That is to say, the ' (single quote) is not escaped.

There's a even more shorter algorithm which does not escace < and " ' in esbuild. The use case is to be assigned to img.src in JavaScript, like in React and Vue element props. I guess this is not a handy choice when I just want to copy and paste the url to CSS/HTML.

Copy link

netlify bot commented Aug 16, 2024

Deploy Preview for icones failed.

Name Link
🔨 Latest commit de76860
🔍 Latest deploy log https://app.netlify.com/sites/icones/deploys/66c3097c894d8200085673b3

@antfu antfu merged commit ed9d3c1 into antfu-collective:main Aug 19, 2024
3 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants