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: https://develop.svn.wordpress.org/trunk@22600 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2012-11-15 22:56:44 +00:00
parent 709b1f25d0
commit 3fb4a69c08
1 changed files with 10 additions and 4 deletions

View File

@ -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) { ed.onPreInit.add(function(ed) {
// This list is taken from TinyMCE 3.5.7 getHTML5() // The commonAttr are 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'; // Obsolete attributes are from TinyMCE 3.5.7 getHTML4()
// Additional table attributes 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]'); 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 <a> // Adds "name" for <a>
ed.schema.addValidElements('a['+commonAttr+'|href|target|ping|rel|media|type|name]'); ed.schema.addValidElements('a['+commonAttr+'|href|target|ping|rel|media|type|name]');
}); });