Range object references to
TextNode on the page. Some Tools may also provide actions for additional interactions with the user.
isInline static getter:
Inline Tools must provide three methods to work with Editor:
Render method must return HTML element of the button for Inline Toolbar. When user selects some text Editor calls
checkState method of each Inline Tool with current
Selection to update the state if selected text contains some of the inline markup. Finally, when button is pressed Editor calls
surround method of the tool with
Range object as an argument:
Lets create the basic structure of the Tool and add primitive implementation for methods.
For now if highlight is applied you can't redo it. How to deal with that you can read at Using API article.