1
1
mirror of https://github.com/leon-ai/leon.git synced 2024-12-11 09:12:40 +03:00

refactor(server): replace HTML entities to whitespaces to respect TTS punctuations

This commit is contained in:
Louistiti 2019-06-08 15:33:07 +08:00
parent d91a62ea7e
commit 3e133ea88c

View File

@ -54,8 +54,8 @@ class Brain {
if (rawSpeech !== '') {
if (process.env.LEON_TTS === 'true') {
// Stripe HTML
const speech = rawSpeech.replace(/<(?:.|\n)*?>/gm, '')
// Stripe HTML to a whitespace. Whitespace to let the TTS respects punctuation
const speech = rawSpeech.replace(/<(?:.|\n)*?>/gm, ' ')
this.tts.add(speech)
}