Added line wrappings

main
Kevin López 2021-01-13 06:29:05 +00:00
parent 325c5e9751
commit 1d48b70c89
2 changed files with 4 additions and 5 deletions

View File

@ -11,13 +11,12 @@ app.post('/get', (req, res, next) => {
tmp.file(function _tempFileCreated(err, path, fd, cleanupCallback) { tmp.file(function _tempFileCreated(err, path, fd, cleanupCallback) {
if (err) throw err; 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) => { 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()
}); });
}) })

View File

@ -17,7 +17,7 @@
<b-col cols="12" md="6"> <b-col cols="12" md="6">
<h2>IPA output</h2> <h2>IPA output</h2>
<b-card> <b-card>
<pre class="text-wrap">{{targetText.out}}</pre> <pre style="white-space: pre-wrap;">{{targetText.out}}</pre>
</b-card> </b-card>
</b-col> </b-col>
</b-row> </b-row>