ampersands get escaped in URLS
See original GitHub issue renderHeadToString({
headTags: [
{
tag: 'script',
props: {
async: true,
hid: 'maps-googleapis',
src: 'https://maps.googleapis.com/maps/api/js?key=example&libraries=places',
},
},
],
}).headTags
results in:
<script async hid="maps-googleapis" src="https://maps.googleapis.com/maps/api/js?key=example&libraries=places"></script><meta name="head:count" content="1">
https://github.com/vueuse/head/blob/main/src/stringify-attrs.ts#L2-L32
https://github.com/vueuse/head/blob/main/src/index.ts#L347-L362
Here’s a reproduction.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:7
Top Results From Across the Web
Escaping ampersand in URL - Stack Overflow
The digits, preceded by a percent sign ("%") which is used as an escape character, are then used in the URI in place...
Read more >Escape Ampersand in URL in JavaScript - Java2Blog
In this post, we will see how to escape ampersand in JavaScript. To escape Ampersand in JavaScript, use encodeURIComponent() in JavaScript. ... As...
Read more >URL escape codes
Character URL Escape Codes String Literal Escape Code
SPACE %20 $20
< %3C $3C
> %3E $3E
Read more >Brief Introduction to URL Encoding - ThoughtCo
These encoded examples are different from what you find with HTML special characters. For example, to encode a URL with an ampersand ......
Read more >URL ampersand escape xdg-open command
I am trying to open a URL using the xdg-open command, but I have tried escaping the ampersand character to no avail; all...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@stafyniaksacha This is my local patch (using yarn’s
patch
/patch-commit
feature). You should be using the latest yarn to do this (yarn 3.2.3).Add this to your package.json:
Then create this file:
.yarn/patches/@vueuse-head-npm-0.7.9-ad2f8578c9.patch
Run
yarn
, and you should be good to go!It breaks any functionality of needing to pass parameters to JS libraries, which is how all of googles API’s work