diff options
| author | syuilo <4439005+syuilo@users.noreply.github.com> | 2025-04-09 08:05:27 +0900 |
|---|---|---|
| committer | syuilo <4439005+syuilo@users.noreply.github.com> | 2025-04-09 08:05:27 +0900 |
| commit | 0f79db6a4da851f8d244345f4b9c81d853de235d (patch) | |
| tree | d8fbd357fa592ca1073520178e879efdb1c424f6 /packages/frontend/src/utility | |
| parent | add missing SearchMarker (diff) | |
| download | misskey-0f79db6a4da851f8d244345f4b9c81d853de235d.tar.gz misskey-0f79db6a4da851f8d244345f4b9c81d853de235d.tar.bz2 misskey-0f79db6a4da851f8d244345f4b9c81d853de235d.zip | |
refactor
Diffstat (limited to 'packages/frontend/src/utility')
| -rw-r--r-- | packages/frontend/src/utility/intl-string.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/packages/frontend/src/utility/intl-string.ts b/packages/frontend/src/utility/intl-string.ts index 4bc51e2cb0..cf715513a5 100644 --- a/packages/frontend/src/utility/intl-string.ts +++ b/packages/frontend/src/utility/intl-string.ts @@ -65,10 +65,11 @@ const hyphens = [ ]; const hyphensCodePoints = hyphens.map(code => `\\u{${code.toString(16).padStart(4, '0')}}`); +const hyphensRegex = new RegExp(`[${hyphensCodePoints.join('')}]`, 'ug'); /** ハイフンを統一(ローマ字半角入力時に`ー`と`-`が判定できない問題の調整) */ export function normalizeHyphens(str: string) { - return str.replace(new RegExp(`[${hyphensCodePoints.join('')}]`, 'ug'), '\u002d'); + return str.replace(hyphensRegex, '\u002d'); } /** |