[wp-trac] [WordPress Trac] #23037: Want to use twitter-bootstrap icons, but TinyMCE strips them out

WordPress Trac noreply at wordpress.org
Fri Mar 28 10:45:22 UTC 2014


#23037: Want to use twitter-bootstrap icons, but TinyMCE strips them out
--------------------------+---------------------
 Reporter:  ruud@…        |       Owner:
     Type:  defect (bug)  |      Status:  closed
 Priority:  high          |   Milestone:  3.9
Component:  TinyMCE       |     Version:  3.5
 Severity:  blocker       |  Resolution:  fixed
 Keywords:                |     Focuses:
--------------------------+---------------------

Comment (by ruud@…):

 I can confirm that <i class="icon icon-glass"></i> tags are not converted
 to <em> or stripped out in the current trunk version, great!
 As I understand correctly from you answer the (non-default) behavior of
 <i> not being converted over to <em> (and <b> to <strong>) is not tested
 for?
 Nor is the non-default behavior of not removing empty <i></i> tags?

 I favor tests for these non-default situations as well, because if this
 behavior gets changed by accident in future releases this will affect
 users who use icon fonts and the like.

 As said I'm not familiar with Unit tests that much, but I guess this is
 something which could work?

 {{{
 text = 'Not transform <i> into <em>';
 testString = '<i class="icon icon-glass">Not empty</i>';
 editor.setContent( testString );
 equal( editor.getContent(), testString, text );

 text = 'Not strip out empty <i> tag';
 testString = '<i class="icon icon-glass"></i>';
 editor.setContent( testString );
 equal( editor.getContent(), testString, text );

 text = 'Not transform <b> into <strong>';
 testString = '<b>Bolded text</b>';
 editor.setContent( testString );
 equal( editor.getContent(), testString, text );

 text = 'Not strip out empty <b> tag';
 testString = '<b class="test"></b>';
 editor.setContent( testString );
 equal( editor.getContent(), testString, text );
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/23037#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list