diff --git a/wp-admin/js/editor.js b/wp-admin/js/editor.js index c823669881..8911dc74e7 100644 --- a/wp-admin/js/editor.js +++ b/wp-admin/js/editor.js @@ -30,13 +30,14 @@ switchEditors = { var blocklist1 = 'blockquote|ul|ol|li|table|thead|tbody|tr|th|td|div|h[1-6]|pre|p'; content = content.replace(new RegExp('\\s*\\s*', 'mg'), '\n'); content = content.replace(new RegExp('\\s*<(('+blocklist1+')[^>]*)>', 'mg'), '\n<$1>'); - + // Mark

if it has any attributes. content = content.replace(new RegExp('(]+>.*?)

', 'mg'), '$1'); + // Sepatate
containing

content = content.replace(new RegExp(']*)>\\s*

', 'mgi'), '\n\n'); - content = content.replace(new RegExp('

\\s*
', 'mgi'), '\n'); + // Remove

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'); @@ -49,7 +50,7 @@ switchEditors = { var blocklist2 = 'blockquote|ul|ol|li|table|thead|tr|th|td|h[1-6]|pre'; content = content.replace(new RegExp('\\s*<(('+blocklist2+') ?[^>]*)\\s*>', 'mg'), '\n<$1>'); content = content.replace(new RegExp('\\s*\\s*', 'mg'), '\n'); - content = content.replace(new RegExp('
  • ', 'g'), '\t
  • '); + content = content.replace(new RegExp(']*)>', 'g'), '\t'); if ( content.indexOf(']*)>\\s*', 'mg'), "");