If you ever need to convert “plain” social media text like:
Hey @importantguy, check out my project https://www.mycoolproject.com/ #PrettyPlease
into “rich” social media text like:
Hey @importantguy, check out my project https://www.mycoolproject.com/ #PrettyPlease
Then you need a social text parsing library. The industry standard is twitter/twitter-text
, but it doesn’t work for everything. (For example, it only parses valid Twitter mentions, but will not parse all valid TikTok mentions, since those screen names can contain a “.”.) So while you may need to customize for your specific use case(s), this post should at least give you a good starting point.