Replace newlines with spaces in JavaScript strings.

This commit is contained in:
Nolan Darilek 2020-04-05 10:15:35 -05:00
parent 8a16c3aec1
commit 2bb87b6312

2
TTS.gd
View File

@ -52,7 +52,7 @@ func speak(text, interrupt := true):
var code = """
let utterance = new SpeechSynthesisUtterance("%s")
utterance.rate = %s
""" % [text, scaled_rate]
""" % [text.replace("\n", " "), scaled_rate]
if interrupt:
code += """
window.speechSynthesis.cancel()