From 3286e1633258df52a58c09baf8cc8ebc9cda6109 Mon Sep 17 00:00:00 2001 From: sienori Date: Mon, 25 Jun 2018 18:48:33 +0900 Subject: [PATCH] Trim translation source text --- simple-translate/translate.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/simple-translate/translate.js b/simple-translate/translate.js index f86400a..3ef3769 100644 --- a/simple-translate/translate.js +++ b/simple-translate/translate.js @@ -13,7 +13,7 @@ class Translate { translate(sourceWord, sourceLang = 'auto', targetLang) { //改行で分割 - const sourceLines = sourceWord.split("\n"); + const sourceLines = sourceWord.trim().split("\n"); let promises = []; for (let sourceLine of sourceLines) {