'); content = content.replace(/\r\r/g, '
'); content = content.replace(/\n\n/g, '
'); // Has paragraphs if ((pos = content.indexOf('
')) != -1) { this.editor.execCommand("Delete"); var node = this.editor.selection.getNode(); // Get list of elements to break var breakElms = []; do { if (node.nodeType == 1) { // Don't break tables and break at body if (node.nodeName == "TD" || node.nodeName == "BODY") break; breakElms[breakElms.length] = node; } } while(node = node.parentNode); var before = "", after = "
"; before += content.substring(0, pos); for (var i=0; i";
content = before + content.substring(pos+7) + after;
}
}
if (this.editor.getParam("paste_create_linebreaks", true)) {
content = content.replace(/\r\n/g, ' $1 " + middot + "$1 <\/p>/gi, ""); // Remove pagebreaks
content = content.replace(/-- page break --/gi, ""); // Remove pagebreaks
// content = content.replace(/\/? */gi, "");
// content = content.replace(/ <\/p>/gi, '');
if (!this.editor.getParam('force_p_newlines')) {
content = content.replace('', '' ,'gi');
content = content.replace(' ');
content = content.replace(/<\/h[1-6]>/gi, '
');
content = content.replace(/\r/g, '
');
content = content.replace(/\n/g, '
');
}
}
this.editor.execCommand("mceInsertRawHTML", false, content);
}
},
_insertWordContent : function(content) {
var t = this, ed = t.editor;
if (content && content.length > 0) {
// Cleanup Word content
var bull = String.fromCharCode(8226);
var middot = String.fromCharCode(183);
var cb;
if ((cb = this.editor.getParam("paste_insert_word_content_callback", "")) != "")
content = eval(cb + "('before', content)");
var rl = this.editor.getParam("paste_replace_list", '\u2122,TM,\u2026,...,\u201c|\u201d,",\u2019,\',\u2013|\u2014|\u2015|\u2212,-').split(',');
for (var i=0; i
", "gi"), "
]*>/gi, "");
if (this.editor.getParam("paste_remove_styles", true))
content = content.replace(new RegExp('<(\\w[^>]*) style="([^"]*)"([^>]*)', 'gi'), "<$1$3");
content = content.replace(/<\/?font[^>]*>/gi, "");
// Strips class attributes.
switch (this.editor.getParam("paste_strip_class_attributes", "all")) {
case "all":
content = content.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi, "<$1$3");
break;
case "mso":
content = content.replace(new RegExp('<(\\w[^>]*) class="?mso([^ |>]*)([^>]*)', 'gi'), "<$1$3");
break;
}
content = content.replace(new RegExp('href="?' + this._reEscape("" + document.location) + '', 'gi'), 'href="' + this.editor.documentBaseURI.getURI());
content = content.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi, "<$1$3");
content = content.replace(/<\\?\?xml[^>]*>/gi, "");
content = content.replace(/<\/?\w+:[^>]*>/gi, "");
content = content.replace(/-- page break --\s*
' ,'gi');
}
if (!tinymce.isIE && !this.editor.getParam('force_p_newlines')) {
content = content.replace(/<\/?p[^>]*>/gi, "");
}
content = content.replace(/<\/?div[^>]*>/gi, "");
// Convert all middlot lists to UL lists
if (this.editor.getParam("paste_convert_middot_lists", true)) {
var div = ed.dom.create("div", null, content);
// Convert all middot paragraphs to li elements
var className = this.editor.getParam("paste_unindented_list_class", "unIndentedList");
while (this._convertMiddots(div, "--list--")) ; // bull
while (this._convertMiddots(div, middot, className)) ; // Middot
while (this._convertMiddots(div, bull)) ; // bull
content = div.innerHTML;
}
// Replace all headers with strong and fix some other issues
if (this.editor.getParam("paste_convert_headers_to_strong", false)) {
content = content.replace(/