1
0
mirror of https://github.com/hotomoe/hotomoe synced 2024-12-04 17:58:10 +09:00

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.
This commit is contained in:
MeiMei 2018-12-08 06:39:15 +09:00 committed by syuilo
parent e2843a5ce4
commit 34393ef89f

View File

@ -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) {