Text transformation functions for implementing a markdown toolbar in an iOS app.