about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorEric Bailey <git@esb.lol>2023-08-31 18:39:18 -0500
committerGitHub <noreply@github.com>2023-08-31 16:39:18 -0700
commitba393cd6423bfa84b3b16e77ffea9d36a8b034d2 (patch)
tree9ec5980a9375820b6589cbae786cc659c8667236 /src
parentd2e65d2a7f411e9eb1a1ea8d97ea148c4832b430 (diff)
downloadvoidsky-ba393cd6423bfa84b3b16e77ffea9d36a8b034d2.tar.zst
encode all unsafe characters in post text for translate URL (#1345)
Diffstat (limited to 'src')
-rw-r--r--src/locale/helpers.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/locale/helpers.ts b/src/locale/helpers.ts
index 6e6e3f08c..3ada8ef0e 100644
--- a/src/locale/helpers.ts
+++ b/src/locale/helpers.ts
@@ -80,5 +80,7 @@ export function isPostInLanguage(
 }
 
 export function getTranslatorLink(text: string): string {
-  return encodeURI(`https://translate.google.com/?sl=auto&text=${text}`)
+  return `https://translate.google.com/?sl=auto&text=${encodeURIComponent(
+    text,
+  )}`
 }