[wp-hackers] TinyMCE stripping name tag out of PRE elements

Jason Webster jason at intraffic.net
Fri Oct 31 15:26:31 GMT 2008


This is not really a bug per se, though.
It is possible to allow the name attribute of pre tags through TinyMCE's 
code cleanup filter.

The "extended_valid_elements" option of the TinyMCE init object needs to 
include the following:
pre[name]

Now, Wordpress builds the TinyMCE init through PHP, and provides a 
number of actions and filters for plugins to alter it. Off the top of my 
head, I couldn't tell you what the correct action or filter would be to 
add this, but I'm sure someone else could, or it would be very easy to 
find out. The file in which all this happens lives in 
wp-includes/js/tinymce/tiny_mce_config.php.

Good luck.

Andrew Ozz wrote:
> Daniel Brown wrote:
>> What is the procedure for submitting changes to the TinyMCE editor?
>
> TinyMCE is an open source project, http://tinymce.moxiecode.com/
>
>> I'm a fan of the google syntax highlighter library
>> (http://code.google.com/p/syntaxhighlighter/) and use it on my blog
>> but I've noticed that TinyMCE is stripping the name tag out of the PRE
>> elements that are used to identify the code for the highlighter
>> library.
>
> Yes, TinyMCE produces XHTML 1.0 strict output and "name" is an invalid 
> attribute for the <pre> tag.
>
> If you want to use this syntax highlighter, a better/easier option 
> would be to install one of the WordPress plugins that include it.
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers



More information about the wp-hackers mailing list