Fix bug for no spacing before numbers

This commit is contained in:
Astrian Zheng 2024-04-17 21:39:11 +10:00
parent 07175c8bac
commit a871219fd7
Signed by: Astrian
SSH Key Fingerprint: SHA256:rVnhx3DAKjujCwWE13aDl7uV6+9U1MvydLkNRXJrBiA

View File

@ -41,7 +41,7 @@ function processText(node: Node, spacingCharacter: string): void {
// if the char is chinese or japanese (kanji or kana) // if the char is chinese or japanese (kanji or kana)
if (cnchar_and_kanji.test(textArr[i]) || kana.test(textArr[i])) { if (cnchar_and_kanji.test(textArr[i]) || kana.test(textArr[i])) {
// if next char is english // if next char is english
if (/[a-zA-Z]/.test(textArr[i + 1])) { if (english_and_number.test(textArr[i + 1])) {
// 1/8 em space // 1/8 em space
newText += textArr[i] + spacingCharacter newText += textArr[i] + spacingCharacter
} else { } else {