From 3dcc2229a50a0f485ee0de5caad307c46aa77161 Mon Sep 17 00:00:00 2001 From: sienori Date: Thu, 15 Nov 2018 21:24:18 +0900 Subject: [PATCH] Trim translation source text --- simple-translate/translate.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/simple-translate/translate.js b/simple-translate/translate.js index ae42b6a..8900bd2 100644 --- a/simple-translate/translate.js +++ b/simple-translate/translate.js @@ -11,6 +11,8 @@ class Translate { } async translate(sourceWord, sourceLang = "auto", targetLang) { + sourceWord = sourceWord.trim(); + const result = await this.sendRequest(sourceWord, sourceLang, targetLang); return this.formatResult(result); }