From c09c079a6f9c9f76cd450ad8c4b349a3415c8870 Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Tue, 6 Nov 2012 23:36:10 +0000 Subject: [PATCH] Allow commonly used obsolete HTML5 attributes in TinyMCE, table[summary|width|border|frame|rules|cellspacing|cellpadding|align|bgcolor] and a[name], fixes #22175 git-svn-id: http://core.svn.wordpress.org/trunk@22411 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- .../js/tinymce/plugins/wordpress/editor_plugin_src.js | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 54052c7473..62681782f0 100644 --- a/wp-includes/js/tinymce/plugins/wordpress/editor_plugin_src.js +++ b/wp-includes/js/tinymce/plugins/wordpress/editor_plugin_src.js @@ -144,6 +144,16 @@ } }); + // Add HTML5 obsolete 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() + ed.schema.addValidElements('table['+commonAttr+'|summary|width|border|frame|rules|cellspacing|cellpadding|align|bgcolor]'); + // Adds "name" for + ed.schema.addValidElements('a['+commonAttr+'|href|target|ping|rel|media|type|name]'); + }); + ed.onInit.add(function(ed) { var bodyClass = ed.getParam('body_class', ''), body = ed.getBody();