I have configured the tinyMCE
editor with a custom context menu. When I right-click on any word in the editor, the chosen word gets highlighted. I am able to get the selected text with editor.selection.getContent()
.
- How do I get the start and end points of the selected text within the entire text that is currently in the tinyMCE editor? I tried
editor.selection.getStart()
andgetEnd()
, but that has not yielded enough results.
My task is to take the start and end indices and get the previous word with it. I am currently using tinymce-3.5.10
.