diff options
| author | MeiMei <30769358+mei23@users.noreply.github.com> | 2018-12-08 06:39:15 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2018-12-08 06:39:15 +0900 |
| commit | 34393ef89f79fe946e29cc677a8e839d72ebdd43 (patch) | |
| tree | 27a5e6984dbbebc7d51074ae558b9d1dfc9797f0 /src/server/api/endpoints/i | |
| parent | Resolve #3537 (#3540) (diff) | |
| download | sharkey-34393ef89f79fe946e29cc677a8e839d72ebdd43.tar.gz sharkey-34393ef89f79fe946e29cc677a8e839d72ebdd43.tar.bz2 sharkey-34393ef89f79fe946e29cc677a8e839d72ebdd43.zip | |
Improve custom emoji parsing (#3539)
* Use MFM parser for extracting emoji in name
* Fix custom emoji regex
* Revert "Fix custom emoji regex"
This reverts commit 4c21caf59753e7653c02f81ddf0cde8c44f48008.
Diffstat (limited to 'src/server/api/endpoints/i')
| -rw-r--r-- | src/server/api/endpoints/i/update.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/server/api/endpoints/i/update.ts b/src/server/api/endpoints/i/update.ts index 0319550109..fbf1dc32e1 100644 --- a/src/server/api/endpoints/i/update.ts +++ b/src/server/api/endpoints/i/update.ts @@ -198,8 +198,8 @@ export default define(meta, (ps, user, app) => new Promise(async (res, rej) => { let emojis = [] as string[]; if (updates.name != null) { - const match = updates.name.match(/:\w{1,100}:/g) as string[]; - if (match) emojis = emojis.concat(match.map(m => m.replace(/:(\w+):/, '$1'))); + const tokens = parse(updates.name, true); + emojis = emojis.concat(extractEmojis(tokens)); } if (updates.description != null) { |