I would like to write a tinyMCE plugin that allows nesting of sub and soup tags.
Right now I wrote a command that embeds the original HTML 'in the cursor when you press the button / press the shortcut keys. However, this will only work if I can move the cursor to the middle of the new tag.
I can not find any documentation on how to move the cursor. There are some hacks offered, but they are very hacks. It can not be that hard, because, as I understand it, so work the buttons [b]and [i].
Is there a better way to do this? How can I write a tinyMCE function that puts the user in "sub mode" or "sup mode" and allows them to embed the "sub" and "sup" modes?
Thank!
source
share