Moved the changes to hackFix().
Changes seemed to better fit in the hackFix function than where I originally put them. Also improved the comments I added to the code.pull/5359/head
parent
908a9efc7b
commit
5a1a32d0ae
|
@ -12,8 +12,7 @@ function renderSan(san: San) {
|
|||
if (c == '@') return 'at';
|
||||
const code = c.charCodeAt(0);
|
||||
if (code > 48 && code < 58) return c; // 1-8
|
||||
if (code == 99 || code == 102) return c; //uppercase C and F get pronounced as degrees Fahrenheit/Celsius
|
||||
else if (code > 96 && code < 105) return c.toUpperCase();
|
||||
if (code > 96 && code < 105) return c.toUpperCase();
|
||||
return roles[c] || c;
|
||||
}).join(' ');
|
||||
if (san.includes('+')) move += ' check';
|
||||
|
@ -26,6 +25,8 @@ function hackFix(msg: string): string {
|
|||
return msg
|
||||
.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
|
||||
.replace(/^C /, "c ") // "uppercase C is pronounced as "degrees celsius" when it comes after a number (e.g. R8c3)
|
||||
.replace(/^F /, "f ") // "uppercase C is pronounced as "degrees fahrenheit" when it comes after a number (e.g. R8f3)
|
||||
}
|
||||
|
||||
export function say(text: string, cut: boolean) {
|
||||
|
|
Loading…
Reference in New Issue