Fix text-to-speech bug - closes #5094

pull/5119/head
Samuel 2019-05-19 13:44:40 +01:00
parent f5a0116a8c
commit 1fd7d75353
1 changed files with 3 additions and 2 deletions

View File

@ -23,7 +23,8 @@ function renderSan(san: San) {
function hackFix(msg: string): string {
return msg
.replace(/^A /, "A, "); // "A takes" & "A 3" are mispronounced
.replace(/^A /, "A, ") // "A takes" & "A 3" are mispronounced
.replace(/(\d) E (\d)/, "$1,E $2"); // Strings such as 1E5 are treated as scientific notation
}
export function say(text: string, cut: boolean) {
@ -32,6 +33,6 @@ export function say(text: string, cut: boolean) {
window.lichess.sound.say(msg);
}
export function step(s: { san?: San}, cut: boolean) {
export function step(s: { san?: San }, cut: boolean) {
say(s.san ? renderSan(s.san) : 'Game start', cut);
}