<div> and toString Fix

Nov 11, 2009 at 11:20 PM

I'm a user of this control and I fix two bug that I found:

First - Edit content inserts <div> element instead a <p> for paragraphs, the solution. In the


init: function(elem, options)

after of 

priv.initEditor.call(this, opts)

 add this code:



var htmlValue = jQuery.trim(this.iframe[0].contentDocument.body.innerHTML);
if (htmlValue.length == 0) { this.iframe[0].contentDocument.body.innerHTML = "<p>&nbsp;</p>"; }


            return $("<p>" + this.editor.body.innerHTML + "</p>").text();


Second - toString function don't returns text plain content, using jquery result function:


toString: function() {
	return $("<p>" + this.editor.body.innerHTML + "</p>").text();

I hope it can be usefulllll.