function OnClientInit(editor) {
    oldFun = editor.GetHtml;

    editor.GetHtml = function(runFilters) {
        if (editor.GetMode() != 1) return oldFun.call(editor, runFilters);

        //Check if a P tag exists that "wraps" all content   
        var contentArea = editor.GetContentArea();
        var wrapper = false;

        if (contentArea.firstChild
            && ("P" == contentArea.firstChild.tagName)
            && (contentArea.childNodes.length == 1)
            && (contentArea.innerHTML.substring(0, 3).toLowerCase() == "<p>")
        ) {
            wrapper = true;
        }

        var html = oldFun.call(editor, runFilters);
        //alert(wrapper + " Current html! + " + html);                 
        if (wrapper) {
            html = "<p>" + html + "</p>";
        }

        return html;
    }
}
