I can't figure out how you to use Redactors this.inline. I want to add a class to a anchor element. Suppose my cursor is inside the anchor and I do this.inline.toggleClass('foo') it will add a span inside the anchor with class foo. If I select the anchor text and do this.inline.format('a', 'class', 'foo') it will remove the anchor tag completely. If I select some text and do this.inline.format('a', 'class', 'foo') it will add a span with class foo but not the anchor tag :(
How are you supposed to add classes or styles to selected text or inline element under the cursor?