mirror of
https://iceshrimp.dev/crimekillz/trashposs
synced 2024-11-25 02:09:05 +01:00
Use nyaize package for nya filter 📦
This commit is contained in:
parent
bfb240c7f4
commit
5bba261988
@ -149,6 +149,7 @@ const aliasifyConfig = {
|
||||
'chart.js': './node_modules/chart.js/src/chart.js',
|
||||
'textarea-caret-position': './node_modules/textarea-caret/index.js',
|
||||
'misskey-text': './src/common/text/index.js',
|
||||
'nyaize': './node_modules/nyaize/built/index.js',
|
||||
'strength.js': './node_modules/syuilo-password-strength/strength.js',
|
||||
'cropper': './node_modules/cropperjs/dist/cropper.js',
|
||||
'Sortable': './node_modules/sortablejs/Sortable.js',
|
||||
|
@ -102,6 +102,7 @@
|
||||
"ms": "0.7.2",
|
||||
"multer": "1.2.1",
|
||||
"nprogress": "0.2.0",
|
||||
"nyaize": "0.0.2",
|
||||
"page": "1.7.1",
|
||||
"prominence": "0.2.0",
|
||||
"pug": "2.0.0-beta6",
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user