encode all unsafe characters in post text for translate URL (#1345)
parent
d2e65d2a7f
commit
ba393cd642
|
@ -80,5 +80,7 @@ export function isPostInLanguage(
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getTranslatorLink(text: string): string {
|
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,
|
||||||
|
)}`
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue