[wp-trac] [WordPress Trac] #3946: TinyMCE converts strong & em to b & i without checking full tag.

WordPress Trac wp-trac at lists.automattic.com
Fri Mar 9 20:11:09 GMT 2007


#3946: TinyMCE converts strong & em to b & i without checking full tag.
-----------------------------+----------------------------------------------
 Reporter:  Linusmartensson  |       Owner:  anonymous
     Type:  defect           |      Status:  new      
 Priority:  normal           |   Milestone:  2.1.3    
Component:  TinyMCE          |     Version:           
 Severity:  normal           |    Keywords:           
-----------------------------+----------------------------------------------
 I thought this to be a different bug at first, reading the TinyMCE source
 a bit proved me wrong.
 Here's the relevant section:
 {{{
         // Convert all strong/em to b/i in Gecko
         if (tinyMCE.isGecko) {
                 h = h.replace(/<strong/gi, '<b');
                 h = h.replace(/<em(\/?)/gi, '<i');
                 h = h.replace(/<em /gi, '<i');
                 h = h.replace(/<\/strong>/gi, '</b>');
                 h = h.replace(/<\/em>/gi, '</i>');
         }
 }}}
 This is at line 5100 in tiny_mce.js

 This is a perpetrator in the cases where <embed> is replaced with <ibed>.
 I'm not sure what reasons there are for this replacement within gecko, but
 I propse adding a whitespace check to the open versions of the tags -
 merging some of the regexp expressions should also be possible - to avoid
 trashing embed tags.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/3946>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list