#6566
webern
Member

A basic example. Apply it only for selected text.

with (document.selection){
var STR = Text;
if (!IsEmpty){
var mud = "";
var endPos =0 ;
endPos = STR.lastIndexOf("<");
if (endPos!=-1){
mud = STR.substr(endPos);
STR = STR.substr(0,endPos);
Text = '<a href="' + STR + '" target="blank">' + STR + '</a>' + mud;
} else Text = '<a href="' + STR + '" target="blank">' + STR + '</a>' + "<br>";
}
}