This happens, because empty string is evaluated as false in the function:
- Code: Select all
WYMeditor.editor.prototype.html = function(html) {
if(html) jQuery(this._doc.body).html(html);
else return(jQuery(this._doc.body).html());
};
possible fix:
- Code: Select all
WYMeditor.editor.prototype.html = function(html) {
if(typeof html === 'string') jQuery(this._doc.body).html(html);
else return(jQuery(this._doc.body).html());
};
alternate fix:
- Code: Select all
WYMeditor.editor.prototype.html = function(html) {
if(typeof html !== 'undefined') jQuery(this._doc.body).html(html);
else return(jQuery(this._doc.body).html());
};
PS
Some "native" jQuery functions have this bug too.