问题 I am working on a rich text editor in a Mac app that uses Markdown syntax. I use NSTextStorage to watch for matches in Markdown syntax, then apply styles to the NSAttributedString in real time like this: At this point, I'm already in way over my head on this stuff, but I'm excited to be making progress. :) This tutorial was very helpful. As a next step, I want to hide the Markdown characters when the NSTextView 's string is rendered. So in the example above, once the last asterisk is typed, I