WordPress.org

Make WordPress Core

Ticket #6272: mce.patch

File mce.patch, 2.1 KB (added by azaozz, 10 years ago)
  • wp-admin/js/editor.js

     
    2626    pre_wpautop : function(content) {
    2727           // We have a TON of cleanup to do.
    2828
    29         // Remove anonymous, empty paragraphs.
    30         content = content.replace(new RegExp('<p>(\\s|&nbsp;|<br />)*</p>', 'mg'), '');
    31 
    3229        // Mark </p> if it has any attributes.
    3330        content = content.replace(new RegExp('(<p[^>]+>.*?)</p>', 'mg'), '$1</p#>');
    3431
     32//content = content.replace(new RegExp('\\s*</p>\\s*', 'mgi'), '</p>\n\n');
     33//content = content.replace(new RegExp('\\s*<br ?/?>\\s*', 'gi'), '<br />\n');
     34//content = content.replace(new RegExp('( )+', 'g'), ' ');
     35
    3536        // Get it ready for wpautop.
    36         content = content.replace(new RegExp('\\s*<p>', 'mgi'), '');
     37        content = content.replace(new RegExp('<div([^>]*)>\\s*<p>', 'g'), '<div$1>\n\n');
     38                content = content.replace(new RegExp('\\s*<p>', 'mgi'), '');
    3739        content = content.replace(new RegExp('\\s*</p>\\s*', 'mgi'), '\n\n');
    3840        content = content.replace(new RegExp('\\n\\s*\\n', 'mgi'), '\n\n');
    3941        content = content.replace(new RegExp('\\s*<br ?/?>\\s*', 'gi'), '\n');
  • wp-includes/script-loader.php

     
    3333                $visual_editor = apply_filters('visual_editor', array('tiny_mce'));
    3434                $this->add( 'editor', false, $visual_editor, '20080218' );
    3535
    36                 $this->add( 'editor_functions', '/wp-admin/js/editor.js', false, '20080312' );
     36                $this->add( 'editor_functions', '/wp-admin/js/editor.js', false, '20080317' );
    3737
    3838                // Modify this version when tinyMCE plugins are changed.
    39                 $mce_version = apply_filters('tiny_mce_version', '20080312');
     39                $mce_version = apply_filters('tiny_mce_version', '20080317');
    4040                $this->add( 'tiny_mce', '/wp-includes/js/tinymce/tiny_mce_config.php', array('editor_functions'), $mce_version );
    4141
    4242                $this->add( 'prototype', '/wp-includes/js/prototype.js', false, '1.6');