Skip to content

Commit

Permalink
Avoid escaping reserved characters when formatting URL
Browse files Browse the repository at this point in the history
  • Loading branch information
candela97 committed Sep 26, 2024
1 parent 2904565 commit f1a7070
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/js/Core/Html/Html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default class HTML {
static formatUrl(link: string): string {
const protocolReg = /^[a-z]+:\/\//;
const _link = protocolReg.test(link) ? link : `//${link}`;
return this.escape(_link);
return encodeURI(_link);
}

static escape(str: string): string {
Expand Down

0 comments on commit f1a7070

Please sign in to comment.