Skip to content

Commit

Permalink
fix: endlines not being preserved with lingva-translate (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fevol committed Aug 1, 2023
1 parent d064f1b commit 1cefa98
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/handlers/lingva-translate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export class LingvaTranslate extends DummyTranslate {
async service_translate(text: string, from: string, to: string, options: ServiceOptions = {}): Promise<TranslationResult> {
const response = await requestUrl({
throw: false,
url: `https://${this.#host}/api/v1/${from}/${to}/${text}`
url: `https://${this.#host}/api/v1/${from}/${to}/${encodeURIComponent(text)}`
});

// Data = {"translation": "...", "info": {
Expand Down

0 comments on commit 1cefa98

Please sign in to comment.