From 200121c30ae66774dc2f38efd8e3df5eb82dce43 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Fri, 4 Jan 2008 08:49:35 +0000 Subject: [PATCH] Don't bust table markup when switching between visual and html. Props mdawaffe. fixes #5577 git-svn-id: https://develop.svn.wordpress.org/trunk@6547 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js | 4 ++-- wp-includes/script-loader.php | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js b/wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js index 8a05838429..5d7db79ee4 100644 --- a/wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js +++ b/wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js @@ -244,9 +244,9 @@ var TinyMCE_wordpressPlugin = { // Handle table badness. content = content.replace(new RegExp('<(table( [^>]*)?)>.*?<((tr|thead)( [^>]*)?)>', 'mg'), '<$1><$3>'); - content = content.replace(new RegExp('<(tr|thead|tfoot)>.*?<((td|th)( [^>]*)?)>', 'mg'), '<$1><$2>'); + content = content.replace(new RegExp('<((?:tr|thead|tfoot)(?: [^>]*)?)>.*?<((td|th)( [^>]*)?)>', 'mg'), '<$1><$2>'); content = content.replace(new RegExp('.*?<(td( [^>]*)?|th( [^>]*)?|/tr|/thead|/tfoot)>', 'mg'), '<$2>'); - content = content.replace(new RegExp('.*?<(tr|/table)>', 'mg'), '<$1>'); + content = content.replace(new RegExp('.*?<(tr( [^>]*)?|/table)>', 'mg'), '<$1>'); content = content.replace(new RegExp('<(/?(table|tbody|tr|th|td)[^>]*)>(\\s*|(
)*)*', 'g'), '<$1>'); // Pretty it up for the source editor. diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index 9e18fb5912..39651b4082 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -30,7 +30,9 @@ class WP_Scripts { $this->add( 'colorpicker', '/wp-includes/js/colorpicker.js', false, '3517' ); - $this->add( 'tiny_mce', '/wp-includes/js/tinymce/tiny_mce_gzip.php', false, '20070528' ); + // Modify this version when tinyMCE plugins are changed + $this->add( 'tiny_mce', '/wp-includes/js/tinymce/tiny_mce_gzip.php', false, '20080103' ); + $mce_config = apply_filters('tiny_mce_config_url', '/wp-includes/js/tinymce/tiny_mce_config.php'); $this->add( 'wp_tiny_mce', $mce_config, array('tiny_mce'), '20070528' );