diff --git a/wp-admin/includes/post.php b/wp-admin/includes/post.php
index 6217db3500..575461229d 100644
--- a/wp-admin/includes/post.php
+++ b/wp-admin/includes/post.php
@@ -1370,7 +1370,9 @@ function wp_tiny_mce( $teeny = false ) {
'accessibility_focus' => true,
'tabfocus_elements' => 'major-publishing-actions',
'media_strict' => false,
- 'save_callback' => 'switchEditors.saveCallback',
+ 'paste_remove_styles' => true,
+ 'paste_remove_spans' => true,
+ 'paste_strip_class_attributes' => 'all',
'wpeditimage_disable_captions' => $no_captions,
'plugins' => "$plugins"
);
diff --git a/wp-admin/js/editor.dev.js b/wp-admin/js/editor.dev.js
index 17c01928e7..fbdeae43c5 100644
--- a/wp-admin/js/editor.dev.js
+++ b/wp-admin/js/editor.dev.js
@@ -6,8 +6,11 @@ jQuery(document).ready(function($){
if ( h )
$('#content').css('height', h.ch - 15 + 'px');
} else {
- $('#content').css('color', 'white');
- $('#quicktags').hide();
+ if ( typeof tinyMCE != 'object' ) {
+ $('#content').css('color', '#000');
+ } else {
+ $('#quicktags').hide();
+ }
}
});
@@ -19,19 +22,6 @@ var switchEditors = {
return document.getElementById(e);
},
- edInit : function() {
- },
-
- saveCallback : function(el, content, body) {
-
- if ( tinyMCE.activeEditor.isHidden() )
- content = this.I(el).value;
- else
- content = this.pre_wpautop(content);
-
- return content;
- },
-
pre_wpautop : function(content) {
var blocklist1, blocklist2;
@@ -41,33 +31,35 @@ var switchEditors = {
return a.replace(/<\/?p( [^>]*)?>[\r\n]*/g, ' [\s\u00a0]*<\/p>/g, ' ]+>.*?)
]+>.*?)<\/p>/g, '$1
'); // Sepatate- content = content.replace(new RegExp('
', 'mgi'), '
/gi, '
and
- content = content.replace(new RegExp('\\s*
', 'mgi'), ''); - content = content.replace(new RegExp('\\s*
\\s*', 'mgi'), '\n\n'); - content = content.replace(new RegExp('\\n\\s*\\n', 'mgi'), '\n\n'); - content = content.replace(new RegExp('\\s*/gi, '');
+ content = content.replace(/\s*<\/p>\s*/gi, '\n\n');
+ content = content.replace(/\n[\s\u00a0]+\n/g, '\n\n');
+ content = content.replace(/\s*
\s*/gi, '\n');
// Fix some block element newline issues
- content = content.replace(new RegExp('\\s*