The clear function was modified to make this work...
This function works only when the link is selected and
the Eraser icon is clicked... It does not removes the link
when a paragraph is selected and the remove formating
is done... it only function will be when the link it self is
selected.
Just for your information....
function c_clear( e ) {
var r = range();
r.execCommand( e.cmd );
if( r.control ) {
r.item(0).style.cssText = '';
r.item(0).className = '';
} else {
var e = r.parentElement();
if( e.tagName == 'SPAN' ) {
e.outerHTML =
e.outerHTML.replace( /<\/?span(?:\s+?.*?)?>/gi, '' );
} else {
if( e.tagName == 'A' ) {
e.outerHTML =
e.outerHTML.replace( /<\/?a(?:\s+?.*?)?>/gi, '' );
} else {
e.innerHTML =
e.innerHTML.replace( /<\/?span(?:\s+?.*?)?>/gi, '' );
}
}
var elts = e.all;
var s = d.body.createTextRange();
for( var i = 0; i < elts.length; i++ ) {
s.moveToElementText( elts
[i] );
r.inRange( s ) && elts
[i].className && ( elts[i].className = '' );
}
}
}
NewVersion: aiEditor.htc file modified for my project may not nessesarly what u are looking for?