diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2017-01-04 15:32:04 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2017-01-04 15:32:04 +0900 |
| commit | 39eabbd2c0413f14d5b5472e651f9c34abaff2b4 (patch) | |
| tree | 7baa885f32671e78fb81ddbf0ff175123f39b782 /src | |
| parent | Update dependency :rocket: (diff) | |
| download | sharkey-39eabbd2c0413f14d5b5472e651f9c34abaff2b4.tar.gz sharkey-39eabbd2c0413f14d5b5472e651f9c34abaff2b4.tar.bz2 sharkey-39eabbd2c0413f14d5b5472e651f9c34abaff2b4.zip | |
Use nyaize package for nya filter :package:
Diffstat (limited to 'src')
| -rw-r--r-- | src/web/app/common/scripts/text-compiler.js | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/web/app/common/scripts/text-compiler.js b/src/web/app/common/scripts/text-compiler.js index f6c531c6ce..8ea2361b87 100644 --- a/src/web/app/common/scripts/text-compiler.js +++ b/src/web/app/common/scripts/text-compiler.js @@ -1,4 +1,5 @@ const riot = require('riot'); +const nyaize = require('nyaize').default; module.exports = function(tokens, shouldBreak, escape) { if (shouldBreak == null) { @@ -34,10 +35,7 @@ module.exports = function(tokens, shouldBreak, escape) { }).join(''); if (me && me.data && me.data.nya) { - text = text.replace(/な/g, 'にゃ') - .replace(/ニャ/g, 'にゃ') - .replace(/にゃでにゃで/g, 'なでなで') - .replace(/ニャデニャデ/g, 'ナデナデ'); + text = nyaize(text); } return text; |