Fix hashtag processing when sending toots
This fixes crashes in pleroma when writing toots with a content warning, since pleroma inserts a “nsfw” hashtag that isn't part of the toot's text.
This commit is contained in:
parent
48d00ac0d9
commit
762e4fdf55
@ -2,7 +2,7 @@ export function recoverHashtags (recognizedTags, text) {
|
|||||||
return recognizedTags.map(tag => {
|
return recognizedTags.map(tag => {
|
||||||
const re = new RegExp(`(?:^|[^\/\)\w])#(${tag.name})`, 'i');
|
const re = new RegExp(`(?:^|[^\/\)\w])#(${tag.name})`, 'i');
|
||||||
const matched_hashtag = text.match(re);
|
const matched_hashtag = text.match(re);
|
||||||
return matched_hashtag ? matched_hashtag[1] : tag;
|
return matched_hashtag ? matched_hashtag[1] : null;
|
||||||
}
|
}
|
||||||
);
|
).filter(x => x !== null);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user