Skip to content

ForceMentionsInContent: wrap mentions in a span, fix the formatting

Alex Gleason requested to merge recipients-inline into develop

I am going to allow users to use ForceMentionsInContent MRF with Soapbox and then strip the mentions client-side. I wrapped the inlined mentions with a <span class="recipients-inline"> tag.

However, I noticed the formatting was quite off:

Screenshot_from_2022-01-24_20-09-54

I properly formatted the mentions.

I also noticed it didn't work with local posts. The tag array was empty, even though to had recipients. The to array was also in the correct order. So I rewrote/simplified the code around the to field instead of tag. I think it will be higher performance, even if it excludes some users in rare cases.

Afterwards it works pretty well:

Screenshot_from_2022-01-24_20-18-09

Merge request reports