How to make an element in a TinyMCE editor treated as a non-editable single item?
After trying about 100 different work arounds, we finally found a solution which works (for our needs anyway).
We're inserting a disabled button with all the styles removed. For example,
<input type="button" class="token" value="my token" disabled="disabled" />
And then adding some code to onGetContent() to convert the input to plain text.
This solution, although not very elegant,
- Makes the token behave as a single character/item.
- Makes it read only.
- Is dynamic in the context of the editor so we can display our token text.
Edit: This is what we ended up with.