It looks like this works:
let range = content.selectedRange()
markdownText = content.string
if let index = Range(range, in: markdownText){
content.replaceCharacters(in: range, with: "**\(markdownText[index])**")
}
It provides the selected text snippet I need to wrap it in ** **
. @MartinR's linked SO post helped me see that I can convert the string index with Range()
.