encode all unsafe characters in post text for translate URL (#1345)
This commit is contained in:
@@ -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,
|
||||||
|
)}`
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user