diff --git a/src/mfm/language.ts b/src/mfm/language.ts index 53c275342b..5faa08fd9e 100644 --- a/src/mfm/language.ts +++ b/src/mfm/language.ts @@ -148,7 +148,7 @@ export const mfmLanguage = P.createLanguage({ if (hashtag.match(/^(\u20e3|\ufe0f)/)) return P.makeFailure(i, 'not a hashtag'); if (hashtag.match(/^[0-9]+$/)) return P.makeFailure(i, 'not a hashtag'); if (input[i - 1] != null && input[i - 1].match(/[a-z0-9]/i)) return P.makeFailure(i, 'not a hashtag'); - if (hashtag.length > 50) return P.makeFailure(i, 'not a hashtag'); + if (Array.from(hashtag || '').length > 128) return P.makeFailure(i, 'not a hashtag'); return P.makeSuccess(i + ('#' + hashtag).length, createLeaf('hashtag', { hashtag: hashtag })); }), url: () => { diff --git a/src/services/note/create.ts b/src/services/note/create.ts index 0dd0e1962f..fcf991793b 100644 --- a/src/services/note/create.ts +++ b/src/services/note/create.ts @@ -165,7 +165,7 @@ export default async (user: User, data: Option, silent = false) => new Promise tag.length <= 100); + tags = tags.filter(tag => Array.from(tag || '').length <= 128); if (data.reply && (user.id !== data.reply.userId) && !mentionedUsers.some(u => u.id === data.reply!.userId)) { mentionedUsers.push(await Users.findOne(data.reply.userId).then(ensure));