Skip to content

Commit

Permalink
Merge pull request #3 from Seralahthan/main
Browse files Browse the repository at this point in the history
Implement RFC3986 compatible encodeURIComponent
  • Loading branch information
dineshjweerakkody authored Sep 11, 2024
2 parents 174fadf + dfe3dc9 commit 46b1ead
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion js/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ function jwtDecode(){
}

function urlEncode(){
get('preUrlOutputCode').innerText = encodeURIComponent(get('textAreaUrlInput').value);
get('preUrlOutputCode').innerText = encodeURIComponent(get('textAreaUrlInput').value).replace(
/[!'()*]/g,
(c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`
);
}

function urlDecode(){
Expand Down

0 comments on commit 46b1ead

Please sign in to comment.