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: https://develop.svn.wordpress.org/trunk@22411 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2012-11-06 23:36:10 +00:00
parent 1d1417ec55
commit 49d5e725ce
1 changed files with 10 additions and 0 deletions

View File

@ -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 <a>
ed.schema.addValidElements('a['+commonAttr+'|href|target|ping|rel|media|type|name]');
});
ed.onInit.add(function(ed) { ed.onInit.add(function(ed) {
var bodyClass = ed.getParam('body_class', ''), body = ed.getBody(); var bodyClass = ed.getParam('body_class', ''), body = ed.getBody();