wrapSelection

Toggles style markup around the selection range of text: wraps an unwrapped selection, removes the delimiters from an already-wrapped one, and inserts an empty delimiter pair for a collapsed cursor. Whitespace is kept outside the delimiters, delimiter characters the selection cuts through are absorbed, and orphaned delimiters left elsewhere are cleaned up.