I'm using the code below to paste a link in the Editor from a custom dialog.
var elem = editor.getSelectedElement();
.
.
var
insertLinkCallBack = function(sender, args) {
editor.pasteHtml(
"<a href=\"" + args.href + "\">" + args.html+ "</a>");
}
When I select a piece of text wrapped in <div> the pasted html is wrapped the div twice (?)
Before paste:
<div id="myid">my content<br />
<br /></div>
After paste:
<div id="myid"> <a href="http://mylink">
<div id="myid">my content<br />
<br />
</div></a></div>