From 673003bf646946ead3f60e7a15be8e204fb44d1e Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Thu, 15 Nov 2012 22:56:44 +0000 Subject: [PATCH] TinyMCE: extend the allowed obsolete attributes to include tr, th and td (thead, tfoot and tbody weren't around in HTML 3.2), see #22175 git-svn-id: http://core.svn.wordpress.org/trunk@22600 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- .../tinymce/plugins/wordpress/editor_plugin_src.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/wp-includes/js/tinymce/plugins/wordpress/editor_plugin_src.js b/wp-includes/js/tinymce/plugins/wordpress/editor_plugin_src.js index 62681782f0..a50ebf10ee 100644 --- a/wp-includes/js/tinymce/plugins/wordpress/editor_plugin_src.js +++ b/wp-includes/js/tinymce/plugins/wordpress/editor_plugin_src.js @@ -144,12 +144,18 @@ } }); - // Add HTML5 obsolete attributes that are still in use. + // Add obsolete HTML attributes that are still in use. ed.onPreInit.add(function(ed) { - // This list is taken from TinyMCE 3.5.7 getHTML5() - var commonAttr = 'id|accesskey|class|dir|draggable|item|hidden|itemprop|role|spellcheck|style|subject|title|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup'; - // Additional table attributes from TinyMCE 3.5.7 getHTML4() + // The commonAttr are from TinyMCE 3.5.7 getHTML5() + // Obsolete attributes are from TinyMCE 3.5.7 getHTML4() + var commonAttr = 'id|accesskey|class|dir|draggable|item|hidden|itemprop|role|spellcheck|style|subject|title|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup', + tdAttr = commonAttr + '|abbr|axis|headers|scope|rowspan|colspan|char|charoff|align|valign|halign|nowrap|bgcolor|width|height'; + // Obsolete table attributes ed.schema.addValidElements('table['+commonAttr+'|summary|width|border|frame|rules|cellspacing|cellpadding|align|bgcolor]'); + // Obsolete tr attributes + ed.schema.addValidElements('tr['+commonAttr+'|align|char|charoff|valign|halign|bgcolor]'); + // Obsolete td and th attributes + ed.schema.addValidElements('td['+tdAttr+'],th['+tdAttr+']'); // Adds "name" for ed.schema.addValidElements('a['+commonAttr+'|href|target|ping|rel|media|type|name]'); });