I'm using TinyMCE to edit text. When the user selects some text and presses a button, the selected section should be wrapped with <mark></mark> html tags.
The reason I'm not simply adding a custom text formatting button to the tinymce editor is because I want to trigger other actions to happen with the selected text too (i.e. copy and paste the text elsewhere).
How can I do this?