[wp-trac] [WordPress Trac] #19855: Too much text in <pre> tag causes no output

WordPress Trac wp-trac at lists.automattic.com
Thu Jan 19 19:47:26 UTC 2012


#19855: Too much text in <pre> tag causes no output
--------------------------+------------------------------
 Reporter:  helenyhou     |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Formatting    |     Version:  1.2
 Severity:  normal        |  Resolution:
 Keywords:                |
--------------------------+------------------------------

Comment (by azaozz):

 Generally wpautop should be leaving the content of the `<pre>` tags
 untouched. How about we replace any `<pre> ... </pre>` with placeholders
 at the beginning and put them back at the end? That would not only remove
 this preg_replace_callback() (and the backtracking) but also speed up
 wpautop as it wouldn't backtrack through these parts of the post_content.

 Coding this wouldn't be hard: `preg_split('|</?pre[ >]|', $pee, -1,
 PREG_SPLIT_DELIM_CAPTURE)`, then go through the array and replace strings
 starting with `<pre` with incremental placeholder, keeping them for later
 in an `array('placeholder_#' => 'string', ...)`.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/19855#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list