Format text as you type in constant time, given certain character prefixes such as hashtags and mentions.