[wp-trac] [WordPress Trac] #26975: TinyMCE adding inline line-height styles and spans

WordPress Trac noreply at wordpress.org
Sun Jan 11 17:30:56 UTC 2015


#26975: TinyMCE adding inline line-height styles and spans
--------------------------+-------------------------
 Reporter:  lumpysimon    |       Owner:
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:
Component:  TinyMCE       |     Version:  3.8
 Severity:  normal        |  Resolution:  worksforme
 Keywords:                |     Focuses:
--------------------------+-------------------------

Comment (by Mr. Z):

 This is still a problem.

 The plugin written by lumpysimon is a workaround, but spans with style
 ="line-height: 1.5;" or style="line-height: 1.5em;" continue to get added
 for no apparent reason.

 Also, I rewrote the function to be:

 {{{
 function strip_n_save( $post_id, $post ) {
                 if ( $this->no_recursion )
                         return;
                 $search_for = array(' style="line-height: 1.5em;"', '
 style="line-height: 1.5;"');
                 $post_data = array(
                         'ID'           => $post_id,
                         'post_content' => str_replace( $search_for, '',
 $post->post_content )
                         );
                 $this->no_recursion = true;
                 wp_update_post( $post_data );
                 $this->no_recursion = false;
         }
 }}}

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


More information about the wp-trac mailing list