I have a trigger (Before Insert) on FeedItem that needs to modify a post by substituting certain words with replacement values, by updating FeedItem.Body. This works fine, except that @mentions are lost - the post looks like plain text; links to mentioned users are lost.
I found this similar question but the proposed solution was to use ConnectApi to post. The problem is, I'm not creating a new post directly, but changing a post in a trigger. Is it possible to preserve formatting while modifying the FeedItem SObject?