Skip to content

Commit 46b1ead

Browse files
Merge pull request #3 from Seralahthan/main
Implement RFC3986 compatible encodeURIComponent
2 parents 174fadf + dfe3dc9 commit 46b1ead

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

js/scripts.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,10 @@ function jwtDecode(){
6161
}
6262

6363
function urlEncode(){
64-
get('preUrlOutputCode').innerText = encodeURIComponent(get('textAreaUrlInput').value);
64+
get('preUrlOutputCode').innerText = encodeURIComponent(get('textAreaUrlInput').value).replace(
65+
/[!'()*]/g,
66+
(c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`
67+
);
6568
}
6669

6770
function urlDecode(){

0 commit comments

Comments
 (0)