From 1d48b70c89f8c2a65c71715e61382d568b55ee37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kevin=20Doncam=20Demian=20L=C3=B3pez=20Brante?= Date: Wed, 13 Jan 2021 06:29:05 +0000 Subject: [PATCH] Added line wrappings --- api/espeak.js | 7 +++---- pages/index.vue | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/api/espeak.js b/api/espeak.js index 6003550..621dada 100644 --- a/api/espeak.js +++ b/api/espeak.js @@ -11,13 +11,12 @@ app.post('/get', (req, res, next) => { tmp.file(function _tempFileCreated(err, path, fd, cleanupCallback) { if (err) throw err; - fs.writeFile(path, req.body.sourceText, {encoding: "utf-8"}, ()=> { + fs.writeFile(path, req.body.sourceText.replace(/\n/gi,",\n"), {encoding: "utf-8"}, ()=> { exec(`${eSpeakExecutable} -v"${req.body.selectedLanguage}" -q -f "${path}" --ipa`, ((error, stdout, stderr) => { - res.json({out: stdout.trim(), stderr}) + res.json({out: stdout, stderr}) + cleanupCallback() })) }) - - cleanupCallback() }); }) diff --git a/pages/index.vue b/pages/index.vue index 8c11d27..e2303fd 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -17,7 +17,7 @@

IPA output

-
{{targetText.out}}
+
{{targetText.out}}