You are not logged in.
Hi, I'd like to know which plugin would be the closest to work from, to basically create a plugin that will wrap highlighted text with a bit of code, like
<span class="foo"> highlighted </span>
when a toolbar button is clicked.
It seems like this is just similar to what clicking italic or bold on the toolbar does... On the same topic, is there already a plugin for wrapping highlighted text in custom strings?
Offline
I found this function that looks like it would do what I am saying, but it's commented as being buggy:
/**
* Call this function to surround the existing HTML code in the selection with
* your tags. FIXME: buggy! Don't use this
* @todo: when will it be deprecated ? Can it be removed already ?
* @private (tagged private to not further promote use of this function)
* @deprecated
*/
Xinha.prototype.surroundHTML = function(startTag, endTag)
{
var html = this.getSelectedHTML();
// the following also deletes the selection
this.insertHTML(startTag + html + endTag);
};
So how do I accomplish the same without using this deprecated function?
Offline