From 780f868251f07411a41640aa8059254fbb61e41a Mon Sep 17 00:00:00 2001 From: mattyatea Date: Sun, 29 Oct 2023 19:11:46 +0900 Subject: [PATCH] =?UTF-8?q?fix:nyaize=E3=81=8C=E3=81=8A=E3=81=8B=E3=81=97?= =?UTF-8?q?=E3=81=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: mattyatea --- packages/frontend/src/scripts/nyaize.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/frontend/src/scripts/nyaize.ts b/packages/frontend/src/scripts/nyaize.ts index 0ac77e10067c..f262f2824018 100644 --- a/packages/frontend/src/scripts/nyaize.ts +++ b/packages/frontend/src/scripts/nyaize.ts @@ -8,9 +8,9 @@ export function nyaize(text: string): string { // ja-JP .replaceAll('な', 'にゃ').replaceAll('ナ', 'ニャ').replaceAll('ナ', 'ニャ') // en-US - .replace(/(?<=n)a/gi, x => x === 'A' ? 'YA' : 'ya') - .replace(/(?<=morn)ing/gi, x => x === 'ING' ? 'YAN' : 'yan') - .replace(/(?<=every)one/gi, x => x === 'ONE' ? 'NYAN' : 'nyan') + .replace(/(n)a/gi, (match, p1) => p1 === 'A' ? 'YA' : 'ya') + .replace(/(morn)ing/gi, (match, p1) => p1 === 'ING' ? 'YAN' : 'yan') + .replace(/(every)one/gi, (match, p1) => p1 === 'ONE' ? 'NYAN' : 'nyan') // ko-KR .replace(/[나-낳]/g, match => String.fromCharCode( match.charCodeAt(0)! + '냐'.charCodeAt(0) - '나'.charCodeAt(0),