diff options
| author | Ch. (Chanhwi Choi) <ccwpc@hanmail.net> | 2019-01-03 08:38:26 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2019-01-03 08:38:26 +0900 |
| commit | 2a344dfbd84ff84e9d79a3c5fc172756bf153954 (patch) | |
| tree | 26864365cd192f533bf80089f0e9af9f77244215 /src/models/note.ts | |
| parent | Update vue-i18n requirement from 8.3.2 to 8.6.0 (#3821) (diff) | |
| download | sharkey-2a344dfbd84ff84e9d79a3c5fc172756bf153954.tar.gz sharkey-2a344dfbd84ff84e9d79a3c5fc172756bf153954.tar.bz2 sharkey-2a344dfbd84ff84e9d79a3c5fc172756bf153954.zip | |
adds ko-KR な to にゃ (#3820)
* adds ko-KR な to にゃ
- this only take considers pre-composed "Hangul Syllables",
not composable area "Hangul Jamo" which are not used commonly
- 56 is '냐' - '나'
* replace magic number as suggested
Diffstat (limited to 'src/models/note.ts')
| -rw-r--r-- | src/models/note.ts | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/models/note.ts b/src/models/note.ts index f334970750..f2fb39051b 100644 --- a/src/models/note.ts +++ b/src/models/note.ts @@ -372,7 +372,14 @@ export const pack = async ( //#endregion if (_note.user.isCat && _note.text) { - _note.text = _note.text.replace(/な/g, 'にゃ').replace(/ナ/g, 'ニャ').replace(/ナ/g, 'ニャ'); + _note.text = (_note.text + // ja-JP + .replace(/な/g, 'にゃ').replace(/ナ/g, 'ニャ').replace(/ナ/g, 'ニャ') + // ko-KR + .replace(/[나-낳]/g, (match: string) => String.fromCharCode( + match.codePointAt(0) + '냐'.charCodeAt(0) - '나'.charCodeAt(0) + )) + ); } if (!opts.skipHide) { |