[wp-trac] [WordPress Trac] #43486: The Problem with HTML and wpautop

WordPress Trac noreply at wordpress.org
Wed Mar 7 13:24:26 UTC 2018


#43486: The Problem with HTML and wpautop
-----------------------------+-----------------------------
 Reporter:  jim5471          |      Owner:
     Type:  feature request  |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  TinyMCE          |    Version:  trunk
 Severity:  normal           |   Keywords:
  Focuses:                   |
-----------------------------+-----------------------------
 Most editors use the VISUAL mode in The TinyMCE editor but there are a
 minority of editors who use the TEXT mode.

 The TEXT mode allows editors to input raw HTML code.

 If they program in HTML4 then wpautop reformats the code and sometimes
 introduces paragraph errors.

 HTML5 is a greater problem and should be avoided.

 wpautop can be turned off but this is not a realistic solution in a multi-
 user situation.


 I would like to propose this easy modification as a possible solution.

 1. Editors who want to turn off wpautop should insert "[WPAUTOP-OFF]" at
 the top of their script.

 2. wp-includes/formatting.php should be changed with this additional code


 {{{
 LINE  439   function wpautop( $pee, $br = true ) {
         /*
          * If "[WPAUTOP-OFF]" is present in $pee then
          * return $pee with "[WPAUTOP-OFF]" removed and no other changes
          */
         if ( false !== strpos( $pee, "[WPAUTOP-OFF]" ) ) {
                 $pee = str_replace("[WPAUTOP-OFF]", "", $pee);
                 return $pee; }
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/43486>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list