| | 147 | ed.onPreInit.add(function(ed) { |
| | 148 | var commonAttr; |
| | 149 | // Add HTML5 obsolete attributes that are still in use. |
| | 150 | // Can be disabled by setting 'wordpress_allow_obsolete_attr' to false in the init array (using 'tiny_mce_before_init' filter in PHP). |
| | 151 | if ( ed.getParam('wordpress_allow_obsolete_attr', true) ) { |
| | 152 | // This list is taken from TinyMCE 3.5.7 getHTML5() |
| | 153 | commonAttr = 'id|accesskey|class|dir|draggable|item|hidden|itemprop|role|spellcheck|style|subject|title|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup'; |
| | 154 | // Additional attributes from TinyMCE 3.5.7 getHTML4() |
| | 155 | ed.schema.addValidElements('table['+commonAttr+'|summary|width|border|frame|rules|cellspacing|cellpadding|align|bgcolor]'); |
| | 156 | // Adds "name" for <a> |
| | 157 | ed.schema.addValidElements('a['+commonAttr+'|href|target|ping|rel|media|type|name]'); |
| | 158 | } |
| | 159 | }); |
| | 160 | |