fix IPA display

This commit is contained in:
an-lee
2024-05-21 18:43:47 +08:00
parent 756a5e6611
commit 62a1b38739

View File

@@ -83,7 +83,7 @@ export const convertWordIpaToNormal = (
const mark = ipa.match(/(\ˈ|ˌ)/);
let j = i - 1;
for (; j >= 0; j--) {
for (; j > 0 && j > i - 2; j--) {
if (consonantsRegex.test(ipas[j]) && !consonantsRegex.test(ipas[j - 1])) {
break;
}